RS232 to I2S conversion

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi everyone ,

I am onto a small project for now in which i have to use the data sent from PC's RS232 out and convert this to I2S format and give to transmitter module,,,

This is so simple to listen but i am not able to get how to convert RS232 data to I2S format , so please do anyone can help me out from this...

It will be a great help if i could get some information about this , waiting for your valuable feedbacks ....
:xfingers:
 
RS232 sends one byte (or 7 bits) at a time. First a start bit is sent, then 8 bits of data, then a stop bit. It is asynchronous, so there is no clock, just data. The receiver needs to know the data rate so that it can estimate where each bit is located in the data stream. It is up to the transmitting and receiving equipment to know and agree upon what the data means. If you need to reliably send and receive data packets larger than 8 bits (a byte) then you need to have some kind of protocol. So usually some kind of start message is sent (sometimes indicating the number of data bytes to follow) then some data bytes and sent, then maybe a stop/end message is sent, maybe containing a checksum to validate that all the data is sent correctly, or maybe the message is NULL-terminated. The details are entirely up to the two devices that are communicating. There is no standard.

I2S is used for audio. It is synchronous, so there is a clock, actually two. There is a bit clock and a L/R or word (W) clock. A master clock of usually 256x or 512x the bit clock is sometimes included as well, since most audio devices require this clock, but it isn't strictly part of the I2S protocol. There are 64 bits of data sent for each cycle of the W Clock (so W clock is 64x the frequency of the bit clock). 32 bits for left, 32 for right. Of those 32, 16 to 24 are used for audio and the rest are usually unused. The format for the data is strictly defined, but there are a few different variations: Left justified and Sony are maybe the most common and they differ only slightly, mostly in the alignment of the data to the W clock.

Judging by your question, the above is probably over your head. Fortunately (or unfortunately?) you probably don't really need to convert RS232 into I2S. You probably don't need to do what you think you need to do, because you don't understand the problem well enough. Describe the problem here (not what you think you need to do!) and we'll see if we can help you figure that out.
 
Even I2C would be tricky, but possible. I2S will be virtually impossible. But that's why I want the poster to clarify the problem. Maybe there is a workable solution after all.

For superscript, use "sup" (to start) and and "/sup" (to stop), in square brackets. Like:
I [ s u p ] 2 [ / s u p ] S
(without all the extra spaces). Experiment using the preview post button. Do the same for subscript with "sub", bold using "b", italics using "i", etc. You can even do color. Check out:
diyAudio - BB Code List
 
I have a radio module which send data to a processing unit via RF channel...
So now my part is to replace this RF channel with some other means (Sorry i cant reveal this)...

So the new module has got inputs SPDIF, I2S , Analog and JTAG (Transmitter) , so i have to interface the data from the radio module to this new module in any
of these formats and without the loss of data ....

Next the Receiver module accepts this data from New module and should pass onto a PC or a disply unit .....

1st block - RF module (RS232 signals)
2nd block - New transmitter module (SPDIF, I2S , Analog and JTAG) , the processed data is sent wirelessly to Receiver
3rd block - New Receiver module
4th block - A PC or any display unit
.

So i think now i am clear with my problem definition
 
PC RS232 serial port data has many formats; 9600,n,8,1... 1200,y,7,2... 2400,y,8,0...

I2S can run at different speeds.

You can almost certainly do this with a PIC micro, one that has a UART built in. You will need a MAX232 chip or similar to interface 5V to RS232 levels.

You cannot do this unless you know the data formats, byte ordering, and data rates for both I2S and RS232.

w
 
Even if you do have an application which is sending audio over RS232, I doubt it is intended to be real-time. Even if your RS-232 is running all out at 115.2 kbaud, and only 8 bits of signal resolution, that means the max sampling frequency that can transmit is 14,400 Hz, which means the audio bandwidth is only 7,200 Hz in real time. As macboy says you probably have no idea what you are dealing with.
 
Administrator
Joined 2004
Paid Member
Even if you do have an application which is sending audio over RS232, I doubt it is intended to be real-time. Even if your RS-232 is running all out at 115.2 kbaud, and only 8 bits of signal resolution, that means the max sampling frequency that can transmit is 14,400 Hz, which means the audio bandwidth is only 7,200 Hz in real time. As macboy says you probably have no idea what you are dealing with.

The OP repeatedly uses the term "data" and never once mentions that it is audio. Given the device's use of RS232 it seems unlikely that this is anything that requires a lot of bandwidth, perhaps it is low speed telemetry or similar. None of the mentioned interfaces seem to be particularly well suited to this sort of use, and the OP for reasons beyond me will not disclose the application.

There are companies that manufacture devices to interface RS232 to 801A/B/G wireless - I would look at that as a solution instead. Using a WAP directly connected via ethernet (or you can use wireless to RS232 if you need to) to the PC based display device gets the job done.. An example: http://www.quatech.com/catalog/airbornedirect.php
 
Last edited:
Administrator
Joined 2004
Paid Member
I2S implies digital audio.

Yes, but that is not the original source device - it is something he has come up with as an interface that for whatever reason he thinks is suitable or handy. I'm not convinced he really understands the interface issues at hand, and in any event RS232 formatted data is fully compatible with the wireless bridge devices I suggested regardless of what the data being carried happens to be.
 
Read this document, you will figure out why others are asking you questions that you can't answer, that is just why no one can help you:

http://www.nxp.com/acrobat_download2/various/I2SBUS.pdf

In short, you need to build a customized controller for the RF module part that converts RS232 to I2S. You need to decide which channel your new transmitter module is working on, so the controller knows on which channel it must send your secret data. The controller must continuously generate the clock signal because it is always the master, your new transmitter module is always the slave.

Do you also know that you should understand what data is being sent on the RS-232? So that the controller knows if this is control data that decides on which channel (WS=0 or WS=1) on the I2S to be used, or if it is data to be just sent on the serial data line?

As of being elected to work on a secret system, you should be able to solve this your self!!!
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.