I2C question

tzurs

New Member
Dear Everyone,
I have a 28 pin Project Board (AXE020) and inside we placed the (better?) chip, PICAXE-28X chip which is said to support I2C. My project needs to collect some data (mainly button clicks) but may require more memory than is in the picaxe chip.

After speaking to the support, I bought two Microchip 24LC256/P 256K EEPROM.

I'm now puzzled as to how to actually connet them to the project board (or via other means) so that I can get access to this extra memory from my program.

If someone can explain (slowly, I'm not very smart), what are the steps that I need to take, I would be extremely grateful.
If any one has any documents that describe what needs to be done, I would be again super grateful.

Kindest regards,
--tzurs
 

andrewpro

New Member
Well..there are two documents I would go through before you embark on this journey. The I2C tutorial which is a PDF available on this site or in the documentation folder in the programmer directory, and the datasheet for the memory itself. They should give you a basis on which to work from.

A Quick Rundown:

1: Make sure there are pullup resistors on the SDA and SCL pins of the picaxe. This means one resistor for each pin, about 4k7 ohms each, to the positive supply voltage.

2: Make sure that the address pins of the chips are different. They work in binary. On chip 1, I would connect all the address pins to ground, and on chip two connect A0 to the positive voltage, and the rest to ground. This will make the first chip address 1010000X and the second chip is 1010001X. X is the read write bit, and you dont have to worry about that one. The picaxe will properly set it for you.

3: Connect the SDA and SCL pins on the picaxe to thier respective SDA and SCL pins on the chips. Make sure all the SDA's are connected, and all the SCL's are connected.

4: Tie the WP pin to ground, and supply positive and ground connections to the memory pins. If you tie the WP pin to the positive supply, you will not be able to write to the chips at all.

5: Program away. The I2C tutorial will tell you how. The chip uses word addresses, and works at 400khz. Your I2CSlave command for the first chip should look like this:

I2CSlave 10100000, I2Cfast,I2Cword

and for the second chip:

I2CSlave 10100010, I2Cfast, I2Cword

The rest is up to you ;).

--Andy P
 

tzurs

New Member
Ok,
that's a lot of terms I need to decipher,
I will read it carefully along with the tutorial and see what I can understand,

I truly appriciate the help,
Kindest regards,
-tzurs
 
Top