PIC 16F84A

Only reason I take 16F84A as an example is  that it’s a simple microcontroller, but its old. So in some countries the price might be high than better microcontrollers available. If you want you can get a similar microcontroller.

Please note from now on a Bit – (Binary digIT). In the digital world we use only two voltages for less complexity, one for indicating 0, one for indicating 1, this is the binary data system. 0 will be represented by 0 Volts, and 1 will be represented by 5 Volts. Also if 5 Volts present in a pin of the microcontroller we will take as 1 or call it “pin is at logic high state”. If 0 Volts present in a pin of the microcontroller we will take as 0 or call it the “pin is at logic low state”. If you give 5V to a pin (connecting a wire from the positive rail), what you are doing is making that pin logic high. Inverse if you give 0V (connecting a wire from the negative rail).

16F84A has 18 pins. See the image to the right. RA0 to RA4 is PORTA. You can use a port to drive a robot, or get some data into the microcontroller, or display some message with LEDs. All 5pins of PORTA can be used as either input or output, so PORTA is a has 5 bit port which is bi-directional. RB0 to RB7 is the PORTB. These 8pins can be used as either input or output, so it’s 8 bit bi-directional port. RB0 is also labeled as INT. This means you can use this pin as an interrupt pin by making this pin logic high when you want. An Interrupt is used for carrying out another program when something occurs (There are many situations that you don’t want the embedded system operate in the way it operate everyday when something is changed around its environment).

VDD VSS are power supply pins. You’ve met them before in Powering the Microcontroller.

The pin “MCLR” is to reset. It should be connected to positive rail in normal operation. When program get stuck or when you really want to reset, you can do it by making this pin logic low (connecting a wire from the negative rail).

OSC1/CLKIN , OSC2/CLKOUT pins are for your clock oscillator. You know their purpose if you read Choosing your Oscillator mode.

RA4 is also labeled as T0CKI. That’s because this pin can be used as another clock input (apart from your main clock oscillator). You can use this clock for a special purpose.

PORTA and PORTB must be configured to be inputs or outputs during programming. The microcontroller will set this pins according to the program every time it runs the program (Every time the microcontroller turns on). These pins are handled by TRISA TRISB SFRs (Special Function Registers). Info about Special function registers are in next article.

Any pins left? 😛

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: