Im new to pic/microcontrollers and im trying to get a 16F84A to simply flash an LED, it however does nothing unless i touch the crystal which results in the LED lighting for the duration the contact. Ive also tried a 10Mhz crystal and it behaves the same.
Makes no sense to have the 220R on OSC1 pin, ditch that. You have effectively created an RC circuit, which is creating a delay on the oscillator. The capacitors for the crystal are critical, and must be installed. Also put a 0.1uf capacitor as near to the V+ and GND pins of the 16f84A as possible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Im new to pic/microcontrollers and im trying to get a 16F84A to simply flash an LED, it however does nothing unless i touch the crystal which results in the LED lighting for the duration the contact. Ive also tried a 10Mhz crystal and it behaves the same.
Here is my circuit:
http://img.photobucket.com/albums/v729/frontmandan/untitled.jpg
Here is the code im using:
'Chip model
#chip 16F84A, 20
'Set the pin directions
dir PORTB.5 out
'Main routine
Start:
'Turn one LED on
SET PORTB.5 ON
wait 1 sec
'Now toggle the LEDs
SET PORTB.5 OFF
wait 1 sec
'Jump back to the start of the program
goto Start
Does anyone have any idea why i may be having these issues?
thanks in advance
Dan
Makes no sense to have the 220R on OSC1 pin, ditch that. You have effectively created an RC circuit, which is creating a delay on the oscillator. The capacitors for the crystal are critical, and must be installed. Also put a 0.1uf capacitor as near to the V+ and GND pins of the 16f84A as possible.
Thanks for your help, this solved my issue :D