Microchip PIC16F84A

16f84A Banner
In a recent lab assignment, I’m required to build a circuit using the PIC16F84A. I’m allowed to do it at home so the college ‘lend’ us the chips.¬†But after completing the assignment I have to return it (initially I thought the college was going to give the chip to me but I was wrong).
I had to buy one for myself so I could play with it as I wish.

I went to a shop in Pudu which was recommended by my lecturer and they did not carry the normal 4MHz variant.¬†Instead they had only the 20MHz ones which were more expensive at RM30. That is alot for a small microcontroller. I bought it anyway because I can’t find it elsewhere.

This version I bought supports up to 20MHz, that doesn’t mean that it supports only 20MHz, it will work just fine with any frequency lower than that.
For the fun of it, I decided why not run it at its’ maximum frequency, so I bought a 20MHz crystal as well to see what this baby can do.

Connecting a crystal to a microcontroller is different compared to RC circuits. The crystal is connected to pin OSC1 and OSC2 and also requires two 15pF capacitors.
According to the datasheet, you can use any capacitors ranging from 15pF to 33pF in HS mode.

And, when writing the configuration code, the oscillator mode have to be set to HS (High Speed).

Let’s try this new microcontroller with the obligatory blink test.

The LED is connected to PORT B bit 0 and it turns ON and OFF in an interval of 1 second. In the next post, I will show how I calculate the delay subroutine.
In the meantime, here’s a video of the microcontroller in action.

Pardon me for the poor quality of this video. I’ll get a better camera soon.

More projects coming soon using the PIC16F84A.


Leave a Reply