??? 08/16/07 14:09 Read: times |
#143348 - Sink instead of source Responding to: ???'s previous message |
Your micro cannot source enough current to drive the LED, but only sink. So, connect one end of your resistor to Vcc (instead to ground), connect the other end of this resistor to anode of LED and connect the cathode of LED to P1.0.
Also, your code is unsuited, because it makes the LED blink too fast! So fast, that you cannot see the blinking with your eyes. I would recommend to use an internal timer, or at least an enhanced waiting loop. For instance, the loop code snippet could look like that: led1 equ p1.0 loop: mov r2, #100h loop2: mov r1, #255h loop1: mov r0, #255h loop0: djnz r0, loop0 djnz r1, loop1 djnz r2, loop2 cpl led1 sjmp loop Kai |