Light Chaser; Preloading EEPROM data

fernando_g

Senior Member
I am planning to build a light chaser, on which the strings of LEDs is lit up with sequences like the following example:
0000 0000
1000 0000
0100 0000
0010 0000
0001 0000
0000 1000
0000 0100
0000 0010
0000 0001
then a new sequence follows:
1100 0000
0110 0000
0011 0000
0001 1000
0000 1100
0000 0110
0000 0011
and another;
1110 0000
0111 0000
0011 1000
0001 1100
0000 1110
0000 0111
and so on.................

What I am planning to do is to read the sequences from an external I2C EEPROM, and then simply apply them to a port. The port will of course drive the proper transistors which will handle the large current requirements.

The hardware is up and running, and a short sample sequence is running correctly. They look fantastic!
I loaded the data from the Picaxe's memory to the EEPROM for this short test sequence.

This is fine for a short sequence, but I am planning to load hundreds of bytes into the EEPROM. How to do it, from the Serial Terminal?
Or would it be a better way?
 

Buzby

Senior Member
The simplest way is to use the PICAXE to receive the bytes one at a time via 'serrxd', writing each byte to the EEPROM as it is received.

You can send the bytes from a text file by using a serial terminal like PuTTY or RealTerm. Use an inter-character delay to give the PICAXE time to process each byte.


Another way is write all your patterns into PICAXE progs which just load them to EEPROM. Then use a different prog to read them back.
Because your patterns are in a prog, you can quickly edit and upload all within PE6.

Cheers,

Buzby
 
Last edited:

AllyCat

Senior Member
Hi,

Yes, I'd just write, cut/paste a number of "mini programs" (or Macros or Subroutines) to send the bytes via I2C. Don't forget that you can't write across page boundaries with the serial EEPROMs, so you need some careful "housekeeping".

Cheers, Alan.
 

steliosm

Senior Member
I also needed to do a similar thing for a smart toy and I was thinking of either using a serial eeprom programmer or use a side loading program running on Picaxe. I end up using the side loading program and another liberty basic program to read the file with the data and push it through the serial connection. I also integrated the side loading program with the main code which I could activate it whenever I wanted to update the data in eeprom.
 

Aries

New Member
You might like to look at this thread from last year ...
Post #19 from Hippy does the loading of data into external ROM. The data is towards the end, written as a series of lookups in the program, so you are using the 2048 or 4096 bytes of program memory rather than the 256 or 512 of Picaxe RAM or ROM. This is an extract:
Code:
  Load( $0600, $91,$15,$0E,$93,$36,$30,$20,$20,$20,$20,$20,$20,$20,$20,$40,$00 )
  Load( $0610, $8F,$1B,$12,$C2,$39,$30,$20,$20,$20,$20,$20,$20,$20,$20,$40,$00 )
  Load( $0620, $92,$1F,$11,$D0,$39,$30,$20,$20,$20,$20,$20,$20,$20,$20,$40,$00 )
The first word is the address on the external ROM, followed by 16 bytes of data to be loaded in order. It doesn't have to be hex (binary might suit you better in your case) and is fairly easily created by a decent text editor or a spreadsheet (my usual choice) from the raw data.
 
Top