How many bits are required to address the program memory of PIC16F887? What is PCLATH? For PC absolute addressing, describe how to write assembly program to jump to code located in a different program memory page.
1. Program memory of PIC16F887 is of size 8192 words / 32768 bytes. Hence to address 32 KB of memory , 13 bit address lines will be required as word alignment causes lsb two bits always 0.
2. Program counter is 13 bit wide. Lower 8 bits of PC comes from PCL register which is readable/writable where as higher 5 bits of PC comes from PCLATH which can't be directly read or written.
3.
MOVLW 0x10 ; intialize pointer
MOVWF FSR ; to RAM, FSR = File Select Register
NEXT: CLRF INDF
INCF FSR
BTFSS FSR ,2
GOTO NEXT
; INDF is not a physical register. Any instruction using INDF register actually accesses data pointed to by the File Select Register , FSR.
Get Answers For Free
Most questions answered within 1 hours.