EmbeddedRelated.com
Forums

elimination of intercharacter gap in RS232 stream?

Started by Bo October 10, 2007
"Grant Edwards" <grante@visi.com> wrote in message 
news:13gv3tra8ocosd9@corp.supernews.com...
> On 2007-10-12, cbarn24050@aol.com <cbarn24050@aol.com> wrote: >> On Oct 12, 12:00?am, Grant Edwards <gra...@visi.com> wrote: >>> On 2007-10-11, cbarn24...@aol.com <cbarn24...@aol.com> wrote: >>> >>> > On Oct 11, 6:45?am, Paul Keinanen <keina...@sci.fi> wrote: >>> >>> >> Modbus is a quite common industrial protocol that requires that the >>> >> space between characters within the message is less than 1.5 >>> >> character >>> >> times. >>> >>> > Thats not right accoring to my sources. There are two modbus >>> > protocalls ASCII and binary. >>> >>> In my experience, only the latter has been used for the past 15 >>> years or so. >>> >>> > Only the binary version frames the message blocks with gaps >>> > (because it cannot send control characters). The ASCII version >>> > can have gaps as long as 1 second between characters. >>> >>> That's right, but nobody uses ASCII mode. >> >> You may wll be right but this thread is about ASCII >> transmision so mentioning modbus is irrelevent in this >> instance. > > My aplogies, I wasn't aware that you had restricted this thread > to discussing the transmission of ASCII text. > > -- > Grant Edwards
The protocol is binary. Bo
"Bo" <bo@cephus.com> wrote in message 
news:bb2ce$470e62b2$41a26d4d$4509@API-DIGITAL.COM...
> > "Paul Keinanen" <keinanen@sci.fi> wrote in message > news:9r9rg3l8v4h6l6dqqk5mecbujgcvk4qcke@4ax.com... >> On Wed, 10 Oct 2007 10:00:22 -0700, cbarn24050@aol.com wrote: >> >>>On Oct 10, 5:50?pm, "Bo" <b...@cephus.com> wrote: >>>> Writing an Embbeded Linux app for a PC104/Versalogic board. Linux >>>> 2.6.14.17. >>>> >>>> Using write() to transmit data packets to another PC104 board. If I >>>> write() >>>> 30 bytes, sometimes there is a 2-5mS gap in the middle of the >>>> transmission, usually at about byte 15-20, but sometimes at byte 29--as >>>> seen >>>> on a scope. Tried using low latency setting when >>>> opening the port--but this made no difference. This is causing >>>> difficulties >>>> for the receiving end-- and we have yet to add two more serial ports to >>>> the >>>> application. >>>> >>>> Any ideas on how to force continous transmission of the data? >>>> >>>> Thanks, >>>> >>>> Bo >>> >>>You would do better to solve the problem at the receiving end, thats >>>where your real problem is. >> >> Modbus is a quite common industrial protocol that requires that the >> space between characters within the message is less than 1.5 character >> times. >> >> I am not familiar with that particular UART, but it sounds as if the >> it has a 16 character transmit FIFO, which is not loaded fast enough >> by the interrupt service routine (ISR), when the first 16 characters >> have been sent. > > Perhaps--if the gap was always at byte 16--but its not. >> >> If the maximum allowed gap is defined in character times, try a lower >> baud rate. > > I can't. System spec is for 115.2K >> >> If the UART FIFO has some adjustable low water mark interrupt, try to >> increase the low water mark level, so that the ISR has more time to >> load more characters, before the previous characters have been >> transmitted. >> >> Reducing the Tx-FIFO size might also spread out the latency with more >> frequent but faster loadings. >> >> Since this is a PC104 board (ISA) board, what other devices do you >> have on the bus ? > > a video card and a digital IO board. I thin you may be onto something > here-- I'll try it without the video and see what happens. > >
Quick follow-up-- was not the video card... still stymied. Bo
In article <vratg3th99pospet0ns86vro4n39l6ebv0@4ax.com>, Paul Keinanen 
says...
> On Thu, 11 Oct 2007 15:26:12 -0700, cbarn24050@aol.com wrote: > > >On Oct 11, 6:45?am, Paul Keinanen <keina...@sci.fi> wrote: > > > >> Modbus is a quite common industrial protocol that requires that the > >> space between characters within the message is less than 1.5 character > >> times. > > > >Thats not right accoring to my sources. There are two modbus > >protocalls ASCII and binary. Only the binary version frames the > >message blocks with gaps (because it cannot send control characters). > >The ASCII version can have gaps as long as 1 second between characters. > > Have you actually seen anybody using Modbus ASCII in contrast to > Modbus RTU or Modbus/TCP ?
Yes. You really have to be careful with absolutes in a forum this large :) Robert -- Posted via a free Usenet account from http://www.teranews.com
In article <13gtanpb99n382@corp.supernews.com>, Grant Edwards says...
> On 2007-10-11, cbarn24050@aol.com <cbarn24050@aol.com> wrote: > > On Oct 11, 6:45?am, Paul Keinanen <keina...@sci.fi> wrote: > > > >> Modbus is a quite common industrial protocol that requires that the > >> space between characters within the message is less than 1.5 character > >> times. > > > > Thats not right accoring to my sources. There are two modbus > > protocalls ASCII and binary. > > In my experience, only the latter has been used for the past 15 > years or so.
I just did an ASCII one recently (in Rapid yet) to control an AC drive. Robert -- Posted via a free Usenet account from http://www.teranews.com
On 2007-10-23, Robert Adsett <sub2@aeolusdevelopment.com> wrote:
> In article <13gtanpb99n382@corp.supernews.com>, Grant Edwards says... >> On 2007-10-11, cbarn24050@aol.com <cbarn24050@aol.com> wrote: >> > On Oct 11, 6:45?am, Paul Keinanen <keina...@sci.fi> wrote: >> > >> >> Modbus is a quite common industrial protocol that requires that the >> >> space between characters within the message is less than 1.5 character >> >> times. >> > >> > Thats not right accoring to my sources. There are two modbus >> > protocalls ASCII and binary. >> >> In my experience, only the latter has been used for the past 15 >> years or so. > > I just did an ASCII one recently (in Rapid yet) to control an AC drive.
How old was the drive? I implemented Modbus for a few different products back in the early 90's, and I supported both ASCII and RTU. But I never ran into any installations that used ASCII. -- Grant Edwards grante Yow! Jesus is my at POSTMASTER GENERAL... visi.com
Follow-up to group--- we found/fixed the problem:


IRQ was disabled in the BIOS. After setting an interrupt for com3/com4 the 
problem was fixed.


This leads me to the question: what/how/where is the connection from BIOS to 
OS to drivers, made? Any links?

I was assuming that the driver, when loaded, knew he needed to be IRQ driven 
from the OS. Apparently this is not the case...

Thanks to all for the suggestions/thoughts....

Bo

"Bo" <bo@cephus.com> wrote in message 
news:50921$470d02cb$41a26d4d$30902@API-DIGITAL.COM...
> Writing an Embbeded Linux app for a PC104/Versalogic board. Linux > 2.6.14.17. > > Using write() to transmit data packets to another PC104 board. If I > write() > 30 bytes, sometimes there is a 2-5mS gap in the middle of the > transmission, usually at about byte 15-20, but sometimes at byte 29--as > seen on a scope. Tried using low latency setting when > opening the port--but this made no difference. This is causing > difficulties for the receiving end-- and we have yet to add two more > serial ports to the application. > > Any ideas on how to force continous transmission of the data? > > > Thanks, > > Bo >
On 2007-10-23, Bo <bo@cephus.com> wrote:

> IRQ was disabled in the BIOS. After setting an interrupt for > com3/com4 the problem was fixed.
Yup.
> This leads me to the question: what/how/where is the > connection from BIOS to OS to drivers, made? Any links?
I'm not sure what you're asking. The BIOS enables/disabled various chipset modules. The drivers just try to use those modules and don't generally know how/if they can be enabled or disabled.
> I was assuming that the driver, when loaded, knew he needed to > be IRQ driven from the OS. Apparently this is not the case...
The driver knows that it needs to be IRQ drivin. It just doesn't know whether the IRQ is actally connected as expected. [Well, actually the setserial program can try to discover what IRQ is connected to a given UART. I never had a lot of luck with it.] -- Grant Edwards grante Yow! Vote for ME -- I'm at well-tapered, half-cocked, visi.com ill-conceived and TAX-DEFERRED!
In article <13hqvpnr29p7j3f@corp.supernews.com>, Grant Edwards says...
> On 2007-10-23, Robert Adsett <sub2@aeolusdevelopment.com> wrote: > > In article <13gtanpb99n382@corp.supernews.com>, Grant Edwards says... > >> On 2007-10-11, cbarn24050@aol.com <cbarn24050@aol.com> wrote: > >> > On Oct 11, 6:45?am, Paul Keinanen <keina...@sci.fi> wrote: > >> > > >> >> Modbus is a quite common industrial protocol that requires that the > >> >> space between characters within the message is less than 1.5 character > >> >> times. > >> > > >> > Thats not right accoring to my sources. There are two modbus > >> > protocalls ASCII and binary. > >> > >> In my experience, only the latter has been used for the past 15 > >> years or so. > > > > I just did an ASCII one recently (in Rapid yet) to control an AC drive. > > How old was the drive? I implemented Modbus for a few > different products back in the early 90's, and I supported both > ASCII and RTU. But I never ran into any installations that used > ASCII.
It was a new drive (completely new installation), I don't know how old the drive design was. ASCII made a lot of sense for the implementation, if only because it is easy to debug with a simple monitor. Robert -- Posted via a free Usenet account from http://www.teranews.com
On 2007-10-24, Robert Adsett <sub2@aeolusdevelopment.com> wrote:

> ASCII made a lot of sense for the implementation, if only > because it is easy to debug with a simple monitor.
ASCII is tons easier to debug and far more foolproof. IMO, ASCII should be the default for any application that isn't bandwidth limited. -- Grant Edwards grante Yow! I invented skydiving at in 1989! visi.com
In article <13hte24o7ib311d@corp.supernews.com>, Grant Edwards says...
> On 2007-10-24, Robert Adsett <sub2@aeolusdevelopment.com> wrote: > > > ASCII made a lot of sense for the implementation, if only > > because it is easy to debug with a simple monitor. > > ASCII is tons easier to debug and far more foolproof. IMO, > ASCII should be the default for any application that isn't > bandwidth limited.
Which certainly wasn't an issue in this case. It takes the motor on the order of seconds to ramp to speed. I'm not sure it would even be possible to achieve RTU timings in Rapid. I wasn't tempted to try. Robert -- Posted via a free Usenet account from http://www.teranews.com