Sorting blocks of data in EEPROM


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I guess it depends on whether you want the records sorted in EEPROM or whether you just want to be able to sort them when they are output via serial comms.

    If you do not need them sorted in EEPROM then I would just write them to EEPROM starting at the bottom of whatever block of EEPROM you use and write an index table which just consists of the addresses of the individual entries in sorted order at the top of the EEPROM block. This way you only need rewrite the index table when you make changes. (You will need to keep track of deletions so you can reclaim that space.)

    If you need the records themselves to be sorted (faster lookup) then the simplest method is Insertion Sort where you move existing entries as needed to clear a slot for a new entry. This would be the worst case for EEPROM life.

    I think it would be easier to learn VB. <img src="images/smilies/smile.gif" alt="" title="smile" class="inlineimg" border="0">

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    I agree with the last statement, Dave; I've been putting off getting my hands dirty with VB too long, and I think I'm missing out a lot as a consequence.

    Shall re-surface when I have something going in that direction, and shall most probably need some handholding at that stage again!

    Regards,

    Anand

Similar Threads

  1. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 02:46
  2. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  3. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  4. Internal EEPROM Read/write Addressing Errors with 18F PIC's
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 18
    Last Post: - 12th July 2005, 19:42
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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