AW: [En-Nut-Discussion] Receiving weird 0 on UART

Ernst Stippl ernst at stippl.org
Wed Apr 19 22:24:17 CEST 2006


Hello!

I remember from the dark ages of the data communications area the "break"
condition, which was a "space" (or was it a "mark"?) on the receiving pin of
a uart for a few hundred millisecs. This was a condition which could never
occur during the transmission of a "real" character, so it always signalled
a "special" condition (special in this case was defined by the transmission
protocol used). 

Anyway, the "break" condition also sometimes looked like a binary zero to
the uart receiver (despite the missing start / stop bit) and could therefore
be misinterpreted IF the "break signal received" condition in the uart's
status register was not checked. 

I just had a look into the atmega128 manual and on page 189 there is the
explanation of the usart control and status register. Here you can check for
break conditions thru the framing error bit.
Have a look into the  device driver to see if such conditions are recognized
there (or gladly ignored, becuase "normally they dont happen")

regards
ernst

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Manuel Mausz
Gesendet: Mittwoch, 19. April 2006 17:04
An: Ethernut User Chat (English)
Betreff: RE: [En-Nut-Discussion] Receiving weird 0 on UART

Hi,

we've tested a little bit more and we're receiving the "0" even if no client
is connected. So the "0" must be from the "transmission direction
turnaround". The question is why do we get this? - And how can we avoid
this?

/ manuel

> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de]On Behalf Of Ernst Stippl
> Sent: Tuesday, April 18, 2006 11:14 PM
> To: 'Ethernut User Chat (English)'
> Subject: AW: [En-Nut-Discussion] Receiving weird 0 on UART
>
>
> Hi Manuel!
>
> Maybe the weird "0" you are receiving is created by the "turnaround" 
> of the transmission direction on the RS485 link? Are you receiving the 
> "0" for every character sent? How is the echo done on the client side? 
> Is each character echoed immediately when received by the client or is 
> the text received and stored upto a cr/lf and the sent back by the client?
>
> regards
> ernst
>
> -----Ursprüngliche Nachricht-----
> Von: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Manuel 
> Mausz
> Gesendet: Dienstag, 18. April 2006 17:56
> An: Ethernut User Chat (English)
> Betreff: RE: [En-Nut-Discussion] Receiving weird 0 on UART
>
> I've just noticed that the list has deleted my attachment.
>
> Test prog @ http://www.netcore.at/misc/test.c
>
> / manuel
>
> > -----Original Message-----
> > From: en-nut-discussion-bounces at egnite.de
> > [mailto:en-nut-discussion-bounces at egnite.de]On Behalf Of Manuel 
> > Mausz
> > Sent: Monday, April 17, 2006 5:56 PM
> > To: en-nut-discussion at egnite.de
> > Subject: [En-Nut-Discussion] Receiving weird 0 on UART
> >
> >
> > Hi list,
> >
> > we're currently building a client<->server application and therefor 
> > we're using the ethernut 1.3 rev. F board (as server). To 
> > communicate with
> the other selfmade boards(/clients), we're using a SN75176BP to 
> convert from
> RS232 to RS485.
> >
> > For testing purpose our client board is just echoing all characters.
> > If we run the attached test program without the RS485 driver, 
> > everything works as expected. But if we add the driver and ethernut 
> > is
> sending characters first (line 114), we always receive a 0 before we 
> get the sent characters. If we run another test program which only let 
> the client board send data, we don't get any 0s.
> >
> > Since we're stuck now, any input would be appreciated.
> >
> > Setup:
> > Driver SN75176BP:
> > PIND5 -> ^RE/DE
> > PIND2(RX) -> R
> > PIND3(TX) -> D
> >
> > Ethernut 4.1.3
> > UART1_HDX_BIT = 5
> > UART1_HDX_AVRPORT = AVRPORTD
> >
> > Regards,
> > / manuel
> >
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>

_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.4/319 - Release Date: 19.04.2006



-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.4/319 - Release Date: 19.04.2006





More information about the En-Nut-Discussion mailing list