+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Advanced Member level 5
    Points: 31,814, Level: 43
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,641
    Helped
    483 / 483
    Points
    31,814
    Level
    43

    EEPROM write must be preceeded by an EEPROM erase? PIC16F1704

    Hello,
    If you do an eeprom write to a pic16f1704, then do you have to erase the eeprom cell first?
    Page 381 only gives the write time (2ms)..it does not give the erase time. Do you know what is the erase time?
    PIC16F1704 Datasheet
    ww1.microchip.com/downloads/en/DeviceDoc/40001715D.pdf

    (I tried to ask on the microchip forum, but i have forgoteen my username and password, and you need at least one of them to get the forgotten one sent to you....i cannot get a new account because it just says i already have one.)

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 255,029, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,441
    Helped
    13537 / 13537
    Points
    255,029
    Level
    100

    Re: EEPROM write must be preceeded by an EEPROM erase? PIC16F1704

    If you do an eeprom write to a pic16f1704, then do you have to erase the eeprom cell first?
    Yes because it's flash, not EEPROM.

    Page 381 only gives the write time (2ms)..it does not give the erase time. Do you know what is the erase time?
    See 10.2.3. Erasing Flash Program Memory. 2 ms typically.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Super Moderator
    Points: 73,784, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,972
    Helped
    3411 / 3411
    Points
    73,784
    Level
    66

    Re: EEPROM write must be preceeded by an EEPROM erase? PIC16F1704

    Hi,

    (I tried to ask on the microchip forum, but i have forgoteen my username and password, and you need at least one of them to get the forgotten one sent to you....i cannot get a new account because it just says i already have one.)
    I wonder.
    A quick view at the microchip forum tells that your username there is "treez"...not surprising.
    You should be able to create a new account.
    Try to delete the microchip_forum_cookies before you creata a new account.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  4. #4
    Advanced Member level 4
    Points: 7,481, Level: 20

    Join Date
    Jan 2015
    Posts
    1,051
    Helped
    331 / 331
    Points
    7,481
    Level
    20

    Re: EEPROM write must be preceeded by an EEPROM erase? PIC16F1704

    In answer to your original question - yes and no!
    Yes - the Flash memory you are using needs to be erased before it is written but...
    No - you don't need to do the erase for *every* write.
    HOWEVER there are a number of things to remember when using the Flash memory on that chip in this way. First is that there are only 4096 words of Flash altogether, and only 128 of 'high endurance' Flash at the top addresses of that. Therefore however much space you use as "EEPROM" takes away from your program space.
    When you erase the Flash memory, you must do so in rows of 32 words.
    Also you have to write to the Flash a row at a time. However there is a 'trick' you can use: erasing a memory location sets it to all '1' bits, and a write will transform the '1's to '0' as appropriate. Therefore it is possible with careful programming - remember you have a very limited programming space - to update the complete row to be written by adding your new value to a previously "unwritten" address.
    Finally, remember that the normal Flash as a minimum endurance of 10K Erase/Write cycles and even the 'high endurance' Flash has 100K Erase/Write cycles. This mainly refers to the 'erase' operation and, again if you are careful, you can write a few more times than that (but only to convert the '1's to '0's as mentioned).
    Susan


    1 members found this post helpful.

--[[ ]]--