Using the SX as a slave w/ I2C
I am working on a project where I need to establish a master controller that can issue commands
or pass data to slave controllers when needed. I am new to the SX platform, but have worked with
BS2 and Propeller. I was hoping to write my application in SX/B without having to resort to Asm.
After reading over the stock I2C commands in the SX/B reference, I determined that this sets the
SX chip up to be the master. This is problematic since I need some of my SX controllers to simply
sit and wait for a command from the master chip. Perhaps some of you have worked with a similar
configuration and any insight would be greatly appreciated.
Thanks
Miles
or pass data to slave controllers when needed. I am new to the SX platform, but have worked with
BS2 and Propeller. I was hoping to write my application in SX/B without having to resort to Asm.
After reading over the stock I2C commands in the SX/B reference, I determined that this sets the
SX chip up to be the master. This is problematic since I need some of my SX controllers to simply
sit and wait for a command from the master chip. Perhaps some of you have worked with a similar
configuration and any insight would be greatly appreciated.
Thanks
Miles
Comments
Could you use serial to communicate with the SX and then have the SX relay the data where it needs to go via I2C?
It looks like I will wind up doing something like that and building a tree rather than using a common bus. I was just wondering if someone had been able to use I2C to link together SX chips.
The code is not simple, but is not spectacularly complex either, though it may *look* that way. If you have any familiarity with finite state machines, you'll see that basically the authors just ground through the all the possible states involved in slave I2C transactions and bit-banged 'em. Pretty clever, really.
sxlist.com/techref/scenix/lib/io/osi2/i2c/i2c_sx.htm and you are looking for the second and third items in the list (I2C slave). The .src code for a straight-forward I2C slave is here: sxlist.com/techref/scenix/lib/io/osi2/i2c/i2c_slave.src
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php