Reading, writing, erasing flash (16F88)


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    It doesn't have to be fast - as long as you have control of the program at the "sending" end. Use a pic with at least a couple of hundred bytes of RAM and buffer the incoming data before you do a write to the EEPROM. You would send a buffer full, then pause and wait for the PIC to send a CTS or ACK, then send another buffer... As long as you do it this way, you can write as slowly as you need to in order to write the FLASH.

    I do a similar thing now, were I create a 2056 byte buffer (2048 bytes of data + CRC + control) in the RAM of an 18F8722, then send EEPROM data to the PIC in Intel Hex format over a 115K baud serial line, and when it is all received, check the CRC, convert it to binary and do the write to EEPROM. After programming the chip reboots (which destroys the 2056 byte buffer so I can now use the RAM space for my program) and starts with the new configuration. In my case, the 1024 bytes of EEPROM was inside the PIC, but it wouldn't have to be.

    This was really designed as a fast way to configure a whole bunch of chips with the same setup, but you could adapt the technique for boot loading.
    Charles Linquist

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175


    Did you find this post helpful? Yes | No

    Default

    Hmm, yes you are right on the spped matter.

    Thanks for the tips.

    One question, why did you use Intel hex format? Is the conversion to and back necessary for your project? It uses abit of MCU power to do that...

    Ioannis

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I mis-spoke, I actually just used HexAscii (0x0f) = "0" + "F" because I couldn't figure out how to make the VB program I used to receive and send the data handle ASCII zeroes and other odd characters.
    Charles Linquist

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175


    Did you find this post helpful? Yes | No

    Default

    OK. Thanks for the details so far.

    Ioannis

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 : 2

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