Clocking the PIC 16F84A

I’m trying to get back into my microcontroller projects and am, as usual, having problems.

The 16F84A is my chip of choice at the moment. I have some 16F684’s that include internal oscillators, but my programmer doesn’t support them. I need to either build a NOPP programmer or get a 16F628 and load the latest firmware on it, then replace the old 16F628 in my current programmer.

So for now I’m using the 16F84A, but I can’t get the clocking correct. It needs an external oscillator, such as a resistor/capacitor network or a resonator. I’m trying to use a 4mhz resonator, but it just doesn’t work.

The resonator has three pins. the center goes to ground and the others go to OSC1 and OSC2 on the PIC. I have some simple code on the PIC to flash LEDs on PORTB, and it works fine in the simulator.

On my real circuit it just sits there with the LED on. If I put my hand near the chip it will flash intermittently, as if the code is running.

I’ve tried all four oscillator types when programming (LP, XT, HS, and RC), even though I think XT should be used with a 4mhz resonator.

I’m currently chatting with some people on the Microchip forums, but haven’t figured it out yet. For some reason their forums are horribly slow and prone to random errors.

My goal at the moment is to display text on a HD4478 LCD screen. I already wrote the code to do it, and it works in the simulator. If I ever figure out how to clock this thing, I may get it working!

September 07, 2005
bigsight profiles | HomeTalk tours - virtual home tours