I don't have a Bus Pirate, but this is what I gather after reading:
http://dangerousprototypes.com/blog/bus-pirate-manual/i2c-guide/ (http://dangerousprototypes.com/blog/bus-pirate-manual/i2c-guide/)
Have a look at the example interactions at the end of that guide.
1. First determine the I2C address of the SRAM. If you use the "7bit address search" Bus Pirate macro you'll get back something like:
I2C>(1)
Searching 7bit I2C address space.
Found devices at:
0xA0(0×50W) 0xA1(0×50R)
...
0x50 is the 7-bit I2C address. You will use 0xA0 when sending a write command to the device and 0xA1 when reading.
In case the search returns multiple devices, Figure 12 of the PCF8570 datasheet shows the possible I2C addresses for the PCF8570, so that should help you figure out which one it is.
2. Issue the commands:
[ 0xA0 0 ]
[ 0xA1 rrrrr ]
This will first set the address pointer to address 0. The second command will read 5 bytes incrementing the address pointer for each byte.
Other read commands: [ 0xA1 r:256 ] -- read 256 bytes beginning at the current address pointer.
To write memory contents:
[ 0xA0 0 0x12 0x34 0x56 ]
The above sets the address pointer to 0 and then writes three bytes incrementing the address pointer for each byte written. Note that write commands always specify the starting address.
Let us know how it goes.
1. First determine the I2C address of the SRAM. If you use the "7bit address search" Bus Pirate macro you'll get back something like:
I2C>(1)
Searching 7bit I2C address space.
Found devices at:
0xA0(0×50W) 0xA1(0×50R)
...
I get a biiiiig long list of all addresses for some reason (that reason is certainly me doing something wrong), but I'll physically check the pins to find the actual address. Tracing pins and voltages is something I am able to do. :D :-/O
2. Issue the commands:
[ 0xA0 0 ]
[ 0xA1 rrrrr ]
This will first set the address pointer to address 0. The second command will read 5 bytes incrementing the address pointer for each byte.
That return to 0 command is looking like the ticket, I kept getting different results when reading from the RAM, I didn't realise that setting the pointer to 0 was needed!
To write memory contents:
[ 0xA0 0 0x12 0x34 0x56 ]
The above sets the address pointer to 0 and then writes three bytes incrementing the address pointer for each byte written. Note that write commands always specify the starting address.
So that last one, we are writing 0x12 in position 0, 0x34 in position 1, and 0x56 in position 2, right?
I think this is starting to make sense......
I'll have a go at it tonight and let you know what happens. :-BROKE :) Thanks!