avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] slow communication with usb2serial dongle


From: Joerg Wunsch
Subject: Re: [avrdude-dev] slow communication with usb2serial dongle
Date: Wed, 8 Mar 2006 22:15:22 +0100
User-agent: Mutt/1.4.2.1i

As Marcus Obst wrote:

> I tried to setup a simple serial communication (ponyser) with an
> atmega32.  Since my laptop has no native serial interface I used an
> usb2serial converter (well supported by Linux!).

Ick.

> It worked but it is really really slow... so I should better say it
> does NOT work!

That's what I would expect.

> From the docs I read that there are some issues about usb-to-serial
> converting, am I right?

Think a minute about what you're doing.  USB is a packet-oriented
protocol.  Even simple true RS-232 protocols like AVR910 already start
to suck when run across USB, as they are request-response protocols,
so for each byte to send, one USB packet has to travel to the device,
the response has to be collected, and sent back in another USB packet.
As the USB <-> RS-232 converter does not know when no more data will
follow, it has to imply a timeout before it will sent the data so far
as a response packet, further slowing down communication.

Our computer grandfathers already knew that request-response protocols
suck, and they invented windowed communication protocols to circumvent
that, where each side offers a "window" of unacknowledged packets that
can be sent before stalling communication (with some "roll back"
needed when detecting a failure).  UUCP and Kermit are written that
way.  (TCP improved that by automatically adapting the window size,
called "sliding window".)

The STK500 or JTAG ICE protocols don't suffer that much from the USB
transport implications, as all bulk data transfers are sent in larger
packets there.  Still, the receiver latency issue applies there.  (I
think this should improve with the current JTAG ICE and AVRISP mkII
devices that have a genuine USB controller on board rather than a
RS-232 emulation, so the controller could be told when a packet has
been assembled and can be sent.)

Now back to your `ponyser' dongle: replace "byte" in my description
above by "bit".  I think it's obvious why that cannot really work
anymore.

> Is there any soltution?

Yes.  Use one of the more advanced protocols, like an AVRISP (even the
mkI behind the RS-232 bridge should do fine), or Matthias Weißer's
do-it-yourself USBisp.

> What is about PCMCIA extension cards will they
> do a better job?

That would work better as they offer a genuine UART.

You could buy a few AVRISPs or a large quantity of USBisps for the
price of a PCMCIA UART though. :-)

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]