+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Newbie level 1
    Points: 15, Level: 1

    Join Date
    Oct 2018
    Posts
    1
    Helped
    0 / 0
    Points
    15
    Level
    1

    Embedded Sys: PIC 12F1572 NVM Write/Erase/Read.

    Hello,

    I am working on the PIC Micro controller where it got a data flash of 128 bytes which were divided into 74 locations(14 bits each), I have an requirement of writing 100 bytes on the memory.

    Upto my understanding in order to write into NVM PMADRH:PMADRL register pair should be filled with the desired register next to it then load the data and initiate the operation, But there is a problem in here How can I write a 100 byte buffer/Array into the Data flash which got divided into the locations of 14 bit each. May be this calls for a bigger complexity in writing/reading. even if I proceed, I cannot afford for it in terms of code memory as only 26 bytes left.

    Kindly correct me if my understanding is wrong, and help me with an solution.

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 3
    Points: 6,675, Level: 19

    Join Date
    Jan 2015
    Posts
    966
    Helped
    307 / 307
    Points
    6,675
    Level
    19

    Re: Embedded Sys: PIC 12F1572 NVM Write/Erase/Read.

    Check the "Note 1" under Table 3-1 in the datasheet - it states that the addresses only apply to the bottom byte of the address. Therefore you have 128 bytes (each 8-bits) of high endurance flash memory.
    I'm not sure where you got the information that the 128 bytes is divided into 74 locations from. The addresses are (for your MCU) from 0x780 to 0x7ff.
    Therefore accessing these memory locations is straight forward.
    Also what do you mean by only having 26 bytes left? Are you saying that you have only 26 locations free in the normal programming area of flash?
    Susan



--[[ ]]--