Reading, writing, erasing flash (16F88)


Results 1 to 27 of 27

Threaded View

  1. #3
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    1 - Most, I say most, eeproms/flash are erased to logic 1 and programmed to logic 0...Most that isl, but I haven't found one that's the opposite.
    My short stock of 16F88s arrived by UPS, so I read a few straight out of the tube. All flash locations were $0000, and those PICs of course failed the blank check. Then I erased one and read it back in hex. All flash locations are initialized to $3FFF to be "blank", so that's settled.

    2 - I assume nothing, therefore they should read back as $FFFF
    $FFFF is a 16-bit value, so you must have assumed a 16-bit word. Since the words in flash are only 14 bits, the math says $3FFF is the largest value possible. The data sheet (3.7) makes clear that the contents of 4 successive buffer registers are written, and that after a "long write", the buffers are reset to $3FFF. As long as neither WRITECODE nor anything else meddles with what's in those buffers, there should be no problem.

    3 - mandatory I would think. Otherwise you'd just be OR'ing bits...
    Do you know this, or are you guessing? I don't see how ORing bits is relevant to the question, but I'm anxious to be informed.

    4 - Probably by ignoring the lowest significant 2 bits in the address
    Okay, you've lost me on this one. Please explain: How does disregarding the 2 least significant bits of the address relate to the value stored at that address?

    5. #3
    Yes, but what actually happens? Does anyone know from experience, accidental or otherwise?

    A, B, C - I'm fairly sure you have to do everything in the 4 byte blocks, read, erase, write back...
    Well, the data sheet seems to disagree. According to it: A read returns 1 word from flash; a write must be done as a block of 4 words; and an erase must be done as a block of 32 words.

    So my questions A and B remain unanswered, but it appears we can be confident that the answer to question C is, "Yes. The value to look for is $3FFF."

    Presumably, one "master" erase of many 32-word blocks would be sufficient for a large number of successive writes.
    Last edited by RussMartin; - 23rd October 2008 at 04:33.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. Writing & Reading to iButton EEPROM
    By crhomberg in forum Code Examples
    Replies: 2
    Last Post: - 6th October 2008, 19:40
  2. Writing and reading to a 24LC1025
    By Angus Anderson in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 20th April 2007, 11:49
  3. reading, writing, and displaying from eeprom
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th January 2006, 22:05
  4. 16F88 reading Analog Input
    By thunderstrike44 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th August 2004, 22:41
  5. Writing / Reading EEPROM 24LC256 Problem
    By schmoddel in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th February 2004, 18:55

Members who have read this thread : 1

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