avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] Flow control with Butterfly


From: Pertti Kellomäki
Subject: Re: [avr-chat] Flow control with Butterfly
Date: Fri, 18 Mar 2005 15:36:27 +0200

18. maalis 2005 kello 14:56, Graham Davies wrote:
If the Butterfly application does not use interrupt-driven input and output
from and to the UART, this is where I would start.

Yes, that's what I figured as well.

 You say that you don't
know how much CPU time is soaked up by the other things going on, so you can't reason about whether or not the ATmega169 should be able to keep up with the serial data using polled I/O. The clock rate of the MCU on the Butterfly is probably well below the fastest that the ATmega169 can handle
to conserve power so it may not be going as fast as you think.

If the source code is to be believed, the controller runs at 1MHz.
It seems that this should be plenty, since the data being logged is
generated by a person pressing buttons.

Once your
characters are received into a buffer by interrupts you can use XON/XOFF flow control to hold off the PC when the buffer shows signs of filling up (for example, XOFF when it filles to 75%) and XON when it empties to 25%).

In my case the Butterfly responds to commands given by a PC,
and the commands are never longer than about 50 characters.
The PC waits for the Butterfly to respond, so it is enough if the
Butterfly can handle one bufferful at a time.


The Butterfly has so little spare I/O that I would not spend a port bit on
hardware flow control.

In my particular case there is I/O left over, so I could do it,
but it does seem like overkill.


**** Stop reading here if you object to advertising ****

Working with the AVR Butterfly might be easier with an ECROS Technology
Butterfly Carrier, which provides power, expansion space, a reset switch, a
DB9 and ISP/JTAG headers relocated to the rear.  See
http://www.ecrostech.com.

I wish I had seen this when I started playing with the Butterfly :-(
--
Pertti





reply via email to

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