Two or more serial ports
2005-07-31 by jdelgadillo66
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2005-07-31 by jdelgadillo66
Im working in a project with atemega8 and atemega32, for this work is necessary 3 serial ports, and I cant loose any data, but what happen if two or more ports have incoming data at the same time?, what can I do?, other question is what is the adventage for use usart hardware or usart software?. Regards, Jaime Delgadillo
2005-08-01 by David VanHorn
Im working in a project with atemega8 and atemega32, for this work is necessary 3 serial ports, and I cant loose any data, but what happen if two or more ports have incoming data at the same time?, what can I do?, other question is what is the adventage for use usart hardware or usart software?. Sounds like a good case for using interrupts. Software uarts require a fair bit of software overhead to run, but if you need three uarts, you're pretty much stuck with that. OTOH, I seem to remember a data sheet for an AVR with four hardware uarts.
2005-08-01 by Ralph Hilton
On Sun, 31 Jul 2005 22:04:25 -0000 you wrote: >Im working in a project with atemega8 and atemega32, for this work is >necessary 3 serial ports, and I cant loose any data, but what happen if >two or more ports have incoming data at the same time?, what can I do?, Can you use a mega162 to replace one of the chips? That has 2 hardware USARTs. -- Ralph Hilton http://www.ralphhilton.org C-Meter: http://www.cmeter.org FZAOINT http://www.fzaoint.net
2005-08-01 by Paul Maddox
Why not use the MEGA162 to be the TWO serial ports and use 2/1wire communication between the 162 and the mega8/32 ? paul ----- Original Message -----
From: "Ralph Hilton" <ralph@ralphhilton.org> To: <AVR-Chat@yahoogroups.com> Sent: Monday, August 01, 2005 1:40 PM Subject: Re: [AVR-Chat] Two or more serial ports > On Sun, 31 Jul 2005 22:04:25 -0000 you wrote: > >>Im working in a project with atemega8 and atemega32, for this work is >>necessary 3 serial ports, and I cant loose any data, but what happen if >>two or more ports have incoming data at the same time?, what can I do?, > > Can you use a mega162 to replace one of the chips? That has 2 hardware > USARTs. > -- > Ralph Hilton > http://www.ralphhilton.org > C-Meter: http://www.cmeter.org > FZAOINT http://www.fzaoint.net > > > > > Yahoo! Groups Links > > > > > > > >
2005-08-01 by David Kelly
On Sun, Jul 31, 2005 at 10:04:25PM -0000, jdelgadillo66 wrote: > Im working in a project with atemega8 and atemega32, for this work is > necessary 3 serial ports, and I cant loose any data, but what happen if > two or more ports have incoming data at the same time?, what can I do?, As others have said, assign the hardware UART to interrupt service routines. Do nothing in IRQ other than copy data to/from circular buffers. Then you will not loose data so long as the IRQ is not blocked longer than one character time. You have at least the duration of the current incoming character to get the previous character out of the FIFO. Some hardware UARTs have deeper FIFOs. Then you have to process the characters in the circular buffer outside of IRQ fast enough to prevent your buffer from overflowing. > other question is what is the adventage for use usart hardware or > usart software?. In software one must IRQ (or sample) at least once per bit, and the exact timing of the IRQ service routines becomes critical. Software UARTs require a fair amount of timer resources. In general one does not use software UART unless painted into a corner and the issue forced. Then again if one knows plenty of CPU and timer resources are available then a soft UART may result in lower cost. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.
2005-08-01 by Larry Barello
Try the MAX3110E spi uart. Makes it simple to add as many real hardware uarts as you need to any project. Or, check out http://www.atmel.com/dyn/resources/prod_documents/doc2557.pdf and just add as many mega8's as you need serial ports to your project. It is probably cheaper than the MAX part... -----Original Message----- From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Paul Maddox Sent: Monday, August 01, 2005 6:10 AM To: AVR-Chat@yahoogroups.com Subject: Re: [AVR-Chat] Two or more serial ports Why not use the MEGA162 to be the TWO serial ports and use 2/1wire communication between the 162 and the mega8/32 ? paul ----- Original Message -----
From: "Ralph Hilton" <ralph@ralphhilton.org> To: <AVR-Chat@yahoogroups.com> Sent: Monday, August 01, 2005 1:40 PM Subject: Re: [AVR-Chat] Two or more serial ports > On Sun, 31 Jul 2005 22:04:25 -0000 you wrote: > >>Im working in a project with atemega8 and atemega32, for this work is >>necessary 3 serial ports, and I cant loose any data, but what happen if >>two or more ports have incoming data at the same time?, what can I do?, > > Can you use a mega162 to replace one of the chips? That has 2 hardware > USARTs. > --
2005-08-01 by David VanHorn
Try the MAX3110E spi uart. Makes it simple to add as many real hardware uarts as you need to any project. Or, check out http://www.atmel.com/dyn/resources/prod_documents/doc2557.pdf and just add as many mega8's as you need serial ports to your project. It is probably cheaper than the MAX part... Having used the maxim chip, I'd go for option B. There are some tricks to the max chip that are a bit non-obvious that you don't have to put up with using AVRs, and you can also probably export some of the application's "smarts" to them, and offload from the main processor.
2005-08-02 by Don Ingram
Ditto on this! The overhead & cost of the Max31xx family was overtaken by the advantages of using another AVR. It was cheaper, could be put to sleep, could offload packet processing etc. More importantly it could do anything that we dreampt up at a later date. By using it as a comms processor it kept a lot of byte interrupts away from the main processor and only sent valid packet interrupts, a bit the way that CAN does. Cheers Don Larry Barello wrote:
> Try the MAX3110E spi uart. Makes it simple to add as many real hardware > uarts as you need to any project. > > Or, check out http://www.atmel.com/dyn/resources/prod_documents/doc2557.pdf > and just add as many mega8's as you need serial ports to your project. It > is probably cheaper than the MAX part... > > -----Original Message----- > From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf > Of Paul Maddox > Sent: Monday, August 01, 2005 6:10 AM > To: AVR-Chat@yahoogroups.com > Subject: Re: [AVR-Chat] Two or more serial ports > > Why not use the MEGA162 to be the TWO serial ports and use 2/1wire > communication between the 162 and the mega8/32 ? > > paul > > > > ----- Original Message ----- > From: "Ralph Hilton" <ralph@ralphhilton.org> > To: <AVR-Chat@yahoogroups.com> > Sent: Monday, August 01, 2005 1:40 PM > Subject: Re: [AVR-Chat] Two or more serial ports > > > >>On Sun, 31 Jul 2005 22:04:25 -0000 you wrote: >> >> >>>Im working in a project with atemega8 and atemega32, for this work is >>>necessary 3 serial ports, and I cant loose any data, but what happen if >>>two or more ports have incoming data at the same time?, what can I do?, >> >>Can you use a mega162 to replace one of the chips? That has 2 hardware >>USARTs. >>-- > > >