Hey all,
I'm teaching myself how to program PIC's. After about a week of pouring through tutorials and datasheets I came up with the attached code. I've also attached the datasheet for the 16F72 that was given to me to play with. I'm using the latest MPLAB and an McCon (PICStart) programmer, no motherboard. I was also careful to create adequate file paths in this case C:\PIC\PulseSw\
I'm not sure if I've calculated my delay loops correctly. And I had to create my own circuit to test my code.
I can successfully build and write this program except the intended LED goes on at power-up and the switch does nothing.
My circuit is simple enough:
12V 2A transformer, a rectifier with appropriate filter, and a 7805 voltage regulator + filters
+5V on Vdd (Pin20)
GND on Vss (Pin8)
GND on Vss (Pin19)
+5V on MCLR with series 1kΩ resistor
Normally open push-button switching GND directly on Pin 23 (pull-up resistors set on PORTB)
LED with series 330Ω resistor from Pin 22 to GND
I'm at a loss as to why this isn't working.
So thanks in advance for taking the time with giving me a hand!!
I'm teaching myself how to program PIC's. After about a week of pouring through tutorials and datasheets I came up with the attached code. I've also attached the datasheet for the 16F72 that was given to me to play with. I'm using the latest MPLAB and an McCon (PICStart) programmer, no motherboard. I was also careful to create adequate file paths in this case C:\PIC\PulseSw\
I'm not sure if I've calculated my delay loops correctly. And I had to create my own circuit to test my code.
I can successfully build and write this program except the intended LED goes on at power-up and the switch does nothing.
My circuit is simple enough:
12V 2A transformer, a rectifier with appropriate filter, and a 7805 voltage regulator + filters
+5V on Vdd (Pin20)
GND on Vss (Pin8)
GND on Vss (Pin19)
+5V on MCLR with series 1kΩ resistor
Normally open push-button switching GND directly on Pin 23 (pull-up resistors set on PORTB)
LED with series 330Ω resistor from Pin 22 to GND
I'm at a loss as to why this isn't working.
So thanks in advance for taking the time with giving me a hand!!