Forums

i2c/rs232 converter

Started by Raphael January 30, 2004
Does anyone know of a way to put an rs232 ascii data stream onto an
i2c bus as a slave device.

For example, I have an i2c bus which has a master already. I need to
give this master the data which is coming from an rs232 device, the
problem is that all the rs232 to i2c converters I've seen are masters
which assume it'll be plugged into a PC.

I assume that I need to convert levels with a MAX232 and then put that
data into i2c format. I'm hoping there's a single chip which will
convert the rs232 data into i2c data for a slave device, but any kind
of solution would be appreciated.

Raphael
Hello Raphael,

	I2C is a multi-master protocal. The problem is that some masters do not 
know how to give up control.( single master )

	If your "master" can handle being a slave, then you should have no 
problem with PC based I2C converters.

	Google has tons of hits.
<http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=RS-232+i2c&btnG=Google+Search>

	You last statment is really vague. Yes you will need a MAX232 device. 
After that is the rest of the project, so yes a micro will do this job.

	If you are the Do-It-Yourself type, this link even has source code. 
<http://www.emicros.com/pic1.htm>

	Good Luck

	hamilton

Raphael wrote:
> Does anyone know of a way to put an rs232 ascii data stream onto an > i2c bus as a slave device. > > For example, I have an i2c bus which has a master already. I need to > give this master the data which is coming from an rs232 device, the > problem is that all the rs232 to i2c converters I've seen are masters > which assume it'll be plugged into a PC. > > I assume that I need to convert levels with a MAX232 and then put that > data into i2c format. I'm hoping there's a single chip which will > convert the rs232 data into i2c data for a slave device, but any kind > of solution would be appreciated. > > Raphael
Raphael wrote:
> Does anyone know of a way to put an rs232 ascii data stream onto an > i2c bus as a slave device. > > For example, I have an i2c bus which has a master already. I need to > give this master the data which is coming from an rs232 device, the > problem is that all the rs232 to i2c converters I've seen are masters > which assume it'll be plugged into a PC. > > I assume that I need to convert levels with a MAX232 and then put that > data into i2c format. I'm hoping there's a single chip which will > convert the rs232 data into i2c data for a slave device, but any kind > of solution would be appreciated.
I'd take an AVR with both TWI (Atmel's name for I2C compatible interface) and asynchronous serial interface and program it to handle the interfacing. The internal RAM may be on the small side for serial data buffering, so a model able to have an extrernal RAM chip may be in order (e.g. Atmega8). The TWI in AVR's can be used a a slave interface. The master must be able to understand the clock clamping hold, though. The problem with a slave interface is timing: the master is pretty free to handle the bus timing, but the slave is (according to spec) free to make the transfer wait by clamping the clock line when low. To react fast enough, the clamping must be in the interface hardware. HTH Tauno Voipio tauno voipio @ iki fi
Hi,

> I2C is a multi-master protocal. The problem is that some masters do not > know how to give up control.( single master ) > > If your "master" can handle being a slave, then you should have no > problem with PC based I2C converters.
Unfortunately I'm using a BL233 based master which doesn't like being a slave and is not too happy with multi-master.
> If you are the Do-It-Yourself type, this link even has source code. > <http://www.emicros.com/pic1.htm>
Excellent, this is just the sort of thing I was looking for, thanks very much. Raphael
>> I2C is a multi-master protocal. The problem is that some masters do
not
>> If you are the Do-It-Yourself type, this link even has source code. >> <http://www.emicros.com/pic1.htm>
Hi I'm interested too on this argument, but I can't dowload the code from the link... it seems a broken link... can you post it or send me? ThankU very much Uest
uest@libero.it (uest) wrote in message news:<6e094f6d.0402010412.3187e6ec@posting.google.com>...
> >> I2C is a multi-master protocal. The problem is that some masters do > not > >> If you are the Do-It-Yourself type, this link even has source code. > >> <http://www.emicros.com/pic1.htm> > > Hi I'm interested too on this argument, but I can't dowload the code > from the link... it seems a broken link... can you post it or send me? > ThankU very much > Uest
Yeah, it seems not to display the schematic or code, kinda annoying. Does anyone have it archived or anything? Raphael