
I expect
that I will find that memory on the Picaxe will be at a premium and in
any case it would be nice to store some object coordinates. So I have
added a 32Kbyte 24LC256 eeprom. The 256 refers to the number of bits.
This is another I2C chip and so it was added to the I2C bus. If we need
further storage we can add another 7 of these to the bus allowing up to
256Kb of storage.
As you can see this chip consists of power (VCC), ground (VSS), the I2C
bus (SCL, SDA) and some other pins. The A pins set the address of the
chip. Essentially if these pins are left unconnected or held low, they
represent zero. If they are held high then they represent 1. This
allows you to address one of 8 chips on the bus (3 bits gives an
address range of 8). For this first chip I tied all three pins low giving it an address of 0.

The
WP pin is the write protect pin. If this pin is left unconnected or
held low the chip will accept write operations. If the pin is held high
then all write requests will be ignored. In my setup I used a jumper to
control this pin. When the jumper is installed, the pin is pulled high.
When it is not installed, it is unconnected.
I found the actual installation of the 74LC256 to be easy. The hardest
bit was the fiddly work with small wires etc. Getting it to work with
the picaxe was a litte harder however. My first test was to read from
the chip - all the locations I read were returned as 0xFF. I then
attempted to do as write to the chip with the WP pin pulled high. This
failed as expected and desired. Then the fun began.
I disconnected the WP pin by removing the jumper and again
tried to write to the chip. When I read back I saw about 1 entry in
five with the value I tried to write, the rest were still showing 0xFF. When I put all the writes into
one line it worked perfectly. A visit to the Picaxe forum, thanks to
xstamp and technical, soon sorted me out. You need to allow 5ms or more
between writes. Repeating the multiple write test with delays of 20ms
worked perfectly. I expect that I will not be writing to the chip on a
regular basis so the delay is not an issue. It will be a matter of
setting it up once and not touching it again for a while until I have
more things to put on there.
Components:
| 74LC256 |
| 8 pin socket |
| Jumper header and jumper |
| hookup wire, solder |
Here is the specific
schematic. The testing software I used can be found on the
software page