Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Program counter with13bit

Status
Not open for further replies.

PA3040

Advanced Member level 3
Joined
Aug 1, 2011
Messages
883
Helped
43
Reputation
88
Reaction score
43
Trophy points
1,308
Activity points
6,936
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


bus.gif
 

Attachments

  • bus,jpg.bmp
    307.5 KB · Views: 72
  • bus,jpg.bmp
    77.5 KB · Views: 63
Last edited:

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.

BigDog
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear BigDog

really thanks for reply
I red it but I was impossible to found out, what I pointed out
can you explain it in few words?
Thanks
 

I think you are mixing up the program counter address width (13 bits) with the DATA width (14 bits).

Keith
 

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

Nothing escaped.

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.

Does this answer your question?

BigDog
 

From microchip datasheet;
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

HTML:
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
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
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


View attachment 60024


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.

Hope this helps :)
 

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.


Hope this helps :)
I think not need 13bit for scan all 8k addresses because PCL is 8bit that means 256 locations. From next page PCL start from zero.
 

I think not need 13bit for scan all 8k addresses because PCL is 8bit that means 256 locations. From next page PCL start from zero.

So you can address 8k using 8bits only :shock: ..Use your brain brother how its possible. there is an another register, PCH. hope picture is clear now

good luck
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top