From: Raphael N. <rn...@we...> - 2008-05-18 14:20:17
|
> The LED is connected to the PIC16F877A PORTD. From the PORTD there is a > Resistor. > And the LED located between the resistor and ground. > > To light on the LED.. i should do > > TRISD = 0x00; > PORTD = 0x3F ? I would say 'yes' to that; TRISD=0 makes all pins Outputs (all 1's would make them Inputs; 0=O; 1=I). Another problem in your code: delay() takes an (unsigned) char argument, but you pass in 1000, which is truncated to 1000 % 256 = 232. What *do* you see: LED full bright on, LED completely dark, LED half bright on? What compiler/linker options do you use? Regards, Raphael |