Connect with us

ROM address question

Discussion in 'Electronics Homework Help' started by DaveLdn, May 30, 2014.

Scroll to continue with content
  1. DaveLdn

    DaveLdn

    8
    0
    Jan 10, 2010
    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
     
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,268
    Nov 28, 2011
    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.
     
  3. DaveLdn

    DaveLdn

    8
    0
    Jan 10, 2010
    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.
     
  4. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,268
    Nov 28, 2011
    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.
     
  5. DaveLdn

    DaveLdn

    8
    0
    Jan 10, 2010
    That's great. Thanks again. You've been a lot of help.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-