Maker Pro
Maker Pro

ROM address question

DaveLdn

Jan 10, 2010
8
Joined
Jan 10, 2010
Messages
8
Hi,
In one of the past university assignments I've found online it says that the CPU of the 16F877A can access two addresses in program memory automatically. What are they?

I have it in my head that the default start-up address would be the first one, but what would the second one be and why?
Thanks again in advance.
Dave
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I'm not sure what they're referring to. The PIC uses the modified Harvard architecture, where the program memory and the data memory use separate address and data buses, so two different locations can actually be accessed simultaneously during normal program execution: the program memory where the instruction opcode is stored, and the data memory address where the RAM variable or SFR (special function register) is located. But that's different from accessing "two addresses in program memory automatically".

They may be referring to the fact that the data bus for the program memory on the PIC16F877A (which is a standard "mid-range" PIC device) is actually 14 bits wide, not the more traditional 8 bits wide (the data memory is 8 bits wide). So to specify an opcode on the PIC16F877A, you need four hexadecimal digits, and every time the core reads an instruction opcode, you could say it is reading two bytes from the program memory. That's not actually true; it reads a single program memory location, but it gets 14 bits from it, rather than the more traditional 8 bits.

They might also be referring to multi-word instructions, where the instruction occupies two adjacent program memory locations, but the PIC16F877A does not have any multi-word instructions.

If you can quote the exact wording and include some context, we may be able to explain better.
 

DaveLdn

Jan 10, 2010
8
Joined
Jan 10, 2010
Messages
8
Hi KrisBlueNZ,
Thanks for getting back to me. The question on the sheet as it is typed is: "The 16F877A deals with two addresses in program memory automatically. What are these and under what circumstances is each one used?
I just read my original thread which says "accesses" which was misleading. Sorry for that but thank you for answering my question.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I've moved your thread to the "Homework Help" section.

I think you're right; that question is referring to the reset and interrupt "vector" addresses, 0x0000 and 0x0008. They're not vectors; they're actually entrypoints.

There is also a configuration word, which is supposedly mapped to program memory address 0x2007, but is probably not really part of the main Flash memory array. Many PICs also have an oscillator calibration instruction in the top memory location, but that variant doesn't seem to have that feature.
 
Top