PDA

View Full Version : Looking for confirmation of idea to store data in external eeprom



ukemigrant
- 21st June 2009, 21:52
I had been merrily using EEPROM statements until I hit the memory limit for the 16F877 chip I am working with and now need to switch to the external EEPROM.

All those convenient EEPROM statements will now have to be replaced with a block of code to transfer the data to the external EEPROM chip.

The data in question contains a menu structure I'll need for my project.

I was hoping to copy the data in 128 byte chunks to take advantage of the paging of the EEPROM, but the max size of an array I can declare is 96 bytes.
Do I just end up wasting the difference or can someone tell me how they usually transfer bigger blocks of data to the EEPROM? I have looked at many posts on the forum but must have missed something as I haven't noticed this particular issue being addressed.

Thanks.

PS I have seen the EE_Vars.pbp code which looked awesome but the post that came with it says it requires MPASM which I am not able to use for this project.

Melanie
- 21st June 2009, 22:09
Last things first... there should be no reason why you couldn't use MPASM for any PIC... the only real salient difference is in your CONFIG defines.

Have you looked at upgrading your project to the 18F4525 which has 1K of EEPROM... pin compatible and a quantum leap from the now obsolete 16F877. It's also got 4K of SRAM... and 48K of Program Codespace... so who needs EEPROM anyway?

Darrel Taylor
- 21st June 2009, 22:16
With the 16F87x series PIC's, writing to Flash Memory (program space) is just as easy as writing to EEPROM. Only difference is the locations are 14-bits instead of 8.

Then you have several K of space, depending on how big your program is.

Look at the READCODE and WRITECODE statements.

If it's actually a 16F877A it's more difficult, but still doable.
<br>

ukemigrant
- 22nd June 2009, 03:08
Thanks for your replies Mel, Darrel. It has been mostly your own posts that I have been poring over to find a solution to my problem. Updating the main chip may be a possibility or I may have to just learn my lesson and get that stuff for the next project. My friend and I have already bought all the pieces for the current project, including the EEPROM chips so I figure I'll try and use them.

Mel I think I may have been confusing the MPLAB IDE with MPASM so maybe the eeprom vars file will work for me.

It's a shame though that using the onchip eeprom has all those nice data and eeprom statements and using the external one means I have to write code like that listed here (http://www.picbasic.co.uk/forum/archive/index.php/t-156.html) to populate arrays so that I can write data to the external eeprom a page at a time.

Darrel Taylor
- 22nd June 2009, 03:19
EE_Vars only works with internal EEPROM.
So if you're already at the limit of the internal EEPROM, it's not going to help.

If you write to the external EEPROM 1 byte at a time, you don't need to worry about "page write boundaries".
<br>

ukemigrant
- 24th June 2009, 03:01
EE_Vars only works with internal EEPROM.
So if you're already at the limit of the internal EEPROM, it's not going to help.

If you write to the external EEPROM 1 byte at a time, you don't need to worry about "page write boundaries".
<br>

Oh dear - must have missed that. Shame I was thinking how nice the code must have been to handle all the complicated I2C stuff :).