avr-chat
[Top][All Lists]
Advanced

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

FW: [avr-chat] Flow control with Butterfly


From: Jørund Salte
Subject: FW: [avr-chat] Flow control with Butterfly
Date: Fri, 18 Mar 2005 14:47:35 +0100

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On 
> Behalf Of Graham Davies
> Sent: 18. mars 2005 13:56
> To: address@hidden
> Subject: Re: [avr-chat] Flow control with Butterfly
> 
> 
> Pertti Kellomäki wrote [in part]:
> 
> > ... I have used the application shipped with the Butterfly as a
> > starting point, so when receiving from the uart my program also 
> > continually polls the pins connected to the joystic. The 
> LCD driver is
> > also working at the same time.
> >
> > ... should I need flow control ... what should it be?
> 
> If the Butterfly application does not use interrupt-driven
> input and output from and to the UART, this is where I would 
> start.  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.  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%).
> 
> The Butterfly has so little spare I/O that I would not spend
> a port bit on hardware flow control.
> 
> **** 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.
> 
> Graham.
> 
> 
> 
> _______________________________________________
> AVR-chat mailing list
> address@hidden http://lists.nongnu.org/mailman/listinfo/avr-chat
> 

The original butterfly code uses polled USART input and output. Please
check out Atmel's application note "AVR306: Using the AVR UART in C"
with accompanying code. This has a neat little example of BUFFERED,
INTERRUPT DRIVEN code. You may have to make a few modifications to port
it from IAR to avrgcc, but the rest of your code should provide plnety
of examples how to do that. Whether you still need to add flow control
depends on how fast you are able to consume the incoming characters, but
at least now it isn't the coomunication itself that slows things down!


Jørund






reply via email to

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