EmbeddedRelated.com
Forums

Delay between each transmission of RS232

Started by ly_haw January 10, 2008
Hi,

May I know how long a delay needed between each transmission by using
RS232? Beside that, how can I determine the delay period?

Thanks,.

yeehaw
hello,
whos period? do you ask about baud rate?

ly_haw a rit :
Hi,

May I know how long a delay needed between each transmission by using
RS232? Beside that, how can I determine the delay period?

Thanks,.

yeehaw




---------------------------------
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail





Hi,

For RS232 transmission, is that we need to have a delay for each byte
we transfer? If yes, then how long should the delay be?

Thanks for reply.

yeehaw
Hi,

The delay of transmission of the character is the ratio between the character length and the bauderate in bits/sec.

Sincerely yours.



ly_haw a rit :
Hi,

For RS232 transmission, is that we need to have a delay for each byte
we transfer? If yes, then how long should the delay be?

Thanks for reply.

yeehaw




---------------------------------
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail





No specific problem for RS-232... It's very easy.

It's a asynchronous protocol, so the receiver wait for
- a start bit (always one start bit, low),
- then 8 (or 9) bits of datas,
- then 1 or 2 stop bits (high).

When 9 bits of datas, this can be parity, or a 9th bit of data for other
usage.

Typically, when the receiver detect start bit (low), it waits for 1/2 bit
duration, then read 8 bits, waiting for each 1 bit duration, then wait 1 or
2 stops bits (high).
Because the receiver waits for start bit, it re-synchronies each byte.

If the stop bits arent present, there is a frame error.

The configuration tells you all you need.
I explain :
For example 8 bits, 1 stop bit, that means :
1 bit LOW (the start bit)
8 bits of data
1 bit HIGH (the start bit)
1 bit LOW (the start bit)
8 bits of data
1 bit HIGH (the start bit)
.../...

That means here 10 bits transmitted for a byte.
So the delay between each byte is done with start and stop bits.

Of course, if the receiver have many things to do between 2 bytes, and isn't
ready to receive, you will loss datas.
What is your receiver ?
At what speed do you want to work (baudrate) ?

Hope I've respond to your question.

Joel
> -----Message d'origine-----
> De: 6... [mailto:6...] De la part de
> ly_haw
> Envoy jeudi 10 janvier 2008 16:50
> : 6...
> Objet: Re: RE : [68HC12] Delay between each transmission of RS232
>
> Hi,
>
> For RS232 transmission, is that we need to have a delay for each byte
> we transfer? If yes, then how long should the delay be?
>
> Thanks for reply.
>
> yeehaw
>
>
>
>
>
"ly_haw" wrote:

> Hi,
>
> For RS232 transmission, is that we need to have a delay for each byte
> we transfer? If yes, then how long should the delay be?
I vote for No - no delays are needed. But I don't understand why you are
asking this, what's context? Is the other end of RS232 cable unable to
handle fast back to back transfers? If yes then you could 1) try to fix it,
2) throw it to the dustbin :-), 3) insert some X-delays between TX chars to
give it yet another chance...

Edward
>
> Thanks for reply.
>
> yeehaw
>
Yeehaw, you don't have to create any delay, the communication is handled
by the MPU, you just have to monitor the status registers
Benny

*RTS development Ltd
**
*

ly_haw wrote:
> Hi,
>
> For RS232 transmission, is that we need to have a delay for each byte
> we transfer? If yes, then how long should the delay be?
>
> Thanks for reply.
>
> yeehaw
>
>
>
Sorry, a litte mistake between start and stop...
Text below is OK.

Joel

> -----Message d'origine-----
> De: 6... [mailto:6...] De la part de
> jpdi
> Envoy jeudi 10 janvier 2008 17:24
> : 6...
> Objet: RE: RE : [68HC12] Delay between each transmission of RS232
>
> No specific problem for RS-232... It's very easy.
>
> It's a asynchronous protocol, so the receiver wait for
> - a start bit (always one start bit, low),
> - then 8 (or 9) bits of datas,
> - then 1 or 2 stop bits (high).
>
> When 9 bits of datas, this can be parity, or a 9th bit of data for other
> usage.
>
> Typically, when the receiver detect start bit (low), it waits for 1/2 bit
> duration, then read 8 bits, waiting for each 1 bit duration, then wait 1
> or
> 2 stops bits (high).
> Because the receiver waits for start bit, it re-synchronies each byte.
>
> If the stop bits arent present, there is a frame error.
>
> The configuration tells you all you need.
> I explain :
> For example 8 bits, 1 stop bit, that means :
> 1 bit LOW (the START bit)
> 8 bits of data
> 1 bit HIGH (the STOP bit)
> 1 bit LOW (the START bit)
> 8 bits of data
> 1 bit HIGH (the STOP bit)
> .../...
>
> That means here 10 bits transmitted for a byte.
> So the delay between each byte is done with start and stop bits.
>
> Of course, if the receiver have many things to do between 2 bytes, and
> isn't
> ready to receive, you will loss datas.
> What is your receiver ?
> At what speed do you want to work (baudrate) ?
>
> Hope I've respond to your question.
>
> Joel
>
>
> > -----Message d'origine-----
> > De: 6... [mailto:6...] De la part
> de
> > ly_haw
> > Envoy jeudi 10 janvier 2008 16:50
> > : 6...
> > Objet: Re: RE : [68HC12] Delay between each transmission of RS232
> >
> > Hi,
> >
> > For RS232 transmission, is that we need to have a delay for each byte
> > we transfer? If yes, then how long should the delay be?
> >
> > Thanks for reply.
> >
> > yeehaw
> >
> >
> >
> >
> >
--- In 6..., "ly_haw" wrote:
>
> Hi,
>
> May I know how long a delay needed between each transmission by using
> RS232? Beside that, how can I determine the delay period?

Few loose ends here, assuming you use modern gear, the actual serial protocol is handled by the hardware, you just have to watch the flags.

The problem is that when you have a heap of undetermined subs going around you might not be back in time to empty the latch if you are polling and lose the character.

That's why you normally handle RS232 in an interupt routine and a stash them in a circular buffer, that way you have a good chance to catch a transmission string without losing characters.

Especially when talking to MS shutters it is prudent not to assume it won't send another dozen characters after you send it an Xoff.

There are some worked routines in the files area here if you need them.
Cheers,

Theo