HighDots.NET Computer Hardware Forums  

LPC quad UART garbling 8th bit in TX data - difficult to reproduce -any ideas?

Miscellaneous PC Hardware Miscellaneous PC hardware topics (comp.sys.ibm.pc.hardware.misc)


Discuss LPC quad UART garbling 8th bit in TX data - difficult to reproduce -any ideas? in the Miscellaneous PC Hardware forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #11  
Old   
Frantisek.Rysanek@post.cz
 
Posts: n/a

Default Re: LPC quad UART garbling 8th bit in TX data - difficult toreproduce - any ideas? - 01-26-2010 , 12:04 PM






Dear gentlemen,

many thanks to all of you who responded :-)

I'm delighted to see that the USENET is still alive, and that it's
sometimes the same
people responding to me, who used to respond ~10 years ago...

On 22 pro 2009, 15:23, Ian Malcolm wrote:
Quote:
Hyperterminal is known to garble *RECEIVED* characters under certain
circumstances if the first three characters recived are identical. *This
fault, once triggered, persists until the application is exited. I wonder
if it is possible for the same bug to also affect transmit? *

And, maybe special thanks to Ian Malcolm - his bug description is the
closest to mine :-)
If I exit Hyperterminal and start it again, the problem is typically
still there.
It survives even a power-cycle :-/

Quote:
Please try a 3rd party terminal and see if the problem goes away...
[suggested by several polite people]

Yes, this is definitely something I should do.
I've seen one more occurrence of the problem,
but didn't have a chance to test this - I probably inadvertently
reset the UART and the problem went away before I tried a different
terminal.
I have Putty and CRT on my USB flash drive just in case.

Quote:
Also censoring the uart chip brand and number will not lead you to any
answers... *

I know :-(
It's a matter of not biting the hand that feeds you.
After some early rookie experience in that way, I prefer to be
cautious.
After all, I'm not sure exactly where the problem is, and this
decription
could cast a shade on innocent hardware, which otherwise looks pretty
good...

Quote:
What happens if you send a string of genuine 8-bit characters, eg
extended ASCII? This will force Windows to "think about" the 8th bit,
whereas anything you type at the keyboard will usually be 7 bits.

right, tried that - made a file containing a megabyte of some
character with the MSb=log.1,
and the problem was still there. Back to 7bit characters, and still it
was there.

Quote:
It would be rational to suspect other serial processes
(IRDA as well as COM ports).

Ha, I haven't checked for IRDA. Makes me wonder if the IRDA modes
possibly
could use this kind of hardware feature. The UART's can work in some
IRDA modes,
but the hardware doesn't have a physical IR port, and as far as I
know, the IR modes
are not even offered in the BIOS setup for the COM ports. I can only
hope they're
properly disabled. Anyway I believe that Windows don't detect an IR
port.
Have to check to make sure - thanks for that note.
Still it makes me wonder. If the UART device was seized by some IRDA
service,
the production app running on the PC would fail to open it as a COM
port.
Sounds weird...
I was wondering if some Windows-internal ISA PnP stuff or generic
SuperIO
support could be messing with the SuperIO chip's config registers at
random.
Those are a special bank of registers with multiplexed access,
separate from
the classic ISA UART footprints in IO space.
Perhaps more likely the BIOS could have some bugs in that direction
(ACPI/SMI
handling and whatnot). Wish I had an LPC bus probe :-)

Quote:
Is is possible the send or receive is set to 7 bits + parity and the
other set to 8 bits? that would mess up the 8th bit on 50% of the
possible characters.

No. It works just fine most of the time.
The peers are set allright against each other.
Seen such misconfigurations before. This is different.
Most important it garbles every *other* character in a string.
Thanks for the suggestion though :-)

Quote:
You have a "stock Windows serial system"? No Windows updates, no
driver updates?
I'd suspect a problem right there. Go ahead and try *ALL* the updates.

It's a cut of XP Embedded based on XP SP3. I've checked the versions
of
serial.sys and serenum.sys - they're the same as on my laptop,
with Windows Update active.

Quote:
Given the concatenation of somewhat oddball chipsets in this system,
and the claim that it works properly under Linux, I'd suspect driver
issues, particularly flow control handling. Are your serial devices
actually wired correctly for hardware flow control?

no they're not :-) You _don't_ use flow control on RS485.
Anyway a flow control misconfiguration behaves very different.
You don't get anything transmitted (the write() syscall blocks),
or you get whole characters lost at the other end (FIFO overruns).

Quote:
Many well-meaning but clueless engineers get the RS-232
signals for different devices miswired, and never notice because
they've mishandled flow control and don't use it much.

[chuckle] don't tell me about well-meaning engineers :-)
What the Taiwanese HW designers can come up with...
Such as auto-loopback relays on Ethernet ports, in hardware
intended for firewall applications... or they use Linux in an embedded
box,
are soo very secretive about it (except that you can see the version
strings
in the firmware images available for download), and they can't seem to
get *default routing* right, and they have bugs in serial port
handling
on a great 16C950 UART (those are two areas where Linux has been
okay for decades now, in my experience).

Quote:
You should also definitely state which Windows and Linux operating
systems you're using.

the production OS is XPe, derived from XP SP3 (Czech locale I
believe).

The Linux that I'm using for tests, is an in-house mini-distro
assembled by hand
(scripted file copy) based on Fedora 5, with a 2.6.28.6 kernel
(custom config). Booting via PXE and working just fine with my
tools :-)

----

The lasting problem is that I keep getting pieces of the suspected
hardware
RMA'ed due to irrelevant problems (software misconfigurations, RS485
wiring sins),
and only now and then an odd piece happens to show the "flipping bit"
symptom.
Based on the set of observations so far, I can't even tell if the
"flipping bit syndrome in Hyperterminal" was to blame for a particular
production
malfunction, or if it was just the other problem I found on site :-)
This is something I have to sort through myselfs.

The publishable results of this ongoing customer case so far have
been:

1) a snippet of Mingw C++ code that attempts to mimick the
"hyperterminal reset"
(I straced hyperterminal to see what it does at the level of
syscalls,
and then I tried to reproduce that at the level of DLL function
calls :-)
http://www.fccps.cz/download/adv/frr/COMRESET.zip
I've hooked it up into the startup sequence of the last culprit
just in case.

2) a brain-dump of collected thoughts on RS485 grounding and
termination.
My head tends to relax if I write things down an publish for the
benefit of others
(provided that they can read through the mess :-)
http://www.fccps.cz/download/adv/frr/RS485/RS485.html

The important point is that I'm still having fun :-)

Thanks for your help everybody, take care

Frank Rysanek

Reply With Quote
  #12  
Old   
Sansui Samari
 
Posts: n/a

Default Re: LPC quad UART garbling 8th bit in TX data - difficult toreproduce - any ideas? - 01-28-2010 , 03:30 AM






On Jan 26, 9:04*am, "Frantisek.Rysa... (AT) post (DOT) cz"
<Frantisek.Rysa... (AT) post (DOT) cz> wrote:
Quote:
Dear gentlemen,

many thanks to all of you who responded :-)

I'm delighted to see that the USENET is still alive, and that it's
sometimes the same
people responding to me, who used to respond ~10 years ago...

On 22 pro 2009, 15:23, Ian Malcolm wrote:

Hyperterminal is known to garble *RECEIVED* characters under certain
circumstances if the first three characters recived are identical. *This
fault, once triggered, persists until the application is exited. I wonder
if it is possible for the same bug to also affect transmit? *

And, maybe special thanks to Ian Malcolm - his bug description is the
closest to mine :-)
If I exit Hyperterminal and start it again, the problem is typically
still there.
It survives even a power-cycle :-/

Please try a 3rd party terminal and see if the problem goes away...

[suggested by several polite people]

Yes, this is definitely something I should do.
I've seen one more occurrence of the problem,
but didn't have a chance to test this - I probably inadvertently
reset the UART and the problem went away before I tried a different
terminal.
I have Putty and CRT on my USB flash drive just in case.

Also censoring the uart chip brand and number will not lead you to any
answers... *

I know :-(
It's a matter of not biting the hand that feeds you.
After some early rookie experience in that way, I prefer to be
cautious.
After all, I'm not sure exactly where the problem is, and this
decription
could cast a shade on innocent hardware, which otherwise looks pretty
good...

What happens if you send a string of genuine 8-bit characters, eg
extended ASCII? This will force Windows to "think about" the 8th bit,
whereas anything you type at the keyboard will usually be 7 bits.

right, tried that - made a file containing a megabyte of some
character with the MSb=log.1,
and the problem was still there. Back to 7bit characters, and still it
was there.

It would be rational to suspect other serial processes
(IRDA as well as COM ports).

Ha, I haven't checked for IRDA. Makes me wonder if the IRDA modes
possibly
could use this kind of hardware feature. The UART's can work in some
IRDA modes,
but the hardware doesn't have a physical IR port, and as far as I
know, the IR modes
are not even offered in the BIOS setup for the COM ports. I can only
hope they're
properly disabled. Anyway I believe that Windows don't detect an IR
port.
Have to check to make sure - thanks for that note.
Still it makes me wonder. If the UART device was seized by some IRDA
service,
the production app running on the PC would fail to open it as a COM
port.
Sounds weird...
I was wondering if some Windows-internal ISA PnP stuff or generic
SuperIO
support could be messing with the SuperIO chip's config registers at
random.
Those are a special bank of registers with multiplexed access,
separate from
the classic ISA UART footprints in IO space.
Perhaps more likely the BIOS could have some bugs in that direction
(ACPI/SMI
handling and whatnot). Wish I had an LPC bus probe :-)

Is is possible the send or receive is set to 7 bits + parity and the
other set to 8 bits? that would mess up the 8th bit on 50% of the
possible characters.

No. It works just fine most of the time.
The peers are set allright against each other.
Seen such misconfigurations before. This is different.
Most important it garbles every *other* character in a string.
Thanks for the suggestion though :-)

You have a "stock Windows serial system"? No Windows updates, no
driver updates?
I'd suspect a problem right there. Go ahead and try *ALL* the updates.

It's a cut of XP Embedded based on XP SP3. I've checked the versions
of
serial.sys and serenum.sys - they're the same as on my laptop,
with Windows Update active.

Given the concatenation of somewhat oddball chipsets in this system,
and the claim that it works properly under Linux, I'd suspect driver
issues, particularly flow control handling. Are your serial devices
actually wired correctly for hardware flow control?

no they're not :-) You _don't_ use flow control on RS485.
Anyway a flow control misconfiguration behaves very different.
You don't get anything transmitted (the write() syscall blocks),
or you get whole characters lost at the other end (FIFO overruns).

Many well-meaning but clueless engineers get the RS-232
signals for different devices miswired, and never notice because
they've mishandled flow control and don't use it much.

[chuckle] don't tell me about well-meaning engineers :-)
What the Taiwanese HW designers can come up with...
Such as auto-loopback relays on Ethernet ports, in hardware
intended for firewall applications... or they use Linux in an embedded
box,
are soo very secretive about it (except that you can see the version
strings
in the firmware images available for download), and they can't seem to
get *default routing* right, and they have bugs in serial port
handling
on a great 16C950 UART (those are two areas where Linux has been
okay for decades now, in my experience).

You should also definitely state which Windows and Linux operating
systems you're using.

the production OS is XPe, derived from XP SP3 (Czech locale I
believe).

The Linux that I'm using for tests, is an in-house mini-distro
assembled by hand
(scripted file copy) based on Fedora 5, with a 2.6.28.6 kernel
(custom config). Booting via PXE and working just fine with my
tools :-)

----

The lasting problem is that I keep getting pieces of the suspected
hardware
RMA'ed due to irrelevant problems (software misconfigurations, RS485
wiring sins),
and only now and then an odd piece happens to show the "flipping bit"
symptom.
Based on the set of *observations so far, I can't even tell if the
"flipping bit syndrome in Hyperterminal" was to blame for a particular
production
malfunction, or if it was just the other problem I found on site :-)
This is something I have to sort through myselfs.

The publishable results of this ongoing customer case so far have
been:

1) a snippet of Mingw C++ code that attempts to mimick the
"hyperterminal reset"
* * (I straced hyperterminal to see what it does at the level of
syscalls,
* * *and then I tried to reproduce that at the level of DLL function
calls :-)
* *http://www.fccps.cz/download/adv/frr/COMRESET.zip
* * I've hooked it up into the startup sequence of the last culprit
just in case.

2) a brain-dump of collected thoughts on RS485 grounding and
termination.
* * My head tends to relax if I write things down an publish for the
benefit of others
* * (provided that they can read through the mess :-)
* *http://www.fccps.cz/download/adv/frr/RS485/RS485.html

The important point is that I'm still having fun :-)

Thanks for your help everybody, take care

Frank Rysanek
I had similar issues when I was writing a user interface for a machine
that had a windows pc interfacing with a PLC. We were using win98 if
I remember correctly. I think the uart and windows had an issue
because of the way windows would multitask. Windows would lock the
application just long enough to put it out of sync with the uart, and
cause garbled data, or a frozen application. I think there were also
problems with keeping other applications from accessing the port, even
though it should have been locked. At first, I would have to restart
windows when the app crashed. But then I rewrote the app, so I could
just re-initiate communications when it failed. I have a binder
around here somewhere, with our notes and data sheets and the like. I
don't know if they'll apply to you, but I'll post a better explanation
if I can find them.

I must be getting old when I remember fixing something, but don't
remember how the hell I did it. Then tell a long drawn out story with
no useful information whatsoever.



-Lazers

Reply With Quote
  #13  
Old   
Sansui Samari
 
Posts: n/a

Default Re: LPC quad UART garbling 8th bit in TX data - difficult toreproduce - any ideas? - 01-28-2010 , 03:40 AM



On Jan 26, 9:04*am, "Frantisek.Rysa... (AT) post (DOT) cz"
<Frantisek.Rysa... (AT) post (DOT) cz> wrote:
Quote:
Dear gentlemen,

many thanks to all of you who responded :-)

I'm delighted to see that the USENET is still alive, and that it's
sometimes the same
people responding to me, who used to respond ~10 years ago...

On 22 pro 2009, 15:23, Ian Malcolm wrote:

Hyperterminal is known to garble *RECEIVED* characters under certain
circumstances if the first three characters recived are identical. *This
fault, once triggered, persists until the application is exited. I wonder
if it is possible for the same bug to also affect transmit? *

And, maybe special thanks to Ian Malcolm - his bug description is the
closest to mine :-)
If I exit Hyperterminal and start it again, the problem is typically
still there.
It survives even a power-cycle :-/

Please try a 3rd party terminal and see if the problem goes away...

[suggested by several polite people]

Yes, this is definitely something I should do.
I've seen one more occurrence of the problem,
but didn't have a chance to test this - I probably inadvertently
reset the UART and the problem went away before I tried a different
terminal.
I have Putty and CRT on my USB flash drive just in case.

Also censoring the uart chip brand and number will not lead you to any
answers... *

I know :-(
It's a matter of not biting the hand that feeds you.
After some early rookie experience in that way, I prefer to be
cautious.
After all, I'm not sure exactly where the problem is, and this
decription
could cast a shade on innocent hardware, which otherwise looks pretty
good...

What happens if you send a string of genuine 8-bit characters, eg
extended ASCII? This will force Windows to "think about" the 8th bit,
whereas anything you type at the keyboard will usually be 7 bits.

right, tried that - made a file containing a megabyte of some
character with the MSb=log.1,
and the problem was still there. Back to 7bit characters, and still it
was there.

It would be rational to suspect other serial processes
(IRDA as well as COM ports).

Ha, I haven't checked for IRDA. Makes me wonder if the IRDA modes
possibly
could use this kind of hardware feature. The UART's can work in some
IRDA modes,
but the hardware doesn't have a physical IR port, and as far as I
know, the IR modes
are not even offered in the BIOS setup for the COM ports. I can only
hope they're
properly disabled. Anyway I believe that Windows don't detect an IR
port.
Have to check to make sure - thanks for that note.
Still it makes me wonder. If the UART device was seized by some IRDA
service,
the production app running on the PC would fail to open it as a COM
port.
Sounds weird...
I was wondering if some Windows-internal ISA PnP stuff or generic
SuperIO
support could be messing with the SuperIO chip's config registers at
random.
Those are a special bank of registers with multiplexed access,
separate from
the classic ISA UART footprints in IO space.
Perhaps more likely the BIOS could have some bugs in that direction
(ACPI/SMI
handling and whatnot). Wish I had an LPC bus probe :-)

Is is possible the send or receive is set to 7 bits + parity and the
other set to 8 bits? that would mess up the 8th bit on 50% of the
possible characters.

No. It works just fine most of the time.
The peers are set allright against each other.
Seen such misconfigurations before. This is different.
Most important it garbles every *other* character in a string.
Thanks for the suggestion though :-)

You have a "stock Windows serial system"? No Windows updates, no
driver updates?
I'd suspect a problem right there. Go ahead and try *ALL* the updates.

It's a cut of XP Embedded based on XP SP3. I've checked the versions
of
serial.sys and serenum.sys - they're the same as on my laptop,
with Windows Update active.

Given the concatenation of somewhat oddball chipsets in this system,
and the claim that it works properly under Linux, I'd suspect driver
issues, particularly flow control handling. Are your serial devices
actually wired correctly for hardware flow control?

no they're not :-) You _don't_ use flow control on RS485.
Anyway a flow control misconfiguration behaves very different.
You don't get anything transmitted (the write() syscall blocks),
or you get whole characters lost at the other end (FIFO overruns).

Many well-meaning but clueless engineers get the RS-232
signals for different devices miswired, and never notice because
they've mishandled flow control and don't use it much.

[chuckle] don't tell me about well-meaning engineers :-)
What the Taiwanese HW designers can come up with...
Such as auto-loopback relays on Ethernet ports, in hardware
intended for firewall applications... or they use Linux in an embedded
box,
are soo very secretive about it (except that you can see the version
strings
in the firmware images available for download), and they can't seem to
get *default routing* right, and they have bugs in serial port
handling
on a great 16C950 UART (those are two areas where Linux has been
okay for decades now, in my experience).

You should also definitely state which Windows and Linux operating
systems you're using.

the production OS is XPe, derived from XP SP3 (Czech locale I
believe).

The Linux that I'm using for tests, is an in-house mini-distro
assembled by hand
(scripted file copy) based on Fedora 5, with a 2.6.28.6 kernel
(custom config). Booting via PXE and working just fine with my
tools :-)

----

The lasting problem is that I keep getting pieces of the suspected
hardware
RMA'ed due to irrelevant problems (software misconfigurations, RS485
wiring sins),
and only now and then an odd piece happens to show the "flipping bit"
symptom.
Based on the set of *observations so far, I can't even tell if the
"flipping bit syndrome in Hyperterminal" was to blame for a particular
production
malfunction, or if it was just the other problem I found on site :-)
This is something I have to sort through myselfs.

The publishable results of this ongoing customer case so far have
been:

1) a snippet of Mingw C++ code that attempts to mimick the
"hyperterminal reset"
* * (I straced hyperterminal to see what it does at the level of
syscalls,
* * *and then I tried to reproduce that at the level of DLL function
calls :-)
* *http://www.fccps.cz/download/adv/frr/COMRESET.zip
* * I've hooked it up into the startup sequence of the last culprit
just in case.

2) a brain-dump of collected thoughts on RS485 grounding and
termination.
* * My head tends to relax if I write things down an publish for the
benefit of others
* * (provided that they can read through the mess :-)
* *http://www.fccps.cz/download/adv/frr/RS485/RS485.html

The important point is that I'm still having fun :-)

Thanks for your help everybody, take care

Frank Rysanek
You might try posting here.
http://omgili.com/probleme-rs232-sp3-windows-xp

Reply With Quote
  #14  
Old   
Sansui Samari
 
Posts: n/a

Default Re: LPC quad UART garbling 8th bit in TX data - difficult toreproduce - any ideas? - 01-28-2010 , 03:56 AM



On Jan 28, 12:40*am, Sansui Samari <jimjam1... (AT) gmail (DOT) com> wrote:
Quote:
On Jan 26, 9:04*am, "Frantisek.Rysa... (AT) post (DOT) cz"



Frantisek.Rysa... (AT) post (DOT) cz> wrote:
Dear gentlemen,

many thanks to all of you who responded :-)

I'm delighted to see that the USENET is still alive, and that it's
sometimes the same
people responding to me, who used to respond ~10 years ago...

On 22 pro 2009, 15:23, Ian Malcolm wrote:

Hyperterminal is known to garble *RECEIVED* characters under certain
circumstances if the first three characters recived are identical. *This
fault, once triggered, persists until the application is exited. I wonder
if it is possible for the same bug to also affect transmit? *

And, maybe special thanks to Ian Malcolm - his bug description is the
closest to mine :-)
If I exit Hyperterminal and start it again, the problem is typically
still there.
It survives even a power-cycle :-/

Please try a 3rd party terminal and see if the problem goes away...

[suggested by several polite people]

Yes, this is definitely something I should do.
I've seen one more occurrence of the problem,
but didn't have a chance to test this - I probably inadvertently
reset the UART and the problem went away before I tried a different
terminal.
I have Putty and CRT on my USB flash drive just in case.

Also censoring the uart chip brand and number will not lead you to any
answers... *

I know :-(
It's a matter of not biting the hand that feeds you.
After some early rookie experience in that way, I prefer to be
cautious.
After all, I'm not sure exactly where the problem is, and this
decription
could cast a shade on innocent hardware, which otherwise looks pretty
good...

What happens if you send a string of genuine 8-bit characters, eg
extended ASCII? This will force Windows to "think about" the 8th bit,
whereas anything you type at the keyboard will usually be 7 bits.

right, tried that - made a file containing a megabyte of some
character with the MSb=log.1,
and the problem was still there. Back to 7bit characters, and still it
was there.

It would be rational to suspect other serial processes
(IRDA as well as COM ports).

Ha, I haven't checked for IRDA. Makes me wonder if the IRDA modes
possibly
could use this kind of hardware feature. The UART's can work in some
IRDA modes,
but the hardware doesn't have a physical IR port, and as far as I
know, the IR modes
are not even offered in the BIOS setup for the COM ports. I can only
hope they're
properly disabled. Anyway I believe that Windows don't detect an IR
port.
Have to check to make sure - thanks for that note.
Still it makes me wonder. If the UART device was seized by some IRDA
service,
the production app running on the PC would fail to open it as a COM
port.
Sounds weird...
I was wondering if some Windows-internal ISA PnP stuff or generic
SuperIO
support could be messing with the SuperIO chip's config registers at
random.
Those are a special bank of registers with multiplexed access,
separate from
the classic ISA UART footprints in IO space.
Perhaps more likely the BIOS could have some bugs in that direction
(ACPI/SMI
handling and whatnot). Wish I had an LPC bus probe :-)

Is is possible the send or receive is set to 7 bits + parity and the
other set to 8 bits? that would mess up the 8th bit on 50% of the
possible characters.

No. It works just fine most of the time.
The peers are set allright against each other.
Seen such misconfigurations before. This is different.
Most important it garbles every *other* character in a string.
Thanks for the suggestion though :-)

You have a "stock Windows serial system"? No Windows updates, no
driver updates?
I'd suspect a problem right there. Go ahead and try *ALL* the updates..

It's a cut of XP Embedded based on XP SP3. I've checked the versions
of
serial.sys and serenum.sys - they're the same as on my laptop,
with Windows Update active.

Given the concatenation of somewhat oddball chipsets in this system,
and the claim that it works properly under Linux, I'd suspect driver
issues, particularly flow control handling. Are your serial devices
actually wired correctly for hardware flow control?

no they're not :-) You _don't_ use flow control on RS485.
Anyway a flow control misconfiguration behaves very different.
You don't get anything transmitted (the write() syscall blocks),
or you get whole characters lost at the other end (FIFO overruns).

Many well-meaning but clueless engineers get the RS-232
signals for different devices miswired, and never notice because
they've mishandled flow control and don't use it much.

[chuckle] don't tell me about well-meaning engineers :-)
What the Taiwanese HW designers can come up with...
Such as auto-loopback relays on Ethernet ports, in hardware
intended for firewall applications... or they use Linux in an embedded
box,
are soo very secretive about it (except that you can see the version
strings
in the firmware images available for download), and they can't seem to
get *default routing* right, and they have bugs in serial port
handling
on a great 16C950 UART (those are two areas where Linux has been
okay for decades now, in my experience).

You should also definitely state which Windows and Linux operating
systems you're using.

the production OS is XPe, derived from XP SP3 (Czech locale I
believe).

The Linux that I'm using for tests, is an in-house mini-distro
assembled by hand
(scripted file copy) based on Fedora 5, with a 2.6.28.6 kernel
(custom config). Booting via PXE and working just fine with my
tools :-)

----

The lasting problem is that I keep getting pieces of the suspected
hardware
RMA'ed due to irrelevant problems (software misconfigurations, RS485
wiring sins),
and only now and then an odd piece happens to show the "flipping bit"
symptom.
Based on the set of *observations so far, I can't even tell if the
"flipping bit syndrome in Hyperterminal" was to blame for a particular
production
malfunction, or if it was just the other problem I found on site :-)
This is something I have to sort through myselfs.

The publishable results of this ongoing customer case so far have
been:

1) a snippet of Mingw C++ code that attempts to mimick the
"hyperterminal reset"
* * (I straced hyperterminal to see what it does at the level of
syscalls,
* * *and then I tried to reproduce that at the level of DLL function
calls :-)
* *http://www.fccps.cz/download/adv/frr/COMRESET.zip
* * I've hooked it up into the startup sequence of the last culprit
just in case.

2) a brain-dump of collected thoughts on RS485 grounding and
termination.
* * My head tends to relax if I write things down an publish for the
benefit of others
* * (provided that they can read through the mess :-)
* *http://www.fccps.cz/download/adv/frr/RS485/RS485.html

The important point is that I'm still having fun :-)

Thanks for your help everybody, take care

Frank Rysanek

You might try posting here.http://omgili.com/probleme-rs232-sp3-windows-xp
And maybe searching through here...
http://www.arcelect.com/technica.htm

Reply With Quote
  #15  
Old   
G B
 
Posts: n/a

Default Re: LPC quad UART garbling 8th bit in TX data - difficult to reproduce - any ideas? - 01-29-2010 , 10:08 PM



Frank,

I saw a similar problem but it was running at approx 1Mb/s. I had problems
with clock skew in the devices. The clock in the send device was not the
same as the receive device. Hence the clocks would slowly drift over time.
I usually destroyed the 8th bit. Sometimes it would be just fine. I saw
the part about every other character which made me think if there is no
character pacing, it might take a full character time to resync. Just an
idea..

-Greg
p.s. I liked your ground loop discussion and graphs. Good info!

<Frantisek.Rysanek (AT) post (DOT) cz> wrote

Dear gentlemen,

many thanks to all of you who responded :-)

I'm delighted to see that the USENET is still alive, and that it's
sometimes the same
people responding to me, who used to respond ~10 years ago...

On 22 pro 2009, 15:23, Ian Malcolm wrote:
Quote:
Hyperterminal is known to garble *RECEIVED* characters under certain
circumstances if the first three characters recived are identical. This
fault, once triggered, persists until the application is exited. I wonder
if it is possible for the same bug to also affect transmit?

And, maybe special thanks to Ian Malcolm - his bug description is the
closest to mine :-)
If I exit Hyperterminal and start it again, the problem is typically
still there.
It survives even a power-cycle :-/

Quote:
Please try a 3rd party terminal and see if the problem goes away...
[suggested by several polite people]

Yes, this is definitely something I should do.
I've seen one more occurrence of the problem,
but didn't have a chance to test this - I probably inadvertently
reset the UART and the problem went away before I tried a different
terminal.
I have Putty and CRT on my USB flash drive just in case.

Quote:
Also censoring the uart chip brand and number will not lead you to any
answers...

I know :-(
It's a matter of not biting the hand that feeds you.
After some early rookie experience in that way, I prefer to be
cautious.
After all, I'm not sure exactly where the problem is, and this
decription
could cast a shade on innocent hardware, which otherwise looks pretty
good...

Quote:
What happens if you send a string of genuine 8-bit characters, eg
extended ASCII? This will force Windows to "think about" the 8th bit,
whereas anything you type at the keyboard will usually be 7 bits.

right, tried that - made a file containing a megabyte of some
character with the MSb=log.1,
and the problem was still there. Back to 7bit characters, and still it
was there.

Quote:
It would be rational to suspect other serial processes
(IRDA as well as COM ports).

Ha, I haven't checked for IRDA. Makes me wonder if the IRDA modes
possibly
could use this kind of hardware feature. The UART's can work in some
IRDA modes,
but the hardware doesn't have a physical IR port, and as far as I
know, the IR modes
are not even offered in the BIOS setup for the COM ports. I can only
hope they're
properly disabled. Anyway I believe that Windows don't detect an IR
port.
Have to check to make sure - thanks for that note.
Still it makes me wonder. If the UART device was seized by some IRDA
service,
the production app running on the PC would fail to open it as a COM
port.
Sounds weird...
I was wondering if some Windows-internal ISA PnP stuff or generic
SuperIO
support could be messing with the SuperIO chip's config registers at
random.
Those are a special bank of registers with multiplexed access,
separate from
the classic ISA UART footprints in IO space.
Perhaps more likely the BIOS could have some bugs in that direction
(ACPI/SMI
handling and whatnot). Wish I had an LPC bus probe :-)

Quote:
Is is possible the send or receive is set to 7 bits + parity and the
other set to 8 bits? that would mess up the 8th bit on 50% of the
possible characters.

No. It works just fine most of the time.
The peers are set allright against each other.
Seen such misconfigurations before. This is different.
Most important it garbles every *other* character in a string.
Thanks for the suggestion though :-)

Quote:
You have a "stock Windows serial system"? No Windows updates, no
driver updates?
I'd suspect a problem right there. Go ahead and try *ALL* the updates.

It's a cut of XP Embedded based on XP SP3. I've checked the versions
of
serial.sys and serenum.sys - they're the same as on my laptop,
with Windows Update active.

Quote:
Given the concatenation of somewhat oddball chipsets in this system,
and the claim that it works properly under Linux, I'd suspect driver
issues, particularly flow control handling. Are your serial devices
actually wired correctly for hardware flow control?

no they're not :-) You _don't_ use flow control on RS485.
Anyway a flow control misconfiguration behaves very different.
You don't get anything transmitted (the write() syscall blocks),
or you get whole characters lost at the other end (FIFO overruns).

Quote:
Many well-meaning but clueless engineers get the RS-232
signals for different devices miswired, and never notice because
they've mishandled flow control and don't use it much.

[chuckle] don't tell me about well-meaning engineers :-)
What the Taiwanese HW designers can come up with...
Such as auto-loopback relays on Ethernet ports, in hardware
intended for firewall applications... or they use Linux in an embedded
box,
are soo very secretive about it (except that you can see the version
strings
in the firmware images available for download), and they can't seem to
get *default routing* right, and they have bugs in serial port
handling
on a great 16C950 UART (those are two areas where Linux has been
okay for decades now, in my experience).

Quote:
You should also definitely state which Windows and Linux operating
systems you're using.

the production OS is XPe, derived from XP SP3 (Czech locale I
believe).

The Linux that I'm using for tests, is an in-house mini-distro
assembled by hand
(scripted file copy) based on Fedora 5, with a 2.6.28.6 kernel
(custom config). Booting via PXE and working just fine with my
tools :-)

----

The lasting problem is that I keep getting pieces of the suspected
hardware
RMA'ed due to irrelevant problems (software misconfigurations, RS485
wiring sins),
and only now and then an odd piece happens to show the "flipping bit"
symptom.
Based on the set of observations so far, I can't even tell if the
"flipping bit syndrome in Hyperterminal" was to blame for a particular
production
malfunction, or if it was just the other problem I found on site :-)
This is something I have to sort through myselfs.

The publishable results of this ongoing customer case so far have
been:

1) a snippet of Mingw C++ code that attempts to mimick the
"hyperterminal reset"
(I straced hyperterminal to see what it does at the level of
syscalls,
and then I tried to reproduce that at the level of DLL function
calls :-)
http://www.fccps.cz/download/adv/frr/COMRESET.zip
I've hooked it up into the startup sequence of the last culprit
just in case.

2) a brain-dump of collected thoughts on RS485 grounding and
termination.
My head tends to relax if I write things down an publish for the
benefit of others
(provided that they can read through the mess :-)
http://www.fccps.cz/download/adv/frr/RS485/RS485.html

The important point is that I'm still having fun :-)

Thanks for your help everybody, take care

Frank Rysanek

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.