Aum Amriteswaryai Namah:
HHHHave separate program memory and data Memory AAAAccessed by separate busses
PIC 16F877A Microcontroller Like any microcontroller, it has CPU, memory and I/O in one chip. Using some I/O devices like keypad, display and interfacing circuits we can create a ‘complete system’. PIC based wireless sensor board
Aum Amriteswaryai Namah:
PIN DIAGRAM
Memory Classification Memory Memory Program Memory Program Memory Data Memory Data Memory General Purpose RAM General Purpose RAM Special Function Registers Special Function Registers
Specifications of program memory PM (program memory) = 8k words PC (program counter = 13 bits wide to address PM) Each word = 14 bits => All op-codes are 14 bit wide. PM (program memory) = 8k words PC (program counter = 13 bits wide to address PM) Each word = 14 bits => All op-codes are 14 bit wide.
Data Memory Organization DDDData memory = RAM File = File Registers. 555512 bytes arranged in 4 banks of 128 bytes each. W W W Width of word = 8 bits GGGGeneral Purpose Registers (GPR): Called scratch pad area/registers ----For data storage -----For scratch pad operations SSSSpecial Function Register (FSR, STATUS etc.) ----Control operation of the device
RAM FILE BANKS FFirst 32 of each bank = reserved. The important register (eg: STATUS) values are repeated in each bank. EEach bank = 128 bits wide. Hence need only 7 bits for address. To select one among the 4 banks, 2 bits (b6 b5) of status register is used. bb6 = RP1, b7 = RP0 RRP1 RP0 = 00 => bank 0 selected ; RP1 RP0 = 01 => bank 1 selected RRP1 RP0 = 10 => bank 2 selected ; RP1 RP0 = 11 => bank 3 selected
16 registers of each bank is common and repeated in all 4 banks. Hence common data is stored here during bank switching. RAM FILE BANKS contd… GPRs SFRsBank0000h 01Fh 020h 07Fh GPRs SFRs Bank1 080h 09Fh 0A0h 0FFh 0F0h GPRs SFRs Bank2 100h 11Fh 120h 17Fh 170h GPRs SFRs Bank3 180h 19Fh 1A0h 1FFh 1F0h RP RP RP RP RP RP RP RP = 00 = 01 = 10 = 11 = 00 = 01 = 10 = 11
WREG - Working Register TTTThe WREG register is referred to as working register IIIIs a special register inside the CPU of uC DDDDoesn’t reside in Data Memory like SFRs IIIInvolves in the execution of many instructions CCCCan be the destination of many instructions.
Status Register
Status Register contd..