avrdude-dev
[Top][All Lists]
Advanced

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

[avrdude-dev] avr910 speed-testing/tuning


From: Jan-Hinnerk Reichert
Subject: [avrdude-dev] avr910 speed-testing/tuning
Date: Wed, 10 Dec 2003 02:21:46 +0100
User-agent: KMail/1.5.1

Hi all,

After all the speed-tuning we have done to parallel-port-programmers, 
I have (once again) looked at the speed issue for avr910.c

I have tested read of entire flash of an Atmega161 with a programmer 
that runs avr910-protocol at 19.2k and 115.2k under Linux.

1) Regular linux installation:
Read of flash takes 81.93s regardless of baudrate.
This looks quite familiar. A read from the serial port is delayed 
until the next 10ms-tick ;-(

2) use "setserial /dev/ttyS0 low_latency"
Read of flash takes 31.65s with 19.2k
Haven't tried this setup with 115.2k, but it should be 6 times faster.

A quick calculation shows that a read of one word, takes 7.4 
byte-length (on the serial line). However, only 3 bytes are 
transferred on the serial line.

The explanation is simple: The PC's UART (TL16C550) waits 4 
byte-lenght before it requests an interrupt, because the 
FIFO-threshold of 8 is not reached. The remaining 0.4 byte-lengths 
are SPI-transfer in the programmer and system/program-overhead.

However, there is no simple solution here, since the FIFO-threshold is 
hardcoded in the kernel.

3) low_latency + patched kernel
Patch: Look for "UART_FCR_TRIGGER_8" in "drivers/char/serial.c" and 
replace it with "UART_FCR_TRIGGER_1" ;-)

Read of flash takes 14.4s at 19.2k and 3.66s at 115.2k now.

4) patched kernel without low_latency
Obviously, there is no difference to 1)

----------------
Now the questions:
- how are things on BSD and windows?
- should we do something about this?
  - IMHO we should at least put the "low_latency" into the 
documentation
  - should we include a kernel patch to the avrdude-release?
  - should we ask someone to make FIFO-threshold configurable?

/Jan-Hinnerk





reply via email to

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