Sending parametres from XMOS to another chip via I2C Topic is solved

If you have a simple question and just want an answer.
Post Reply
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Sending parametres from XMOS to another chip via I2C

Post by xlordofpainx »

I want to use the Xmos' memory to store variables which would be sent to another chip before music starts playing. pin 37,38 are the I2C bus, but do i connect the second chip to those? Or do I take two other free pins and use those? Basically I have a C code which drives a control loop on the second chip, code is done, just needs to be sent.


View Solution
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi. Is the 2nd chip you wish to add an I2C slave or an I2C master?

For I2C, typically there is a single I2C MASTER and then a single or many I2C slaves. Each such slave will have its own I2C address for indexing by the I2C Master.

The XMOS CPU is usually the I2C Master but not always. XMOS has supplied IP for use as an I2C MASTER or I2C SLAVE.

Confirm that the pins you are referencing are I2C_SDA (Data) & I2C_SCL (Clock). Usually they are single bit port pins.

This I2C network requires the use of external pull ups on each line of a value 2k2 - 10k and the value is not critical. The reason being that I2C bus is an open drain bus so a logic low = low (0 volts) but a logic high = pin is floating. Respectively then the external pull-up resistor of 2k2 to 10k will pull the floating pin to define a soft high. This configuration prevents possible logic collision between a pin that may want a "high" while other a "low". If the pins were push-pull logic instead of open drain then the strongest IC would win this battle and the other would be a damaged device.

You should be able to use the I2C XMOS IP to R/W data to your remote I2C device. Do confirm that the external device is an I2C slave. If yes, then this external I2C slave must have an address. Use this I2C address inside the XMOS IP to ping (read/write) data to this external I2C node. Just be clear that the address of this external I2C node is unique for this bus.

https://www.xmos.com/support/appnotes/AN00156

https://www.mikroe.com/blog/i2c-everything-need-know

http://www.best-microcontroller-project ... orial.html

Hope this helps.
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Post by xlordofpainx »

Yesss,, got it. Thanks for the info. I will include this in my report too :D
Post Reply