PDA

View Full Version : RS-232 doubt.?



yesh
07-25-2008, 09:38 PM
Tis is the problem i am having

In my college i am having a system that has an RS 232 port attached with it.More than 25 parameters like voltage, speed, current..etc are available through that port.
Now i want to get those parameters available from RS 232 n send it as a msg through GSM..

What are the steps that is to be followed for effective transmission of those parameters.?

I have my idea,but i want some more ideas for effective transmission.?

Thanks for ur suggestions in advance

shobhitkukreti
07-26-2008, 12:25 AM
what does system mean ?? a PC, and what is the idea you have in your mind,atleast share your idea before asking for help.

yesh
07-26-2008, 05:35 AM
ya...The system i am mentioning is a module actually for measuring certain parameters in control systems laboratory..There is also a digital display in the module where we can view the results...I actually want to transmit the parameters that we are measuring in the module which are available in the RS 232 port...There are around 15 parameters which can be measured in that module..

Hope you get what i am trying to say..?!

debu
07-26-2008, 01:10 PM
@yesh: Do you have a GSM module, maybe something in mind, or do you need a suggestion?

Most GSM modules work on RS232, so if you want to send RS232 data over the RS232 of your GSM module, you will need to have two RS232 ports on your microcontroller (like the mega161,128 Dallas 89C420, AT89S52U2 or PIC18F6622, to name a few ).

So your system can be a simple uC based design, which takes the data from your input source, using UART0, and transmits it using UART1 via the GSM module.

Hope that helps,

Regards,

Debu :)

yesh
07-26-2008, 07:26 PM
@debu

Ya..i am planning to use a GSM module.I have not worked with microcontrollers much.I am having abt 25 signals available at my RS 232 port like voltage,current,speed,.etc..How can i differentiate the signals..If i want to send only voltage or current...how can i differentiate those 25 parameters from one another..??

MohitM
07-26-2008, 10:18 PM
You need to design a protocol for the transmission first. Something with a sync byte, start byte, command bytes, data bytes, stop byte, etc.

As an example, check this out:
http://www.serialwombat.com/protocol.htm

yesh
07-27-2008, 05:13 AM
@Mohit

Do do i need to design a transmission protocol first that is as given in serial wombat first to separate the parameters..?

yesh
07-27-2008, 05:23 AM
Can any one list out the steps of what actually i should do.?

I got an overall idea of how to separate the parameters by designing a protocol...

But still more specific information may help me..?!!

MohitM
07-27-2008, 12:32 PM
First, decide how the various parameters are going to be represented.

Will two bytes be sufficient for each parameter? Two bytes give you 65536 levels. I think they should be.

Next, each parameter should have an identifier command byte. For example, voltage is 0x01, current 0x02, speed 0x03.

So your protocol looks like:

<Sync bytes> <Start byte> <Identifier byte 1> <Data higher byte 1> <Data lower byte 1> <Identifier byte 2> <Data higher byte 2> <Data lower byte 2> ... <Stop byte>

When the receiver receives this data, it knows its time to sync, the start byte tells it is just about to get the data, the identifier tells that the next two bytes are going to be voltage (or current or whatever) data. And it should be storing this in some buffer. The stop byte tells it that the transmission is now complete.

The receiver now acts on the data in whatever way its programmed to.

I'm assuming that the hardware is in place and working. If its not, I suggest first begin by transmitting and receiving just a series of 0s and 1s correctly. The protocol part comes much later.