Re: How to Declare GPIO vs Alternate function using 8051 Micro-C





benn686@xxxxxxxxxxx wrote:

> How do you tell the micro-c compiler that you want to use the pin as a
> general purpose i/o versus use the alternative function (like pwm)..
>
> For example, the PWM uses pins CEX0-CEX4, and according to the 8051
> data***, the port pin must be set to to '1' inorder for the pwm to
> drive it.
> HOWEVER, If I set the bit this way, "setbit(1.3)", this is how you
> configure the port pin to be an input gpio (opposite of what I want).
>
> Is there another way to initialize a port for alternative function and
> gpio+direction?

The 8051 STANDARD pins are quas-bidirectional. The is not make it and
input or out put.
If a pin is set to 1 (by bit or byte) other things like in puts or the PWM
can pull it down.

the 8051 core has been added to by many manufactures. Additional feature
pins may not work this way.

Goto www.8052.com look for the Links to the "bible" which are the
original complete data books online.


.