# advace for the 16F877

Status
Not open for further replies.

#### MARWEN007

##### Junior Member level 2 advIce for the 16F877

Good evening I want to know is what the pic 16F877 we allow applications to multiplication and division as geometric functions, for example (fct sines and cosines )????

#### horace1

##### Advanced Member level 5 • MARWEN007

### MARWEN007

Points: 2
Helpful Answer Positive Rating

#### MARWEN007

##### Junior Member level 2 excuse me well I'm still newbie to praogrammations peak in our case of the 16F877. good question I ask myself the 16F877 I can do simple multiplication and division for example if I have a constant in my program and I will multiply or divs each variable with that i can c? otherwise I will determine a phase shift FI and I calculated the cosine FI? The 16F877 may atteidre these calculations?

#### horace1

##### Advanced Member level 5 • MARWEN007

### MARWEN007

Points: 2
Helpful Answer Positive Rating

#### are

##### Advanced Member level 4 You can use CCSC has built in Funtions

PHP:
SIN( )
COS( )
TAN( )
ASIN( )
ACOS()
ATAN()
SINH()
COSH()
TANH()
ATAN2()

--------------------------------------------------------------------------------

Syntax:
val = sin (rad)

val = cos (rad)

val = tan (rad)

rad = asin (val)

rad1 = acos (val)

rad = atan (val)

rad2=atan2(val, val)

result=sinh(value)

result=cosh(value)

result=tanh(value)

Parameters:
rad is a float representing an angle in Radians -2pi to 2pi.  val is a float with the range -1.0 to 1.0.  Value is a float.

Returns:
rad is a float representing an angle in Radians -pi/2 to pi/2

val is a float with the range -1.0 to 1.0.

rad1 is a float representing an angle in Radians 0 to pi

rad2 is a float representing an angle in Radians -pi to pi

Result is a float

Function:
These functions perform basic Trigonometric functions.

sin
returns the sine value of the parameter (measured in radians)

cos
returns the cosine value of the parameter (measured in radians)

tan
returns the tangent value of the parameter (measured in radians)

asin
returns the arc sine value in the range [-pi/2,+pi/2] radians

acos
returns the arc cosine value in the range[0,pi] radians

atan
returns the arc tangent value in the range [-pi/2,+pi/2] radians

atan2
returns the arc tangent of y/x in the range [-pi,+pi] radians

sinh
returns the hyperbolic sine of x

cosh
returns the hyperbolic cosine of x

tanh
returns the hyperbolic tangent of x

Note on error handling:

If "errno.h" is included then the domain and range errors are stored in the errno variable. The user can check the errno to see if an error has occurred and print the error using the perror function.

Domain error occurs in the following cases:

asin: when the argument not in the range[-1,+1]

acos: when the argument not in the range[-1,+1]

atan2: when both arguments are zero

Range error occur in the following cases:

cosh: when the argument is too large

sinh: when the argument is too large

Availability:
All devices

Requires:
math.h must be included.

Examples:
float phase;

// Output one sine wave

for(phase=0; phase<2*3.141596; phase+=0.01)

set_analog_voltage( sin(phase)+1 );

Example Files:
ex_tank.c

Also See:
log(), log10(), exp(), pow(), sqrt()

• MARWEN007

### MARWEN007

Points: 2
Helpful Answer Positive Rating
Status
Not open for further replies.

Replies
6
Views
2K
Replies
1
Views
2K
Replies
10
Views
2K
Replies
5
Views
1K
Replies
3
Views
2K