Some pointers please, on what to look for.

mdunk

New Member
Hello all,

My apologies if this has been answered already, but I am having trouble getting started with a project and part of the problem is I simply can not work out what I should be looking for.

In summary, I would like to prepopulate at 24LC256 chip with about 4380 lines of data, in the form of pairs of small integers (less than 16 each), never to be changed again and then look up those numbers at run time later on.

I THINK I should using the 18X chip and I think I am pretty happy with the i2c commands and syntax to read the data in.

I THINK I can see that the EEPROM command should be used to prepopulate the data, thought I am not sure if that will work with so many lines of data.

I am also not entirely clear that the chip will hold that much data, though 16K words is a number I see now and then, which implies it will...

I THINK I can see that reading the data back from the chip is ok if I can work out which line number the data will be stored on by using

readi2c memory_location variable_name (and I think I can calculate memory_location ok at run time).

So my question is:

Is someone able to point me at what I should be looking FOR, in terms of the best practice for prepopulating the chip with that much data (if possible), and then how best to "look up" the data later on.

Thank you,

Matthew
 

westaust55

Moderator
The 18X is the smallest PICAXE with inbuilt i2c so yes a good possibility.

The 24LC256 i2c EEPROM has a capacity of 256k bits = 32 kbytes.


The EEPROM command is really only a programming editor directive for pre-loading the actual PICAXE EEPROM area with data.
You will need to use the i2cslave, write12c and readi2c commands to access the external 24LC256
You can write a program to write the data from the 18X into the 24LC256 and once done load your operating program into the 18X.
 
Last edited:

mdunk

New Member
Righto, but when I write the program to preload the data into the external eeprom using the 18x, it will run to at least 4400 lines, or thereabouts, won't this be a problem?
 

westaust55

Moderator
about 4380 lines of data
Is this as a pair of data per line?

If so, that equates to 8760 bytes of data so enough space in the 24LC256.

You can/should put say 8 bytes of data (4 pairs of numbers) per writei2c command so that will reduce the number of program lines required

Have a look at post 14 and post 43 in this thread: http://www.picaxeforum.co.uk/showthread.php?t=10014
where I have pre-loaded data into a 24LC256 for gLCD fonts and compass data.

With a 40X1, the PICAXE program could hold a program large enough to write about 2kbytes of data at a time.
So with an 18X (having around ~half the program memory capacity of the 40X1) and around 8 kbytes of data to write it will take something like 8 batches of data to write all the desired data to the 24LC256.
 
Last edited:

mdunk

New Member
Excellent, thank you. Just what the doctor ordered.

Silly me, I had not thought of writing the data in batches.... :^(

And the format is perfect, I can almost copy and paste straight from Excel where I have all of the computed data stored already.

Thanks again.
 

westaust55

Moderator
pre-loading external EEPROM

Note that my examples use the HI2COUT command whereas with the 18X you must use the WRITEI2C command.
 
Top