Flash erase byte routine


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Flash erase byte routine

    Reading the data sheet and your code example makes me think this statement is not true.

    The FLASH as i have learned is not the same as EEProm in that you cant just change bytes values as you may like to on the fly , changing byte to $FF requires your do a complete sector erase , depending on the chip and the size the sector erase can range from 4k bytes to 64k bytes at a time.
    and a write to any location is possible. But I will keep reading

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: Flash erase byte routine

    Hi,
    Yes, they can be programmed one byte at the time at any arbitrary memory location. However, "programming" means changing (or not changing) a "1" to a "0". You can't change a "0" to a "1".
    So, before you can program a location it needs to be erased ("reset" to $FF). Erasing is done either sector by sector or the entire chip (bulk).

    /Henrik.

  3. #3
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Flash erase byte routine

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    Yes, they can be programmed one byte at the time at any arbitrary memory location. However, "programming" means changing (or not changing) a "1" to a "0". You can't change a "0" to a "1".
    So, before you can program a location it needs to be erased ("reset" to $FF). Erasing is done either sector by sector or the entire chip (bulk).

    /Henrik.
    Yes I understand now. I was having difficulty finding the write command in the data sheet but as you explained the program command is used.

Similar Threads

  1. Erase error
    By waynepauly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th June 2012, 03:23
  2. Internal eeprom - erase block
    By ruijc in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 13th February 2008, 12:11
  3. 18F2431 won't program or erase.
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 28th September 2006, 08:55
  4. 12F675 won't reprogram or erase
    By modifyit in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 19th May 2006, 06:07
  5. 12F629 won't erase and bandgap save?
    By Keith55555 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th April 2004, 02:28

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts