Mr.Cool
Advanced Member level 2
Blink a LED finally works!
i had a friend at sk00l bring in his pic chips and his programmer. we used my blink-a-led software. we programmed his chip and tested it, it worked fine.
then we programmed my chip, but put it in his hardware, and walla -LED blinks!- . this is at 4 MHz.
right, my chip, even though 16F877, is a 4MHz device. but then, just for fun we removed the 4MHz crystal from his hardware and put in a 20MHz crystal. put my pic chip back in, and it worked too!! either the device workth with 20MHz or it was seriously over clocked.
so the problem is with my hardware, as we already knew
going over every square mm with a multimeter, we discovered the problem.
the output of Port B.0 went to a 10K resistor, then to LED, then to ground.
but 10Kohm is WAY to high for an LED. it should be around 330 Ohm. oops... i did not catch this earlier because i had put my voltage supply (a big desktop power supply unity) on to the leg of the resistor and to ground and the LED lit up. so i thought "everything works".
but of course the power supply can provide MUCH more current than the PIC chip, so it was able to drive past the 10K resistor, where the PIC chip can not. i was fooled into thinking it was "ok".
i removed the 10K resistor and replaced it with lower value. it works fine
i hope that this thread we started will help future PIC newbies as it did for me!
Thanks for your help everyone.
Mr.Cool
i had a friend at sk00l bring in his pic chips and his programmer. we used my blink-a-led software. we programmed his chip and tested it, it worked fine.
then we programmed my chip, but put it in his hardware, and walla -LED blinks!- . this is at 4 MHz.
right, my chip, even though 16F877, is a 4MHz device. but then, just for fun we removed the 4MHz crystal from his hardware and put in a 20MHz crystal. put my pic chip back in, and it worked too!! either the device workth with 20MHz or it was seriously over clocked.
so the problem is with my hardware, as we already knew
going over every square mm with a multimeter, we discovered the problem.
the output of Port B.0 went to a 10K resistor, then to LED, then to ground.
but 10Kohm is WAY to high for an LED. it should be around 330 Ohm. oops... i did not catch this earlier because i had put my voltage supply (a big desktop power supply unity) on to the leg of the resistor and to ground and the LED lit up. so i thought "everything works".
but of course the power supply can provide MUCH more current than the PIC chip, so it was able to drive past the 10K resistor, where the PIC chip can not. i was fooled into thinking it was "ok".
i removed the 10K resistor and replaced it with lower value. it works fine
i hope that this thread we started will help future PIC newbies as it did for me!
Thanks for your help everyone.
Mr.Cool