Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => iMX233 => Topic started by: ilaam on March 31, 2014, 12:01:11 PM

Title: Can OlinuXino work as an I2C slave ?
Post by: ilaam on March 31, 2014, 12:01:11 PM
Hi,
I am a newbie and I was trying to connect an RPi as slave to a master shipset via I2C. Unfortunately RPi does not support the I2C slave mode. I am intending to use OlinuXino instead and I wander if it can work as an I2C slave or not? If so, would it possible to assign many I2C addresses to the OlinuXino? because I need it to emulate different sensors communicating with a master. The master will be asking every single time a sensor (an I2C address) and the OlinuXino should always respond to it as if it was the requested sensor.
Thank you  :)
Title: Re: Can OlinuXino work as an I2C slave ?
Post by: olimex on March 31, 2014, 12:24:21 PM
no
you better use UART or USB to make this kind of communication
Title: Re: Can OlinuXino work as an I2C slave ?
Post by: Kean on March 31, 2014, 01:34:39 PM
I think a microcontroller would be needed - maybe an ATmega or PIC could act as an I2C to UART or USB converter.
Title: Re: Can OlinuXino work as an I2C slave ?
Post by: JohnS on March 31, 2014, 01:43:27 PM
I think it can, if you can bit-bang a GPIO fast enough and simulate I2C.

May not be doable under an OS.

John
Title: Re: Can OlinuXino work as an I2C slave ?
Post by: ilaam on March 31, 2014, 02:32:59 PM
Thank you all..
The problem is that I'm obliged to use I2C as it is part of the system to simulate.
I'll try to use micro-controller  :)
Title: Re: Can OlinuXino work as an I2C slave ?
Post by: dave-at-axon on March 31, 2014, 04:01:46 PM
According to the A20 manual, the TWI can be slave or master.

BUT

If you are using an OS then they are going to be enabled as master devices so you may need to disable the TWI that you want to use as a slave and programme it yourself. Not sure how easy this will be and OS as I have not need to do this.

If you only need this for testing, better you get a dev board based on one of the Atmel AVR devices with hardware I2C. Codevision C compiler for these has a wizard to enable the I2C as a slave which makes it easy to get going quickly.
Title: Re: Can OlinuXino work as an I2C slave ?
Post by: ilaam on April 05, 2014, 10:15:53 PM
Thank you dave-at-axon that's very helpful  :)