Picaxe 2 Picaxe i2c

rob.beckett

New Member
Morning,

I have 2 xbees communicating. on the "receiver" there isn't enough outputs for me to drive 7 relays. I bought a 28/40 proto board, with a 28x chip in it to do the job of outputting. I don't need to know whether the 28x has outputted, just need to send the data to it.
Is it possible to set the 18x on the AXE210 as a master on the I2C bus?, with the 28x acting as a slave?

I'm thinking this, because the 18x already interfaces with the xbee serially, so therefore I can't have another serout?

If it is possible to do it with I2C I have a few questions.

I'll need to set the I2C slave parameters up in the 18x, then write to the 28x.
How is the address and bus speed set?

then in the 28x, I'll need to
read I2C and set the address again?

What is the HI2C command used for?


Thanks for any help in advance!


Rob
 

BeanieBots

Moderator
The 18X can ONLY be a MASTER.
Only the X1/2 type PICAXEs can be configured as slaves.

Have a read of the HI2Csetup command in the manual.
You can set any address but using one for EEPROM type device addresses is recommended.

Using a 28X1 in slave mode just to get a few extra I/O lines seams a bit excessive. You could simply use an I/O expander or even a little 08 and send it a serial command for the extra I/O.
 

hippy

Ex-Staff (retired)
Or simply lose the 18X and use the 28X in its place directly wired to the XBee.

As to the 18X having used up its serial output; it can issue SEROUT on any of its eight I/O lines so you could use a serial link with the 28X using SERIN.
 
Top