• AVR Freaks

Hot!Can I use flash like eeprom? [SOLVED]

Author
danw
Starting Member
  • Total Posts : 44
  • Reward points : 0
  • Joined: 2008/09/03 12:48:47
  • Location: 0
  • Status: offline
2019/04/24 18:28:51 (permalink)
0

Can I use flash like eeprom? [SOLVED]

I'm trying to understand the PIC18F47K42 datasheet, but I find it really vague.
My problem is that the 1K of eeprom is grossly insufficient for my application.
I need one extra K.  The data will very rarely need to change (recipes are stored,
16 bytes per recipe, up to 50 recipes) so I'm not worried about too many writes.
The 1K eeprom is already fully committed, with a large area for strings, another
large area for event logs, and smaller areas for software upgrade history and
for user settings.
In the past I worked mostly with 16-series PIC's, and to write to flash there was
a certain protocol.
For this device, I can't seem to find the flash write protocol,  I find a page that
talks about "storage area flash", but says it is only 128 bytes, which is too little
for me;  I need 1K.  Another page in the manual shows a "Program Flash Memory
Partition", with funny looking blocks but without clear indication of address ranges.
I'm totally lost.  Nowhere I find what's the flash block write size.  Nothing.  Help!
post edited by danw - 2019/04/24 19:26:02
#1

3 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 17229
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Can I use flash like eeprom? 2019/04/24 18:37:04 (permalink)
    +2 (2)
    You can write to any 1k of Flash. The protocol should be in the data sheet. The page write size and the erase size may be different. Make sure you use full erase blocks.
    #2
    danw
    Starting Member
    • Total Posts : 44
    • Reward points : 0
    • Joined: 2008/09/03 12:48:47
    • Location: 0
    • Status: offline
    Re: Can I use flash like eeprom? 2019/04/24 18:40:31 (permalink)
    +1 (1)
    Okay, I'll keep looking at the datasheet, and see if ithe info s trying to hide from me.
     
    EDIT:
    Found it.  Chapter 13,  Non-Volatile Memory.
    I had been searching for "flash" this or that.
    Thanks.
    post edited by danw - 2019/04/24 18:47:48
    #3
    NorthGuy
    Super Member
    • Total Posts : 5366
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: Can I use flash like eeprom? 2019/04/24 20:29:25 (permalink)
    +1 (1)
    Flash page is 128 bytes. You need to erase the whole page before you can rewrite. However, it's ideal for things like history - where you write only once.
     
    Also, writes to flash (and erases) stall CPU for several ms.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5