EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

baud rate autodetection on AVR 8-bit?

Started by Ivan Shmakov December 7, 2012
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. ?-)
On Wed, 12 Dec 2012 12:43:37 -0800, Mark Borgerson <mborgerson@comcast.net> wrote:
> In article <a643e02a-fa5f-41de-a83e-5bb572f2e0c7 > @i7g2000pbf.googlegroups.com>, me@linnix.info-for.us says... >> >> On Dec 12, 7:46&nbsp;am, Mark Borgerson <mborger...@comcast.net> wrote: >> > In article <rufgc89c170lh0o16ddk022rrsrhgq5...@4ax.com>, robertwessel2 >> > @yahoo.com says... >> > >><<SNIP>> >> > I still find them useful when connecting to oceanographic instruments. >> > I have been able to get full-speed usb (12mb) through a pair of >> > waterproof connectors, despite the impedance problems. &nbsp;I haven't >> > yet tried to get USB through the connector and 20meters from the >> > deck to the dry lab on a research vessel. &nbsp;I've also tried >> > Zigbee radios, but they run into problems with aluminum pressure >> > cases and deckhouses.
[...]
> It's also more than a hole---it's an underwater bulkhead > connector that costs about $100 and has to hold pressures > up to 5000PSI. That last requirement is a step above > "waterproof". Next there's the problem of getting the > signals through the aluminum or steel bulkheads and > watertight doors.
Mark, Apologies for the diversion from your subject, but you have brought up a topic I have been curious about for some time. Is it easier/cheaper to design and build a through-bulhead connector capable of withstanding (say) 5000psi than (say) an optical or magnetic port through the same bulkhead? All three approaches can pass data, but only the throug-bulkhead connector can pass power. Is that the major criteria? That is, your application requires more power than can be aeasily be supplied through batteries? Os is there something else involved? Jes' curious... Frank -- Perhaps the greatest mystery of the Cold War is why the Worker's Paradise could not manage to produce a decent pair of jeans. -- Niall Ferguson / Civilization: The West and the Rest -- Frank McKenney, McKenney Associates Richmond, Virginia / (804) 320-4887 Munged E-mail: frank uscore mckenney aatt mindspring ddoott com
On Thu, 13 Dec 2012 10:25:41 -0600, Frnak McKenney
<frnak@far.from.the.madding.crowd.com> wrote:

>On Wed, 12 Dec 2012 12:43:37 -0800, Mark Borgerson <mborgerson@comcast.net> wrote: >> In article <a643e02a-fa5f-41de-a83e-5bb572f2e0c7 >> @i7g2000pbf.googlegroups.com>, me@linnix.info-for.us says... >>> >>> On Dec 12, 7:46&#4294967295;am, Mark Borgerson <mborger...@comcast.net> wrote: >>> > In article <rufgc89c170lh0o16ddk022rrsrhgq5...@4ax.com>, robertwessel2 >>> > @yahoo.com says... >>> > >>><<SNIP>> >>> > I still find them useful when connecting to oceanographic instruments. >>> > I have been able to get full-speed usb (12mb) through a pair of >>> > waterproof connectors, despite the impedance problems. &#4294967295;I haven't >>> > yet tried to get USB through the connector and 20meters from the >>> > deck to the dry lab on a research vessel. &#4294967295;I've also tried >>> > Zigbee radios, but they run into problems with aluminum pressure >>> > cases and deckhouses. > > [...] > >> It's also more than a hole---it's an underwater bulkhead >> connector that costs about $100 and has to hold pressures >> up to 5000PSI. That last requirement is a step above >> "waterproof". Next there's the problem of getting the >> signals through the aluminum or steel bulkheads and >> watertight doors. > >Mark, > >Apologies for the diversion from your subject, but you have brought up >a topic I have been curious about for some time. > >Is it easier/cheaper to design and build a through-bulhead connector >capable of withstanding (say) 5000psi than (say) an optical or >magnetic port through the same bulkhead? > >All three approaches can pass data, but only the throug-bulkhead >connector can pass power. Is that the major criteria? That is, your >application requires more power than can be aeasily be supplied >through batteries? Os is there something else involved? > >Jes' curious...
There *are* techniques to wirelessly move power. They're usually either not terribly convenient, or not good for huge amounts of power. For example, you could simply put a large coil of wire on either side, and run AC through one of those, and you've basically got an inefficient transformer. A project I was peripherally associated with many years ago used a pump with no drive shaft (nasty liquids with very exothermic reactions with each other, so leaks were a bad thing). They used a solid aluminum pump housing, with a rotating magnet on the outside, and a matching magnet attached to the impeller inside (think magnetic stirrer). The entire assembly, along with the piping was welded - no seals, shafts, gaskets, joints or anything else to leak. While that didn't move electrical power, replacing the impeller with a small generator would clearly have been possible. The 5000psi requirement would lead one to guess steel as a primary structural element, which will rather impact your magnetics, so my two examples would be problematic, but here are other approaches. OTOH, a pair of wires solves all of those problem with rather less complexity (and higher efficiency), except for the need to actually run them through the container wall.
In article <VuWdndaS1dcYnFfNnZ2dnUVZ_tudnZ2d@earthlink.com>, 
frnak@far.from.the.madding.crowd.com says...
> > On Wed, 12 Dec 2012 12:43:37 -0800, Mark Borgerson <mborgerson@comcast.net> wrote: > > In article <a643e02a-fa5f-41de-a83e-5bb572f2e0c7 > > @i7g2000pbf.googlegroups.com>, me@linnix.info-for.us says... > >> > >> On Dec 12, 7:46&#4294967295;am, Mark Borgerson <mborger...@comcast.net> wrote: > >> > In article <rufgc89c170lh0o16ddk022rrsrhgq5...@4ax.com>, robertwessel2 > >> > @yahoo.com says... > >> > > >><<SNIP>> > >> > I still find them useful when connecting to oceanographic instruments. > >> > I have been able to get full-speed usb (12mb) through a pair of > >> > waterproof connectors, despite the impedance problems. &#4294967295;I haven't > >> > yet tried to get USB through the connector and 20meters from the > >> > deck to the dry lab on a research vessel. &#4294967295;I've also tried > >> > Zigbee radios, but they run into problems with aluminum pressure > >> > cases and deckhouses. > > [...] > > > It's also more than a hole---it's an underwater bulkhead > > connector that costs about $100 and has to hold pressures > > up to 5000PSI. That last requirement is a step above > > "waterproof". Next there's the problem of getting the > > signals through the aluminum or steel bulkheads and > > watertight doors. > > Mark, > > Apologies for the diversion from your subject, but you have brought up > a topic I have been curious about for some time. > > Is it easier/cheaper to design and build a through-bulhead connector > capable of withstanding (say) 5000psi than (say) an optical or > magnetic port through the same bulkhead?
Optical or magnetic interfaces may work OK at lower pressures, but the mechanical strength to resist 5 to 10KPSI makes the design more difficult. Building an end cap to hold the pressure, but having good data transmission capability can also be expensive. Furthermore, optical and magnetic interfaces may need more power and cost a lot more than an RS-232 interface chip.
> > All three approaches can pass data, but only the throug-bulkhead > connector can pass power. Is that the major criteria? That is, your > application requires more power than can be aeasily be supplied > through batteries? Os is there something else involved? >
Passing power is one criterion. There are systems that can live on internal batteries. We put loggers on moorings on the equator that collect data for 16 channels at up to 100 samples/second. We can use internal lithium primary cells and have enough power to log for a year at about 200MB/day . Those systems only need about 15mA at 7V. Other systems may need 10 or a hundred times that power and collect less data or require external power. We often use a bulkehead connector in place of a power switch. With a dummy plug, power is off. With a plug routing power through the pins, the system is on. Some instrument makers have tried magnetic reed switches, but you lose the ability to power up the instrument when the batteries diea, and upload data through the port by providing power through the port. Oceanographic instrument designers envy those doing designs for space: Nothing grows on their instrument surfaces, the medium isn't corrosive, and they only have to worry about pressure differentials of about 1 atmosphere, and asian fishermen don't tie up to satellites because they think it's an easy way to save fuel. Of course, the space guys do face some other hazards-- micrometeorites, big temperature differentials, etc..
> Jes' curious... >
Mark Borgerson
On Thu, 13 Dec 2012 16:47:38 -0800, Mark Borgerson
<mborgerson@comcast.net> wrote:

><snip> >Oceanographic instrument designers envy those doing designs >for space: Nothing grows on their instrument surfaces, the >medium isn't corrosive, and they only have to worry about >pressure differentials of about 1 atmosphere, and asian fishermen don't >tie up to satellites because they think it's an easy way to save fuel. ><snip>
It's not so nice in space, either. The following is a paper just on one aspect -- the serious problem of satellite charging effects: http://www.dept.aoe.vt.edu/~cdhall/courses/aoe4065/NASADesignSPs/rp1375.pdf Take a look over the long list of satellites and problems. There are other effects, as well, and a "crud" accumulates over time and covers optics, solar panels, and so on in ways that impair function eventually to the point of failure. If otherwise lucky, 30 years is about the most you hope for. Jon
On Thu, 13 Dec 2012 18:22:22 -0800, I wrote:

>http://www.dept.aoe.vt.edu/~cdhall/courses/aoe4065/NASADesignSPs/rp1375.pdf
Here is another: http://arxiv.org/ftp/arxiv/papers/0906/0906.3884.pdf Jon
In article <2n1lc85bcrotcf4t19qcf3m97ikemf6alh@4ax.com>, 
jonk@infinitefactors.org says...
> > On Thu, 13 Dec 2012 16:47:38 -0800, Mark Borgerson > <mborgerson@comcast.net> wrote: > > ><snip> > >Oceanographic instrument designers envy those doing designs > >for space: Nothing grows on their instrument surfaces, the > >medium isn't corrosive, and they only have to worry about > >pressure differentials of about 1 atmosphere, and asian fishermen don't > >tie up to satellites because they think it's an easy way to save fuel. > ><snip> > > It's not so nice in space, either. The following is a paper > just on one aspect -- the serious problem of satellite > charging effects: > > http://www.dept.aoe.vt.edu/~cdhall/courses/aoe4065/NASADesignSPs/rp1375.pdf
I must admit that accumulated charge isn't so much a problem for oceanographic instruments. ;-)
> > Take a look over the long list of satellites and problems. > > There are other effects, as well, and a "crud" accumulates > over time and covers optics, solar panels, and so on in ways > that impair function eventually to the point of failure. > > If otherwise lucky, 30 years is about the most you hope for.
I doubt oceanographers would wait that long for their data. It's tough to get high-bandwidth data back in real time from instruments under 30m of seawater. We're recording 2 to 3Kbytes of data per second continuously. Most anything that can transmit with that bandwidth back from the equator exceeds our power budget. Here's what one of our turbulence sensors looks like after about 6 months to a year on a mooring at the equator: https://dl.dropbox.com/u/24841567/P3120108.JPG The copper probe at the lower left has the fast-response thermistor that is the primary sensor. More stuff at: http://mixing.coas.oregonstate.edu/research/moored_mixing/ Mark Borgerson
On Thu, 13 Dec 2012 12:34:06 -0600, Robert Wessel
<robertwessel2@yahoo.com> wrote:

>>Is it easier/cheaper to design and build a through-bulhead connector >>capable of withstanding (say) 5000psi than (say) an optical or >>magnetic port through the same bulkhead? >> >>All three approaches can pass data, but only the throug-bulkhead >>connector can pass power. Is that the major criteria? That is, your >>application requires more power than can be aeasily be supplied >>through batteries? Os is there something else involved? >> >>Jes' curious... > > >There *are* techniques to wirelessly move power. They're usually >either not terribly convenient, or not good for huge amounts of power. >For example, you could simply put a large coil of wire on either side, >and run AC through one of those, and you've basically got an >inefficient transformer.
Since there are windows on manned vehicles capable of reaching the bottom of the oceans, there should also be other high strength materials for the port hole with suitable dielectric materials to be used with capacitively coupling or near field RF. With a metallic hull, the return current path should be easy to arrange.
In article <17olc8hk2ohoem6ijo7h95fghqnansr8gd@4ax.com>, 
upsidedown@downunder.com says...
> > On Thu, 13 Dec 2012 12:34:06 -0600, Robert Wessel > <robertwessel2@yahoo.com> wrote: > > >>Is it easier/cheaper to design and build a through-bulhead connector > >>capable of withstanding (say) 5000psi than (say) an optical or > >>magnetic port through the same bulkhead? > >> > >>All three approaches can pass data, but only the throug-bulkhead > >>connector can pass power. Is that the major criteria? That is, your > >>application requires more power than can be aeasily be supplied > >>through batteries? Os is there something else involved? > >> > >>Jes' curious... > > > > > >There *are* techniques to wirelessly move power. They're usually > >either not terribly convenient, or not good for huge amounts of power. > >For example, you could simply put a large coil of wire on either side, > >and run AC through one of those, and you've basically got an > >inefficient transformer. > > Since there are windows on manned vehicles capable of reaching the > bottom of the oceans, there should also be other high strength > materials for the port hole with suitable dielectric materials to be > used with capacitively coupling or near field RF. With a metallic > hull, the return current path should be easy to arrange.
Those windows are usually at least 8 inches thick. That's a problem for capacitive coupling. Near-field RF is possible, but probably has a larger power budget and higher cost than a pair of connectors and RS-232 transceiver chips. You don't want to use your pressure case as part of a return path. That's just begging for electrolytic destruction of the pressure case. For shallow pressure cases, we use Delrin plastic. For deeper cases we use aluminum alloys. For the latter, we have to make sure that they are isolated from contact with other metals. Mark Borgerson
>>>>> Robert Wessel <robertwessel2@yahoo.com> writes:
[...] > And frankly the use of RS-232/async ports should not be a first > choice these days. Given the intended application, I tend to agree -- the use of USB would probably simplify the things there a lot. Unfortunately, I'm yet to find a really cheap MCU (8-, 32-, or perhaps even 16-bit) with an on-chip USB. (V-USB doesn't seem to fit well, for its CDC-ACM capability is necessarily a hack.) The best I've found so far are some STM32's for under $4. I'd like to see if there could be anything else at half that price. (Though USB identifiers may become an issue. They provide one allowing for relatively unrestricted use with V-USB, but I don't know what's the current practice for the MCU's with hardware USB ports.) -- FSF associate member #7257

The 2024 Embedded Online Conference