As per the picture, the program counter support 13 bit. But Instruction register support 14bit. Let me know the reason. What is the bit escape by program counter
Please advic
Rather than attempt to explain the PIC's Harvard Architecture addressing scheme, which would take several postings and a lot of typing to cover it thoroughly.
Checkout these great tutorials:
**broken link removed**
They cover both the Baseline and Midrange PICs using both Assembly and Hi-Tech C. They are simply the best PIC tutorials I've come across.
Study the first two or three lessons in both the Baseline and Midrange Assembly, they should be able to explain the issue you have pointed out.
As per the picture, the program counter support 13 bit. But Instruction register support 14bit. Let me know the reason. What is the bit escape by program counter View attachment 60024
Unlike most microprocessors which have instruction word sizes of 8, 16, 32 or 64 bits, the baseline and midrange PIC microcontrollers have a instruction word size of 12, 14, 16 bits. Therefore if you have a PIC with a 14 bit instruction word, as per your example, all instructions whether it be:
Code:
movpf RCREG,SerInData
or
btfss PIR,0
or
movlw 0x90
fit and are contained in the 14 bit instruction word which is stored in flash program memory or EPROM depending of whether it is a 'F' or 'C' series PIC respectfully.
The program counter, 13 bit in your example, keeps track of the current Address of the current Instruction stored in the flash or EPROM.
These two entities are distinctly different, while the program memory address bus is 13 bit, the actual instruction word or program bus is 14 bit.
The memory address references the actual "slot" in the memory, while the program bus contains the current instruction to be executed.
The PIC16F87X devices have a 13-bit program counter capable of addressing an 8K x 14 program memory space. The PIC16F877/876 devices have 8K x 14 words of FLASH program memory
Program counter holds the program memmory address (where is your code is stored), but it is content is 14 bits wide (it can be any other number depending on your CPU design). Keep in mind that; instructions are 14 bits wide, but data path is still 8 bits in these mcu's.
Hope helps
As per the picture, the program counter support 13 bit. But Instruction register support 14bit. Let me know the reason. What is the bit escape by program counter
Please advic
Dear/PA3040
What do you think about this reply?
Your MCU is 16F877a, which is 8k Program memory. That means 8192Bytes
As well as 8192 address locations in program memory. The program Counter should be capable to access this all
address locations from 00 to end. Therefore 13bit wide is need to access 8192 address locations
PC Program memory Location
0000000000000 00h 0
0000000000001 01h 2
0000000000010 02h 3
0000000000011 03h 4
0000000000100 04h 5
0000000000101 05h 6
| |
| |
| |
0111111111111
1111111111111 0FFFh 8192
As per the picture, the program counter support 13 bit. But Instruction register support 14bit. Let me know the reason. What is the bit escape by program counter
Please advic
Brother fisrt please understand wht program counter is.
program counter will not hold any data but address. In PIC16 mid range Max Flash memory is 8k x 14 words which means 8k locations are there and all that are 14bit wide.
to address this 8k space we need 13 address lines. ok. Thats why size of PC is 13bit.
Program counter is for addressing and instructions in PIC16 are 14bit wide.
Brother fisrt please understand wht program counter is.
program counter will not hold any data but address. In PIC16 mid range Max Flash memory is 8k x 14 words which means 8k locations are there and all that are 14bit wide.
to address this 8k space we need 13 address lines. ok. Thats why size of PC is 13bit.