Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #10716 > unrolled thread

baud rate autodetection on AVR 8-bit?

Started byIvan Shmakov <oneingray@gmail.com>
First post2012-12-07 21:17 +0700
Last post2012-12-14 21:26 -0800
Articles 20 on this page of 105 — 34 participants

Back to article view | Back to comp.arch.embedded


Contents

  baud rate autodetection on AVR 8-bit? Ivan Shmakov <oneingray@gmail.com> - 2012-12-07 21:17 +0700
    Re: baud rate autodetection on AVR 8-bit? Rich Webb <bbew.ar@mapson.nozirev.ten> - 2012-12-07 10:28 -0500
      Re: baud rate autodetection on AVR 8-bit? Ivan Shmakov <oneingray@gmail.com> - 2012-12-07 23:31 +0700
        Re: baud rate autodetection on AVR 8-bit? Rich Webb <bbew.ar@mapson.nozirev.ten> - 2012-12-07 12:42 -0500
          Re: baud rate autodetection on AVR 8-bit? mike <ham789@netzero.net> - 2012-12-07 13:35 -0800
            Re: baud rate autodetection on AVR 8-bit? Rich Webb <bbew.ar@mapson.nozirev.ten> - 2012-12-07 20:07 -0500
            Re: baud rate autodetection on AVR 8-bit? Mark Borgerson <mborgerson@comcast.net> - 2012-12-07 23:43 -0800
        Re: baud rate autodetection on AVR 8-bit? Tim Wescott <tim@seemywebsite.com> - 2012-12-07 13:07 -0600
        Re: baud rate autodetection on AVR 8-bit? Dave Nadler <drn@nadler.com> - 2012-12-07 12:09 -0800
          Re: baud rate autodetection on AVR 8-bit? Ivan Shmakov <oneingray@gmail.com> - 2012-12-08 03:47 +0700
            Re: baud rate autodetection on AVR 8-bit? MK <mk@nospam.co.uk> - 2012-12-08 09:44 +0000
              8-bit vs. 32-bit MCU's Ivan Shmakov <oneingray@gmail.com> - 2012-12-08 18:31 +0700
                Re: 8-bit vs. 32-bit MCU's MK <mk@nospam.co.uk> - 2012-12-09 14:13 +0000
                  Re: 8-bit vs. 32-bit MCU's Ivan Shmakov <oneingray@gmail.com> - 2012-12-09 22:52 +0700
      Re: baud rate autodetection on AVR 8-bit? upsidedown@downunder.com - 2012-12-08 15:01 +0200
    Re: baud rate autodetection on AVR 8-bit? Dombo <dombo@disposable.invalid> - 2012-12-08 15:18 +0100
    Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] Glenn <glenn2233@gmail.com> - 2012-12-09 10:47 +0100
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2012-12-09 10:22 +0000
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] "Bruce Varley" <bv@NoSpam.com> - 2012-12-09 19:07 +0800
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] Paul <paul@pcserviceselectronics.co.uk> - 2012-12-09 13:27 +0000
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232   ? ] Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2012-12-09 16:19 +0100
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] "TTman" <pcw1.cad@ntlworld.com> - 2012-12-09 15:38 +0000
        Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] amdyer@gmail.com - 2012-12-09 07:45 -0800
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] upsidedown@downunder.com - 2012-12-09 17:45 +0200
        Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] Paul <paul@pcserviceselectronics.co.uk> - 2012-12-09 21:30 +0000
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] John Larkin <jjlarkin@highNOTlandTHIStechnologyPART.com> - 2012-12-09 09:02 -0800
        Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] Lanarcam <lanarcam1@yahoo.fr> - 2012-12-09 18:13 +0100
          Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] upsidedown@downunder.com - 2012-12-09 19:44 +0200
          Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] Paul <paul@pcserviceselectronics.co.uk> - 2012-12-09 21:32 +0000
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] Robert Wessel <robertwessel2@yahoo.com> - 2012-12-10 00:35 -0600
      Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ] josephkk <joseph_barrett@sbcglobal.net> - 2012-12-12 20:30 -0800
    Re: baud rate autodetection on AVR 8-bit? "Meindert Sprang" <ms@NOJUNKcustomORSPAMware.nl> - 2012-12-10 13:38 +0100
      Re: baud rate autodetection on AVR 8-bit? Ivan Shmakov <oneingray@gmail.com> - 2012-12-10 20:19 +0700
        Re: baud rate autodetection on AVR 8-bit? "Meindert Sprang" <ms@NOJUNKcustomORSPAMware.nl> - 2012-12-10 16:24 +0100
          Re: baud rate autodetection on AVR 8-bit? Arlet Ottens <usenet+5@c-scape.nl> - 2012-12-10 16:49 +0100
          Re: baud rate autodetection on AVR 8-bit? Rich Webb <bbew.ar@mapson.nozirev.ten> - 2012-12-12 08:50 -0500
    Re: baud rate autodetection on AVR 8-bit? j.m.granville@gmail.com - 2012-12-11 21:22 -0800
      Re: baud rate autodetection on AVR 8-bit? Robert Wessel <robertwessel2@yahoo.com> - 2012-12-12 00:29 -0600
        Re: baud rate autodetection on AVR 8-bit? Mark Borgerson <mborgerson@comcast.net> - 2012-12-11 23:43 -0800
          Re: baud rate autodetection on AVR 8-bit? Robert Wessel <robertwessel2@yahoo.com> - 2012-12-12 02:38 -0600
            Re: baud rate autodetection on AVR 8-bit? Mark Borgerson <mborgerson@comcast.net> - 2012-12-12 07:46 -0800
              Re: baud rate autodetection on AVR 8-bit? linnix <me@linnix.info-for.us> - 2012-12-12 10:50 -0800
                Re: baud rate autodetection on AVR 8-bit? Jon Kirwan <jonk@infinitefactors.org> - 2012-12-12 12:42 -0800
                  Re: baud rate autodetection on AVR 8-bit? Jon Kirwan <jonk@infinitefactors.org> - 2012-12-12 12:56 -0800
                  Re: baud rate autodetection on AVR 8-bit? upsidedown@downunder.com - 2012-12-12 23:22 +0200
                    Re: baud rate autodetection on AVR 8-bit? Robert Wessel <robertwessel2@yahoo.com> - 2012-12-12 15:39 -0600
                      Re: baud rate autodetection on AVR 8-bit? Jon Kirwan <jonk@infinitefactors.org> - 2012-12-12 15:13 -0800
                        Re: baud rate autodetection on AVR 8-bit? Jon Kirwan <jonk@infinitefactors.org> - 2012-12-12 15:28 -0800
                        Re: baud rate autodetection on AVR 8-bit? Robert Wessel <robertwessel2@yahoo.com> - 2012-12-12 18:41 -0600
                          Re: baud rate autodetection on AVR 8-bit? Jon Kirwan <jonk@infinitefactors.org> - 2012-12-12 17:12 -0800
                Re: baud rate autodetection on AVR 8-bit? Mark Borgerson <mborgerson@comcast.net> - 2012-12-12 12:43 -0800
                  Communications under pressure (was Re: baud rate...) Frnak McKenney <frnak@far.from.the.madding.crowd.com> - 2012-12-13 10:25 -0600
                    Re: Communications under pressure (was Re: baud rate...) Robert Wessel <robertwessel2@yahoo.com> - 2012-12-13 12:34 -0600
                      Re: Communications under pressure (was Re: baud rate...) upsidedown@downunder.com - 2012-12-14 10:33 +0200
                        Re: Communications under pressure (was Re: baud rate...) Mark Borgerson <mborgerson@comcast.net> - 2012-12-14 07:43 -0800
                    Re: Communications under pressure (was Re: baud rate...) Mark Borgerson <mborgerson@comcast.net> - 2012-12-13 16:47 -0800
                      Re: Communications under pressure (was Re: baud rate...) Jon Kirwan <jonk@infinitefactors.org> - 2012-12-13 18:22 -0800
                        Re: Communications under pressure (was Re: baud rate...) Jon Kirwan <jonk@infinitefactors.org> - 2012-12-13 18:27 -0800
                        Re: Communications under pressure (was Re: baud rate...) Mark Borgerson <mborgerson@comcast.net> - 2012-12-13 23:20 -0800
                          Re: Communications under pressure (was Re: baud rate...) Frank Miles <fpm@u.washington.edu> - 2012-12-14 17:50 +0000
                            Re: Communications under pressure (was Re: baud rate...) Mark Borgerson <mborgerson@comcast.net> - 2012-12-14 14:28 -0800
            serial host-to-device communication in amateur designs Ivan Shmakov <oneingray@gmail.com> - 2012-12-14 23:21 +0700
              Re: serial host-to-device communication in amateur designs Rob Gaddi <rgaddi@technologyhighland.invalid> - 2012-12-14 09:18 -0800
                Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-14 11:19 -0800
                  Re: serial host-to-device communication in amateur designs Ivan Shmakov <oneingray@gmail.com> - 2012-12-16 21:00 +0700
                    Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-16 13:46 -0800
                      USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-17 00:53 +0000
                        Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-16 17:46 -0800
                          Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-17 13:27 +0000
                            Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Mel Wilson <mwilson@the-wire.com> - 2012-12-17 10:32 -0500
                              Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs me@linnix.info-for.us - 2012-12-17 11:13 -0800
                            Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-17 12:03 -0800
                              Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-17 12:17 -0800
                                Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Christopher Head <chead@is.invalid> - 2012-12-17 23:36 -0800
                                  Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-17 23:54 -0800
                                    Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-18 13:06 +0000
                                    Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs j.m.granville@gmail.com - 2012-12-18 14:04 -0800
                                      Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-18 14:13 -0800
                                        Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Christopher Head <chead@is.invalid> - 2012-12-19 02:37 -0800
                                          Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-19 12:59 +0000
                                            Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Rocky <RobertGush@gmail.com> - 2012-12-19 10:19 -0800
                                            Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-19 10:43 -0800
                                          Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-19 10:39 -0800
                                            Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-19 10:44 -0800
                                              Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Christopher Head <chead@is.invalid> - 2012-12-19 18:42 -0800
                                                Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-19 21:05 -0800
                                                  Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-20 14:13 +0000
                                                    Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-20 11:58 -0800
                                    Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Waldek Hebisch <hebisch@math.uni.wroc.pl> - 2012-12-24 00:41 +0000
                                      Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Waldek Hebisch <hebisch@math.uni.wroc.pl> - 2012-12-24 15:45 +0000
                                        Re: Writing a USB device stack, was: Re: USB CDC ACM, was: Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-24 11:40 -0800
                      Re: serial host-to-device communication in amateur designs Frnak McKenney <frnak@far.from.the.madding.crowd.com> - 2012-12-20 10:00 -0600
                        Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-20 11:54 -0800
                          Re: serial host-to-device communication in amateur designs Rob Gaddi <rgaddi@technologyhighland.invalid> - 2012-12-20 12:01 -0800
                            Re: serial host-to-device communication in amateur designs Jon Kirwan <jonk@infinitefactors.org> - 2012-12-20 12:27 -0800
              Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-14 17:53 +0000
                Re: serial host-to-device communication in amateur designs Ivan Shmakov <oneingray@gmail.com> - 2012-12-15 01:26 +0700
                  Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-14 19:30 +0000
                    Re: serial host-to-device communication in amateur designs Ivan Shmakov <oneingray@gmail.com> - 2012-12-15 11:25 +0700
                      Re: serial host-to-device communication in amateur designs Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> - 2012-12-17 00:29 +0000
                        Re: serial host-to-device communication in amateur designs me@linnix.info-for.us - 2012-12-17 11:05 -0800
                  Re: serial host-to-device communication in amateur designs Rich Webb <bbew.ar@mapson.nozirev.ten> - 2012-12-14 14:34 -0500
                  Re: serial host-to-device communication in amateur designs Paul <paul@pcserviceselectronics.co.uk> - 2012-12-14 23:25 +0000
                    finer pitches Ivan Shmakov <oneingray@gmail.com> - 2012-12-16 20:48 +0700
                Re: serial host-to-device communication in amateur designs Mark Borgerson <mborgerson@comcast.net> - 2012-12-14 21:26 -0800

Page 2 of 6 — ← Prev page 1 [2] 3 4 5 6  Next page →


#10736 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2012-12-09 16:19 +0100
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<aijofdFm7cdU1@mid.dfncis.de>
In reply to#10731
On 09.12.2012 10:47, Glenn wrote:

> After so many years with that "stupid vintage" serial communications
> protocol, we still do not have autonegotiation (and auto-baud-detection)
> built into the protocol definitions. Why not?

Because there really is nothing to negotiate.

> Why have nobody made a request-for-comment about that,

For starters, because I'm pretty sure there is no RFC mechanism in place 
for the body that this specification is from.  If that body still 
exists, that is.

> It is simply incredibly, that after so many decades, you manually has to
> find out, how to get it to work.

Actually no.  It's exactly because of all those decades, and the myriad 
of devices already in the field, that this specification is, for all 
practical intents and purposes, immutable.  No change you could come up 
with now would help one bit with all those devices.  And if a change 
doesn't achieve anything for the overwhelming majority of applications, 
what point could there possibly be?

[toc] | [prev] | [next] | [standalone]


#10737 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

From"TTman" <pcw1.cad@ntlworld.com>
Date2012-12-09 15:38 +0000
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<ka2bai$42h$1@dont-email.me>
In reply to#10731
"Glenn" <glenn2233@gmail.com> wrote in message 
news:50c45e31$0$284$14726298@news.sunsite.dk...
> On 07/12/12 15.17, Ivan Shmakov wrote:
>> BTW, is there an easy way to autodetect the baud rate while
>> using an AVR UART?  (Preferably something that works with
>> ATmega8, given that those MCU's are such a cheap thing
>> nowadays.)
>>
>> There're some ideas (and 8051 code) for that on [1], but I'd
>> like to know if there could be any better techniques.
>>
>> TIA.
>>
>> [1] http://www.pjrc.com/tech/8051/autobaud.html
>>
>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
>> Bus Pirate clone.  The good news is that the parts for this one
>> will likely cost under $10... (connectors included.)
>>

Pefectly possible...you just have to write the software.... 

[toc] | [prev] | [next] | [standalone]


#10739 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

Fromamdyer@gmail.com
Date2012-12-09 07:45 -0800
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<78e67dd1-336e-49d0-a41c-068384ca1853@googlegroups.com>
In reply to#10737
On Sunday, December 9, 2012 9:38:50 AM UTC-6, TTman wrote:
> "Glenn" <glenn2233@gmail.com> wrote in message 
> 
> news:50c45e31$0$284$14726298@news.sunsite.dk...
> 
> > On 07/12/12 15.17, Ivan Shmakov wrote:
> 
> >> BTW, is there an easy way to autodetect the baud rate while
> 
> >> using an AVR UART?  (Preferably something that works with
> 
> >> ATmega8, given that those MCU's are such a cheap thing
> 
> >> nowadays.)
> 
> >>
> 
> >> There're some ideas (and 8051 code) for that on [1], but I'd
> 
> >> like to know if there could be any better techniques.
> 
> >>
> 
> >> TIA.
> 
> >>
> 
> >> [1] http://www.pjrc.com/tech/8051/autobaud.html
> 
> >>
> 
> >> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
> 
> >> Bus Pirate clone.  The good news is that the parts for this one
> 
> >> will likely cost under $10... (connectors included.)
> 
> >>
> 
> 
> 
> Pefectly possible...you just have to write the software....

someone beat you to it...

http://blog.hodgepig.org/busninja/

[toc] | [prev] | [next] | [standalone]


#10738 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

Fromupsidedown@downunder.com
Date2012-12-09 17:45 +0200
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<v1b9c8d9tvv7aj506fi6nf1t33bpn4idl6@4ax.com>
In reply to#10731
On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:

>
>I am so "pissed" about RS-232/EIA-232.
>
>After so many years with that "stupid vintage" serial communications 
>protocol, we still do not have autonegotiation (and auto-baud-detection) 
>built into the protocol definitions. Why not?

RS-232 originally only specified, how a DCE (Data Communication
Equipment, i.e. a modem) should be connected over a short distance (up
to 15 m) to a DTE (Data Terminal Equipment) either a central computer
or a remote terminal. Thus it made possible to use remote terminals
(DTE to DCE) over a communication channel e.g. (leased) phone line to
central computer (DCE to DTE).

The standard specifies the voltage levels and abstract  CCITT signal
numbers as more familiar signal names. The original standard did not
specify the DB25 connector or pin numbering.

However, the specification includes secondary channel, clock signals
(for synchronous communication) etc. 

Later on the standard was "misused" to directly connect terminals to a
computer locally and various modem eliminators (null modems)  to skip
the DCE-phone_line-DCE part of the remote circuit. In the simplest
case, just cross connect TxD and Rxd, however, various tricks are
needed to fool handshakes. For interfacing two synchronous devices,
some electronics is actually needed in the "null modem".

The problem was that each manufacturer "misused" the DTE-DCE standard
_differently_ causing problems for "null modems" for direct DTE to DTE
connections !!

It should once more be stressed that the RS-232 standard was not
originally designed for direct terminal to computer interfacing. 

Much simpler systems existed for local terminal to computer
interfacing, such as 20 mA current loop. In a mechanical Teletype, the
only semiconductors were the rectifier diodes in the power supply
(24-60 V) and a big power transistor to generate the 20 mA current
source. A Teletype with RS-232 interface required at least an
additional +/-12 V power supply and at least two ICs (e.g. 1488/1489)
or a lot of discrete components before those chips were available.

[toc] | [prev] | [next] | [standalone]


#10744 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

FromPaul <paul@pcserviceselectronics.co.uk>
Date2012-12-09 21:30 +0000
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<MPG.2b2f13686ff8b1b6989743@172.16.0.1>
In reply to#10738
In article <v1b9c8d9tvv7aj506fi6nf1t33bpn4idl6@4ax.com>, 
upsidedown@downunder.com says...
> 
> On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:
> 
> >
> >I am so "pissed" about RS-232/EIA-232.
> >
> >After so many years with that "stupid vintage" serial communications 
> >protocol, we still do not have autonegotiation (and auto-baud-detection) 
> >built into the protocol definitions. Why not?
> 
> RS-232 originally only specified, how a DCE (Data Communication
> Equipment, i.e. a modem) should be connected over a short distance (up
> to 15 m) to a DTE (Data Terminal Equipment) either a central computer
> or a remote terminal. Thus it made possible to use remote terminals
> (DTE to DCE) over a communication channel e.g. (leased) phone line to
> central computer (DCE to DTE).

Actually RS232 specifies signal levels the cable length urban myth is a 
common misreading of RS232A and RS232B, where it said that if configured 
using a very capacative cable with lots of adjacent signals the noise 
level went up at 15m. However the noise level never went across a noise 
margin to cause problems.

I have seen RS232 driven down 1km of bell wire and function correctly.

The DTE/DCE comes from CCIT V24 (Now part of ITU in particular ITU-T) is
a telecoms standard particularly for modems and working out what was an
end point and a mid-point (modem). This is what originally specified the
DB25 and the signal naming.

> The standard specifies the voltage levels and abstract  CCITT signal
> numbers as more familiar signal names. The original standard did not
> specify the DB25 connector or pin numbering.

The abstract CCITT numbers are CCITT V24 refernce not RS232 until about 
RS232 Rev D.
 

-- 
Paul Carpenter          | paul@pcserviceselectronics.co.uk
<http://www.pcserviceselectronics.co.uk/>    PC Services
<http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font
<http://www.gnuh8.org.uk/>  GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
<http://www.badweb.org.uk/> For those web sites you hate

[toc] | [prev] | [next] | [standalone]


#10741 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

FromJohn Larkin <jjlarkin@highNOTlandTHIStechnologyPART.com>
Date2012-12-09 09:02 -0800
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<9ug9c85ljdobcg816vlghe6e018sflpsss@4ax.com>
In reply to#10731
On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:

>On 07/12/12 15.17, Ivan Shmakov wrote:
>> 	BTW, is there an easy way to autodetect the baud rate while
>> 	using an AVR UART?  (Preferably something that works with
>> 	ATmega8, given that those MCU's are such a cheap thing
>> 	nowadays.)
>>
>> 	There're some ideas (and 8051 code) for that on [1], but I'd
>> 	like to know if there could be any better techniques.
>>
>> 	TIA.
>>
>> [1] http://www.pjrc.com/tech/8051/autobaud.html
>>
>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
>> 	Bus Pirate clone.  The good news is that the parts for this one
>> 	will likely cost under $10... (connectors included.)
>>
>
>(Please respond to news://comp.arch.embedded )
>
>Hi!
>
>I am so "pissed" about RS-232/EIA-232.
>
>After so many years with that "stupid vintage" serial communications 
>protocol, we still do not have autonegotiation (and auto-baud-detection) 
>built into the protocol definitions. Why not?

RS232 doesn't have a protocol definition. And it never will.


-- 

John Larkin                  Highland Technology Inc
www.highlandtechnology.com   jlarkin at highlandtechnology dot com   

Precision electronic instrumentation
Picosecond-resolution Digital Delay and Pulse generators
Custom timing and laser controllers
Photonics and fiberoptic TTL data links
VME  analog, thermocouple, LVDT, synchro, tachometer
Multichannel arbitrary waveform generators

[toc] | [prev] | [next] | [standalone]


#10742 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

FromLanarcam <lanarcam1@yahoo.fr>
Date2012-12-09 18:13 +0100
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<50c4c6ba$0$16503$426a34cc@news.free.fr>
In reply to#10741
Le 09/12/2012 18:02, John Larkin a écrit :
> On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:
>
>> On 07/12/12 15.17, Ivan Shmakov wrote:
>>> 	BTW, is there an easy way to autodetect the baud rate while
>>> 	using an AVR UART?  (Preferably something that works with
>>> 	ATmega8, given that those MCU's are such a cheap thing
>>> 	nowadays.)
>>>
>>> 	There're some ideas (and 8051 code) for that on [1], but I'd
>>> 	like to know if there could be any better techniques.
>>>
>>> 	TIA.
>>>
>>> [1] http://www.pjrc.com/tech/8051/autobaud.html
>>>
>>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
>>> 	Bus Pirate clone.  The good news is that the parts for this one
>>> 	will likely cost under $10... (connectors included.)
>>>
>>
>> (Please respond to news://comp.arch.embedded )
>>
>> Hi!
>>
>> I am so "pissed" about RS-232/EIA-232.
>>
>> After so many years with that "stupid vintage" serial communications
>> protocol, we still do not have autonegotiation (and auto-baud-detection)
>> built into the protocol definitions. Why not?
>
> RS232 doesn't have a protocol definition. And it never will.
>
There is a "protocol" in that RTS must be followed by CTS and so on.

Apart from that, there are a lot of embedded systems that
don't need "fancy" features. When the data rate is fixed
there is no need for autodetection. It adds cost, complexity,
rampant bugs, all sorts of nastiness.

A good design is the least complexity to achieve maximum safety
and compliance, not a host of sophisticated features that
are used for no good reason, only because it is trendy.

Of course, in some cases, you need sophistication, but then,
by all means, one should use another protocol.

[toc] | [prev] | [next] | [standalone]


#10743 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

Fromupsidedown@downunder.com
Date2012-12-09 19:44 +0200
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<gqi9c8ptnmc1ifm44t9s0son8g5b4aubnr@4ax.com>
In reply to#10742
On Sun, 09 Dec 2012 18:13:30 +0100, Lanarcam <lanarcam1@yahoo.fr>
wrote:

>Le 09/12/2012 18:02, John Larkin a écrit :
>> On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:
>>
>>> On 07/12/12 15.17, Ivan Shmakov wrote:
>>>> 	BTW, is there an easy way to autodetect the baud rate while
>>>> 	using an AVR UART?  (Preferably something that works with
>>>> 	ATmega8, given that those MCU's are such a cheap thing
>>>> 	nowadays.)
>>>>
>>>> 	There're some ideas (and 8051 code) for that on [1], but I'd
>>>> 	like to know if there could be any better techniques.
>>>>
>>>> 	TIA.
>>>>
>>>> [1] http://www.pjrc.com/tech/8051/autobaud.html
>>>>
>>>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
>>>> 	Bus Pirate clone.  The good news is that the parts for this one
>>>> 	will likely cost under $10... (connectors included.)
>>>>
>>>
>>> (Please respond to news://comp.arch.embedded )
>>>
>>> Hi!
>>>
>>> I am so "pissed" about RS-232/EIA-232.
>>>
>>> After so many years with that "stupid vintage" serial communications
>>> protocol, we still do not have autonegotiation (and auto-baud-detection)
>>> built into the protocol definitions. Why not?
>>
>> RS232 doesn't have a protocol definition. And it never will.
>>
>There is a "protocol" in that RTS must be followed by CTS and so on.

There are quite  lot of handshaking in the DTE-DCE connection.

Typically the DTE computer/terminal sets the DTR (Data terminal Ready)
when it is powered up. The modem (DCE) sets the DSR (Data Set Ready)
when it is powered up and ready to communicate (telephone contact
established). Until both DTR and DSR are on, there is not much point
of trying to communicate.

In half duplex (radio)communication world, rising RTS is an indication
that this station wants to transmit. For a radio link, this might
include listening to the radio channel if the radio channel is free
and if so, turn on the radio transmitter and wait until the PLL is
stabilized, before turning on the actual radio transmitter, after
which the CTS is raised and the actual message transmission can begin.

Those signals are there or a reason, not to make it harder to
interface ordinary devices.

[toc] | [prev] | [next] | [standalone]


#10745 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

FromPaul <paul@pcserviceselectronics.co.uk>
Date2012-12-09 21:32 +0000
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<MPG.2b2f13d6918ea62b989744@172.16.0.1>
In reply to#10742
In article <50c4c6ba$0$16503$426a34cc@news.free.fr>, lanarcam1@yahoo.fr 
says...
> 
> Le 09/12/2012 18:02, John Larkin a écrit :
> > On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:
> >
> >> On 07/12/12 15.17, Ivan Shmakov wrote:
> >>> 	BTW, is there an easy way to autodetect the baud rate while
> >>> 	using an AVR UART?  (Preferably something that works with
> >>> 	ATmega8, given that those MCU's are such a cheap thing
> >>> 	nowadays.)
> >>>
> >>> 	There're some ideas (and 8051 code) for that on [1], but I'd
> >>> 	like to know if there could be any better techniques.
> >>>
> >>> 	TIA.
> >>>
> >>> [1] http://www.pjrc.com/tech/8051/autobaud.html
> >>>
> >>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
> >>> 	Bus Pirate clone.  The good news is that the parts for this one
> >>> 	will likely cost under $10... (connectors included.)
> >>>
> >>
> >> (Please respond to news://comp.arch.embedded )
> >>
> >> Hi!
> >>
> >> I am so "pissed" about RS-232/EIA-232.
> >>
> >> After so many years with that "stupid vintage" serial communications
> >> protocol, we still do not have autonegotiation (and auto-baud-detection)
> >> built into the protocol definitions. Why not?
> >
> > RS232 doesn't have a protocol definition. And it never will.
> >
> There is a "protocol" in that RTS must be followed by CTS and so on.

That is CCITT V24 and actually does not specify RS232 only actually
could be used with all sorts of signalling levels and connectors.


-- 
Paul Carpenter          | paul@pcserviceselectronics.co.uk
<http://www.pcserviceselectronics.co.uk/>    PC Services
<http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font
<http://www.gnuh8.org.uk/>  GNU H8 - compiler & Renesas H8/H8S/H8 Tiny
<http://www.badweb.org.uk/> For those web sites you hate

[toc] | [prev] | [next] | [standalone]


#10747 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-12-10 00:35 -0600
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<unvac81oa1qeptg8ug4oqqt8644fi7jukv@4ax.com>
In reply to#10731
On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:

>On 07/12/12 15.17, Ivan Shmakov wrote:
>> 	BTW, is there an easy way to autodetect the baud rate while
>> 	using an AVR UART?  (Preferably something that works with
>> 	ATmega8, given that those MCU's are such a cheap thing
>> 	nowadays.)
>>
>> 	There're some ideas (and 8051 code) for that on [1], but I'd
>> 	like to know if there could be any better techniques.
>>
>> 	TIA.
>>
>> [1] http://www.pjrc.com/tech/8051/autobaud.html
>>
>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
>> 	Bus Pirate clone.  The good news is that the parts for this one
>> 	will likely cost under $10... (connectors included.)
>>
>
>(Please respond to news://comp.arch.embedded )
>
>Hi!
>
>I am so "pissed" about RS-232/EIA-232.
>
>After so many years with that "stupid vintage" serial communications 
>protocol, we still do not have autonegotiation (and auto-baud-detection) 
>built into the protocol definitions. Why not?
>
>Why have nobody made a request-for-comment about that, then so many 
>people do not have to bother with a myriad of out-of-bound signals and 
>in-band signal (xon, xoff) manually.
>
>It is simply incredibly, that after so many decades, you manually has to 
>find out, how to get it to work.
>
>Please be inspired to release open and free RFC-definitions now, so that 
>"vintage" serial communication will work smoothly - and with backward 
>compatibility and of cause with auto "null-modem" functionality.
>
>I am looking forward to, that all out-of-bound signals can automatically 
>be mapped by software by a series of signal pertubations and response 
>measurements.
>
>I know I am very demanding, but it ought to be possible? At least the 
>software should detect and notify the user, that a null-modem cable 
>connection is required. But it is a bad compromise.
>
>The communications world (and its users) would be much happier with a 
>full blown software solution.
>
>Let us exterminate 232 jumper boxes. They are the ultimate time eating 
>stupid solution, that shows we have given up finding a better solution:
>http://www.amazon.com/DB25-Female-RS-232-Jumper-Assembly/dp/B000I996EE
>
>Instead we should have a 232 autonegotiation-box/cable, that can be 
>inserted between no-negotiation 232 equipped equipment.
>
>;-)
>
>Glenn
>
>PS: I know that USB exists...


As others have mentioned, RS-232 does not come close to defining the
stuff you want, and you need several layers higher in the stack.  And
heck, not even the signal levels required by RS-232 are particularly
well respected.

But after doing everything you want, you're going to end up with
something largely incompatible with conventional async/serial/RS-232
style connections.  At that point, there's no point - that sort of
serial connection is used *only* because support for it is ubiquitous,
not because it's a particularly good technology.  So if you change it,
it becomes irrelevant.

And in this day and age serial ports are (slowly) dying anyway.  And
once you add all that stuff into your link, you'll be back to
something with complexity similar to that of USB anyway, so why
reinvent it?  And for peripherals, you've been able to get single USB
chip implementations for a buck or two for years now, which are only
minimally more difficult to use than a bare serial port from your
device's CPU.  Or if you don't like that, throw a buck or two Ethernet
port and a TCP/IP stack on the device.

[toc] | [prev] | [next] | [standalone]


#10783 — Re: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]

Fromjosephkk <joseph_barrett@sbcglobal.net>
Date2012-12-12 20:30 -0800
SubjectRe: baud rate autodetection on AVR 8-bit? [ User friendly RS-232/EIA-232 ? ]
Message-ID<58mic8d9nfpnnafdm84je4rv4k981d9nih@4ax.com>
In reply to#10731
On Sun, 09 Dec 2012 10:47:29 +0100, Glenn <glenn2233@gmail.com> wrote:

>On 07/12/12 15.17, Ivan Shmakov wrote:
>> 	BTW, is there an easy way to autodetect the baud rate while
>> 	using an AVR UART?  (Preferably something that works with
>> 	ATmega8, given that those MCU's are such a cheap thing
>> 	nowadays.)
>>
>> 	There're some ideas (and 8051 code) for that on [1], but I'd
>> 	like to know if there could be any better techniques.
>>
>> 	TIA.
>>
>> [1] http://www.pjrc.com/tech/8051/autobaud.html
>>
>> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
>> 	Bus Pirate clone.  The good news is that the parts for this one
>> 	will likely cost under $10... (connectors included.)
>>
>
>(Please respond to news://comp.arch.embedded )
>
>Hi!
>
>I am so "pissed" about RS-232/EIA-232.
>
>After so many years with that "stupid vintage" serial communications 
>protocol, we still do not have autonegotiation (and auto-baud-detection) 
>built into the protocol definitions. Why not?
>
>Why have nobody made a request-for-comment about that, then so many 
>people do not have to bother with a myriad of out-of-bound signals and 
>in-band signal (xon, xoff) manually.
>
>It is simply incredibly, that after so many decades, you manually has to 
>find out, how to get it to work.
>
>Please be inspired to release open and free RFC-definitions now, so that 
>"vintage" serial communication will work smoothly - and with backward 
>compatibility and of cause with auto "null-modem" functionality.
>
>I am looking forward to, that all out-of-bound signals can automatically 
>be mapped by software by a series of signal pertubations and response 
>measurements.
>
>I know I am very demanding, but it ought to be possible? At least the 
>software should detect and notify the user, that a null-modem cable 
>connection is required. But it is a bad compromise.
>
>The communications world (and its users) would be much happier with a 
>full blown software solution.
>
>Let us exterminate 232 jumper boxes. They are the ultimate time eating 
>stupid solution, that shows we have given up finding a better solution:
>http://www.amazon.com/DB25-Female-RS-232-Jumper-Assembly/dp/B000I996EE
>
>Instead we should have a 232 autonegotiation-box/cable, that can be 
>inserted between no-negotiation 232 equipped equipment.
>
>;-)
>
>Glenn
>
>PS: I know that USB exists...

I have two things to say to you:

Get a copy of the standard and study it, it has been TIA-232 for over 15
years now.

The widget sounds like a great idea, go ahead and make it and sell it, see
where it gets you.  Be sure to cover all of the off specification
implementations out there.

Bye.

?-)

[toc] | [prev] | [next] | [standalone]


#10750

From"Meindert Sprang" <ms@NOJUNKcustomORSPAMware.nl>
Date2012-12-10 13:38 +0100
Message-ID<50c5d9e9$0$6944$e4fe514c@news2.news.xs4all.nl>
In reply to#10716
"Ivan Shmakov" <oneingray@gmail.com> wrote in message
news:86sj7iuetv.fsf@gray.siamics.net...
> BTW, is there an easy way to autodetect the baud rate while
> using an AVR UART?  (Preferably something that works with
> ATmega8, given that those MCU's are such a cheap thing
> nowadays.)
>
> There're some ideas (and 8051 code) for that on [1], but I'd
> like to know if there could be any better techniques.
>

Here's how I've done it in a commercial product that has to support
auto-baud between 4800 and 57600 Baud on a fixed 8N1 format:

Check the framing error bit in the receive interrupt handler. After 20
framing errors, switch to the next baud rate and reset the framing counter.

Works like a charm.

Meindert

[toc] | [prev] | [next] | [standalone]


#10751

FromIvan Shmakov <oneingray@gmail.com>
Date2012-12-10 20:19 +0700
Message-ID<8638zerqmq.fsf@gray.siamics.net>
In reply to#10750
>>>>> Meindert Sprang <ms@NOJUNKcustomORSPAMware.nl> writes:
>>>>> "Ivan Shmakov" <oneingray@gmail.com> wrote in...

 >> BTW, is there an easy way to autodetect the baud rate while using an
 >> AVR UART?  (Preferably something that works with ATmega8, given that
 >> those MCU's are such a cheap thing nowadays.)

[...]

 > Here's how I've done it in a commercial product that has to support
 > auto-baud between 4800 and 57600 Baud on a fixed 8N1 format:

 > Check the framing error bit in the receive interrupt handler.  After
 > 20 framing errors, switch to the next baud rate and reset the framing
 > counter.

 > Works like a charm.

	Doesn't it mean that the host has to transmit considerable
	amount of data for the device to adapt to the baud rate used?
	Given the possibility of "interactive" use, such a delay doesn't
	seem all that reasonable.

	Might work as a last resort, however.

-- 
FSF associate member #7257

[toc] | [prev] | [next] | [standalone]


#10752

From"Meindert Sprang" <ms@NOJUNKcustomORSPAMware.nl>
Date2012-12-10 16:24 +0100
Message-ID<50c600e0$0$6902$e4fe514c@news2.news.xs4all.nl>
In reply to#10751
"Ivan Shmakov" <oneingray@gmail.com> wrote in message
news:8638zerqmq.fsf@gray.siamics.net...
> >>>>> Meindert Sprang <ms@NOJUNKcustomORSPAMware.nl> writes:
>  > Here's how I've done it in a commercial product that has to support
>  > auto-baud between 4800 and 57600 Baud on a fixed 8N1 format:
>
>  > Check the framing error bit in the receive interrupt handler.  After
>  > 20 framing errors, switch to the next baud rate and reset the framing
>  > counter.
>
>  > Works like a charm.
>
> Doesn't it mean that the host has to transmit considerable
> amount of data for the device to adapt to the baud rate used?
> Given the possibility of "interactive" use, such a delay doesn't
> seem all that reasonable.

It takes some time indeed. But in my application (receiving a constant data
stream from navigation instruments), this is no problem.

Meindert

[toc] | [prev] | [next] | [standalone]


#10753

FromArlet Ottens <usenet+5@c-scape.nl>
Date2012-12-10 16:49 +0100
Message-ID<50c604a5$0$6890$e4fe514c@news2.news.xs4all.nl>
In reply to#10752
On 12/10/2012 04:24 PM, Meindert Sprang wrote:

>>   > Here's how I've done it in a commercial product that has to support
>>   > auto-baud between 4800 and 57600 Baud on a fixed 8N1 format:
>>
>>   > Check the framing error bit in the receive interrupt handler.  After
>>   > 20 framing errors, switch to the next baud rate and reset the framing
>>   > counter.
>>
>>   > Works like a charm.
>>
>> Doesn't it mean that the host has to transmit considerable
>> amount of data for the device to adapt to the baud rate used?
>> Given the possibility of "interactive" use, such a delay doesn't
>> seem all that reasonable.
>
> It takes some time indeed. But in my application (receiving a constant data
> stream from navigation instruments), this is no problem.

The time could be improved by keeping track of both well received data, 
and framing errors. At first, you could try a new baud rate after 2 or 3 
framing errors, but as soon as you receive a couple of good chars, 
increase the tolerance for further framing errors.

To improve detection time, save a good baudrate in non-volatile memory 
so it can be used as the first guess when the device powers up again.



[toc] | [prev] | [next] | [standalone]


#10766

FromRich Webb <bbew.ar@mapson.nozirev.ten>
Date2012-12-12 08:50 -0500
Message-ID<te2hc8tc9t92m3ktfecqnde5p4c9b16q3b@4ax.com>
In reply to#10752
On Mon, 10 Dec 2012 16:24:46 +0100, "Meindert Sprang"
<ms@NOJUNKcustomORSPAMware.nl> wrote:

>"Ivan Shmakov" <oneingray@gmail.com> wrote in message
>news:8638zerqmq.fsf@gray.siamics.net...
>> >>>>> Meindert Sprang <ms@NOJUNKcustomORSPAMware.nl> writes:
>>  > Here's how I've done it in a commercial product that has to support
>>  > auto-baud between 4800 and 57600 Baud on a fixed 8N1 format:
>>
>>  > Check the framing error bit in the receive interrupt handler.  After
>>  > 20 framing errors, switch to the next baud rate and reset the framing
>>  > counter.
>>
>>  > Works like a charm.
>>
>> Doesn't it mean that the host has to transmit considerable
>> amount of data for the device to adapt to the baud rate used?
>> Given the possibility of "interactive" use, such a delay doesn't
>> seem all that reasonable.
>
>It takes some time indeed. But in my application (receiving a constant data
>stream from navigation instruments), this is no problem.

Here https://www.dropbox.com/s/tslyhurkxpnri32/BaudRateDetermination.pdf
is an example of watching the pulse widths to infer the baud rate. It
decides on the rate by the end of the NMEA identifier field, leaving the
rest of that sentence available for sanity checks (framing errors,
reasonable character set, etc.). There are certainly other approaches
but I've been pretty successful with this.

-- 
Rich Webb     Norfolk, VA

[toc] | [prev] | [next] | [standalone]


#10760

Fromj.m.granville@gmail.com
Date2012-12-11 21:22 -0800
Message-ID<3869a899-b923-435c-9d7e-b03cc7a184ad@googlegroups.com>
In reply to#10716
On Saturday, December 8, 2012 3:17:16 AM UTC+13, Ivan Shmakov wrote:
> BTW, is there an easy way to autodetect the baud rate while
> using an AVR UART? 

Most AutoBaud designs also send a known character to calibrate, and a pause.

 If you want to auto-detect on random data, that is more complex, and you will (usually) discard info while you are deciding. Then, even if your hardware is smart enough to quickly lock onto a bit-time, you next have to decide which is actually the Start bit...

 So there is no magic solution, but you can make systems that behave in a known way, reliable.

 Another approach is to start a baud dialog at a known low speed, and then exchange information about mutually supported higher rates, and then switch to that. 
 If you want highest speeds, and widest clock-choice tolerance, that is the best approach.





> PS.  It seems that I'm slowly drifting into designing my own, AVR-based
> 	Bus Pirate clone.  The good news is that the parts for this one
> 	will likely cost under $10... (connectors included.)

 Just to reality check that aspiration, I see Bus Pirate have moved to use a 256K Flash device.

["We didn't want to run out of space again soon, so we used a PIC 24FJ256GB106 with 256K of space."]

So you might want to look at the ATXmega parts, as they have some good prices on smaller USB models.

-jg

[toc] | [prev] | [next] | [standalone]


#10761

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-12-12 00:29 -0600
Message-ID<nh8gc81516b289uhcdla34qrm3d1dhmsd0@4ax.com>
In reply to#10760
On Tue, 11 Dec 2012 21:22:45 -0800 (PST), j.m.granville@gmail.com
wrote:

>On Saturday, December 8, 2012 3:17:16 AM UTC+13, Ivan Shmakov wrote:
>> BTW, is there an easy way to autodetect the baud rate while
>> using an AVR UART? 
>
>Most AutoBaud designs also send a known character to calibrate, and a pause.
>
> If you want to auto-detect on random data, that is more complex, and you will (usually) discard info while you are deciding. Then, even if your hardware is smart enough to quickly lock onto a bit-time, you next have to decide which is actually the Start bit...
>
> So there is no magic solution, but you can make systems that behave in a known way, reliable.


It's impossible to make baud autodetection 100% reliable without the
cooperation of the sender.  Consider that at 8-N-1, the single byte
0xB5 is indistinguishable from the pair 0x67, 0x67 at double the baud
rate.  Hardly the only such example, just a handy one.  For a simple
doubling of the baud rate at 8-N-1, an indistinguishable pair of bytes
exists at the higher baud rate for any byte where the fourth bit (from
the high end) is one and the fifth is zero at the lower baud rate.

[toc] | [prev] | [next] | [standalone]


#10762

FromMark Borgerson <mborgerson@comcast.net>
Date2012-12-11 23:43 -0800
Message-ID<MPG.2b31d59a33ff00659899af@news.eternal-september.org>
In reply to#10761
In article <nh8gc81516b289uhcdla34qrm3d1dhmsd0@4ax.com>, robertwessel2
@yahoo.com says...
> 
> On Tue, 11 Dec 2012 21:22:45 -0800 (PST), j.m.granville@gmail.com
> wrote:
> 
> >On Saturday, December 8, 2012 3:17:16 AM UTC+13, Ivan Shmakov wrote:
> >> BTW, is there an easy way to autodetect the baud rate while
> >> using an AVR UART? 
> >
> >Most AutoBaud designs also send a known character to calibrate, and a pause.
> >
> > If you want to auto-detect on random data, that is more complex, and you will (usually) discard info while you are deciding. Then, even if your hardware is smart enough to quickly lock onto a bit-time, you next have to decide which is actually the Start bit...
> >
> > So there is no magic solution, but you can make systems that behave in a known way, reliable.
> 
> 
> It's impossible to make baud autodetection 100% reliable without the
> cooperation of the sender.  Consider that at 8-N-1, the single byte
> 0xB5 is indistinguishable from the pair 0x67, 0x67 at double the baud
> rate.  Hardly the only such example, just a handy one.  For a simple
> doubling of the baud rate at 8-N-1, an indistinguishable pair of bytes
> exists at the higher baud rate for any byte where the fourth bit (from
> the high end) is one and the fifth is zero at the lower baud rate.

I think that's true if you define " without cooperation"  to mean that 
the receiver has absolutely no prior knowledge of the message from
the sender and the data stream is continuous with no significant
inter-character intervals.  If you know that the data is ASCII
text in a given language, you probably have enough  data to get
the baud rate correct, given a large enough sample size.

It the data stream is encrypted  binary data in a continuous 
stream, you've got more to worry about than just the baud rate!

Mark Borgerson

[toc] | [prev] | [next] | [standalone]


#10763

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-12-12 02:38 -0600
Message-ID<rufgc89c170lh0o16ddk022rrsrhgq5qtd@4ax.com>
In reply to#10762
On Tue, 11 Dec 2012 23:43:54 -0800, Mark Borgerson
<mborgerson@comcast.net> wrote:

>In article <nh8gc81516b289uhcdla34qrm3d1dhmsd0@4ax.com>, robertwessel2
>@yahoo.com says...
>> 
>> On Tue, 11 Dec 2012 21:22:45 -0800 (PST), j.m.granville@gmail.com
>> wrote:
>> 
>> >On Saturday, December 8, 2012 3:17:16 AM UTC+13, Ivan Shmakov wrote:
>> >> BTW, is there an easy way to autodetect the baud rate while
>> >> using an AVR UART? 
>> >
>> >Most AutoBaud designs also send a known character to calibrate, and a pause.
>> >
>> > If you want to auto-detect on random data, that is more complex, and you will (usually) discard info while you are deciding. Then, even if your hardware is smart enough to quickly lock onto a bit-time, you next have to decide which is actually the Start bit...
>> >
>> > So there is no magic solution, but you can make systems that behave in a known way, reliable.
>> 
>> 
>> It's impossible to make baud autodetection 100% reliable without the
>> cooperation of the sender.  Consider that at 8-N-1, the single byte
>> 0xB5 is indistinguishable from the pair 0x67, 0x67 at double the baud
>> rate.  Hardly the only such example, just a handy one.  For a simple
>> doubling of the baud rate at 8-N-1, an indistinguishable pair of bytes
>> exists at the higher baud rate for any byte where the fourth bit (from
>> the high end) is one and the fifth is zero at the lower baud rate.
>
>I think that's true if you define " without cooperation"  to mean that 
>the receiver has absolutely no prior knowledge of the message from
>the sender and the data stream is continuous with no significant
>inter-character intervals.  If you know that the data is ASCII
>text in a given language, you probably have enough  data to get
>the baud rate correct, given a large enough sample size.
>
>It the data stream is encrypted  binary data in a continuous 
>stream, you've got more to worry about than just the baud rate!


I'd consider sending a known (or at least constrained) stream to be
cooperation.  Obviously the tighter the constraints, the more quickly
you can get to a required confidence level in your baud rate
detection.

As for inter-character gaps - it depends on the speeds and characters
in question - so long as the low speed characters meet the xxx10xxx
format requirement, then the double speed stream simply looks like two
immediately adjacent characters, and gaps between individual low speed
characters are just gaps between high speed pairs.

My point was more that automatic baud rate detection is a hack, albeit
a useful one in some circumstances, although it will always have
limits.  And frankly the use of RS-232/async ports should not be a
first choice these days.

[toc] | [prev] | [next] | [standalone]


Page 2 of 6 — ← Prev page 1 [2] 3 4 5 6  Next page →

Back to top | Article view | comp.arch.embedded


csiph-web