BiPOM Forum
General => Microcontroller Development Systems => 8051 Development Tools => Topic started by: enliteneer on December 07, 2005, 01:23:44 pm
-
How do you tell the micro-c compiler that you want to use the pin as a general purpose i/o versus use a alternative function (like pwm)..
For example, the PWM uses pins CEX0-CEX4, and according to the 8051 datasheet, 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 will configure it as an \'input\', right?
Is there another way to initialize a port for gpio+direction and alternative function?
-
Please read
http://www.bipom.com/cgi-bin/yabb/YaBB.pl?board=8051;action=display;num=1114595527
setbit(P1.3) ;// input or weak pull-up output
clrbit(P1.3); // low output
-
here is PWM example
http://www.bipom.com/support/PWM.zip