PIC 16F84A
The PIC16F84A is an 8-bit microcontroller of RISC (Reduced Instruction Set Computer) architecture. It uses a total number of 35 instructions. It has a total of 18 pins and is mostly found in a DIP18 type of case. The specifications are as follows:
1.Flash Memory (1KB) : For storing a program. It can be erased and rewritten almost 1000 times.
2.EEPROM (64 bytes) - Usually used for storing important data that will be secure even in power failure.
3.RAM - Memory used by a program to store temporary data during its execution.
4.CENTRAL PROCESSING UNIT- It coordinates the work and executes the user program.
5.PORTS- There are two ports portA(5 bits) and portB(8 bits). These 13 pins can be configured as input/output.
Pin Configuration PIC 16F84A in reality
Vss - Ground | VDD - Positive | RA0 to RA4 - Port A | RB0 to RB7 - Port B | MCLR - Master Clear
Block Diagram - Internal Structure of PIC
A Sample Program for PIC 16F84A microcontroller.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Author : Eby P.Kurien
; Date : 25/10/2006
; Version: 1.0
; Title: PIC16F84A : Use of TRIS (Beware! some PICs does not support this inst.) & MOVLW instruction
; Description: Make bit 0 & 3 of port B high.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Processor PIC16F84A
;Tell which processor we are using
include<p16f84a.inc>
; Include its default values
__config _XT_OSC & _PWRTE_OFF & _WDT_OFF
; Cofiguration of fuses
org 00h
;Reset vector/Where to start
movlw b'00000000'
;move binary 0 to W register
tris portb
;Make all pins of portb as output
movlw b'00001001'
;move binary 00001001 to W register
movwf portb
;move the same to port B / bits 0 & 3 will go high
loop: goto loop
;endless loop
end
;end of the program(for the assembler)
Copy the program to notepad and assemble it using MPASM from Microchip.The result is the following HEX file
:020000040000FA
:0A0000000030660009308600042875
:02400E00F93F78
:00000001FF
Use the HEX file and program the PIC using a suitable programmer and software.