Maker Pro
Maker Pro

i2c to rs232 slave converter

R

Raphael

Jan 1, 1970
0
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
 
P

petrus bitbyter

Jan 1, 1970
0
Raphael said:
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,

I ever build one using a PIC16F73. This chip contains a UART as well as an
I2C interface so programming is straight forward. Nevertheless you has to
consider a few things:
- Your device needs an I2C address that should be polled by the master.
- Once the slave reacts, the data the master asks for should be available
within limited time. Otherwise you will either send wrong data or hold the
interface too long.
- This chip does not automatically stretches the clock after an
acknowledge from the master. So if the data is not available immediately
you'll have to strech that clock yourself. It was the first thing I did in
the interrupt routine after an I2C interrupt had been identified.

It may be worthwhile to look for a newer chip. For instance, take a look at:
http://www.voti.nl/pic/n_index.html

petrus
 
Top