Replies: 23 comments 80 replies
-
The following page is a good summary of AVR programmers (in German but Google Translate seem to work well). It has some benchmarks as well with avrdude 5.5. The test file was 29704 bytes in size. Target is an ATmega6490 clocked at 8MHz by the RC oscillator. All this was tested with an AVRDUDE 5.5.
|
Beta Was this translation helpful? Give feedback.
-
From #1106, results from @MCUdude using STK600: reading the ATmega2560 in 12.8s. This beats my AVRISP mkii result of 14.52s. @MCUdude thinks that the reason is probably because of the use of a USB AVR in STK600 vs the use of an non-USB AVR plus a USB controller in AVRISP mkii.
|
Beta Was this translation helpful? Give feedback.
-
Results for USBasp, reading of ATmega2560 in 40.34s, without using
|
Beta Was this translation helpful? Give feedback.
-
USBtinyISP result: reading of ATmega2560 takes 186.50 seconds.
|
Beta Was this translation helpful? Give feedback.
-
PICKit 4 result in ISP mode, same results with and without
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
For
|
Beta Was this translation helpful? Give feedback.
-
I compared three programmers last year using ATmega328P as the target with a 32KB hex file, in Nov 2022.
|
Beta Was this translation helpful? Give feedback.
-
See my results #1528 (comment) |
Beta Was this translation helpful? Give feedback.
-
I had no peace before I also optimised the writing of the EEPROM in my nanoSTK_V1 - now I write the EEPROM data page by page instead of single bytes
|
Beta Was this translation helpful? Give feedback.
-
@Ho-Ro Looks cool. There is more to consider than speed. For example, eeprom has only a limited number of write cycles. Perhaps consider an advanced method to read the eeprom contents before writing to make a decision whether the cell needs changing at all (and if nothing needs doing that is much faster, too ;) This can lead to a trade-off when writing an EEPROM page, though, when for example only 5 cells of an 8-byte page need changing. For me, not wasting unnecessary EEPROM programming cycles wins. |
Beta Was this translation helpful? Give feedback.
-
According data sheet the risk of destroying the memory via ISP is less, frequent writing of the AVR appliction firmware to the same address is more likely to destroy the EEPROM. However, there are good wear-leveling algorithms against this. Datasheet (e.g. m328p): The Flash memory has an endurance of at least 10,000 write/erase cycles.
There's an easy solution, see this part from data sheet: The EEPROM array is programmed one page at a time. The Memory page is loaded one byte at a time by supplying the 6 LSB of the address and data together with the Load EEPROM Memory Page instruction. The EEPROM Memory Page is stored by loading the Write EEPROM Memory Page Instruction with the 7 MSB of the address. When using EEPROM page access only byte locations loaded with the Load EEPROM Memory Page instruction is altered. The remaining locations remain unchanged. Remark: According to Table 28-19 6 LSB is wrong, it must be 2 LSB, also 7 MSB must be 10 MSB for m328p with 1024 byte EEPROM:
Solution for my nanoSTK_V1 code: EEPROM page writestatic uint8_t write_eeprom( uint16_t length ) {
uint16_t ee_addr_wr = here; // write address of EEPROM
if ( use_arduino_protocol ) {
// arduino bootloader protocol sends word addresses also for EEPROM
// calculate the EEPROM byte address
ee_addr_wr *= 2;
}
fill( length ); // get EEPROM page data
uint16_t ee_addr_rd = ee_addr_wr; // read address of EEPROM
bool page_has_changed = false;
for ( uint16_t pg_idx = 0; pg_idx < length; ++pg_idx ) {
uint8_t data = buff[ pg_idx ];
if ( data != read_eeprom_byte( ee_addr_rd++ ) ) {
load_eeprom_page( pg_idx, data );
page_has_changed = true;
}
}
if ( page_has_changed ) {
write_eeprom_page( ee_addr_wr );
delay( wait_delay_EEPROM );
}
return Resp_STK_OK;
} This decreases the writing time for 1024 byte identical EEPROM content from 2.8 s down to 1.8 s, the serial and ISP transfer becomes more and more the bottleneck :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
As per @flyandancexo, mingw64 build is slower than msvc64 build for his optimized AVR910 programmer. My tests using avrdude 7.3 release show this is indeed correct too for usbasp programmer.
|
Beta Was this translation helpful? Give feedback.
-
urboot bootloader test results -- CH340G based Uno Clone.
|
Beta Was this translation helpful? Give feedback.
-
8235B/s is much faster, but still very slow, actually extremely slow for a big mcu like that. My bootloader doesn't need an IO pin to enter bootloader mode. It automatically enters bootloader mode after the MCU resets itself and return to application after 500ms to 4s (the compiled hex has a 1 second delay), so the first upload is free, since there is no code in the application section. The second upload, you need to press the reset button. AVR109 doesn't issue an DTR or RTS signal on serial, so auto upload is not possible with avr109. |
Beta Was this translation helpful? Give feedback.
-
You may want to elaborate to see how avrdude can be improved. Please help to take a look as well. Thanks. |
Beta Was this translation helpful? Give feedback.
-
If you really want to get things done, you have to do it yourself. The 2M bug has been spotted on finally and bypassed. It's very stable at 2Mbps now, using the exact same CH340g and same boards. Here are the test results and the re-compiler bootloader for atmega328p at 2Mbps. You double check if the error has really been gone or not. The upload speed should be 27kB/s and download 50kB/s now for the atmega328p at 2M. Please update the record after you have confirmed it and re-think about how great the CH340g is. Ch340x is probably better than other. I don't know how fast other chips can go, but CH340g can go 2Mbps, and I have confirmed it here. PS. SPM is very efficient already. The quote that you took from other people is dumb and false, and it's probably just marketing slang to entice you to use their bootloader. FDxboot 1.62@2Mbps with CH340G: |
Beta Was this translation helpful? Give feedback.
-
And... what was the bug? |
Beta Was this translation helpful? Give feedback.
-
Dr Azy has some interesting data for serialupdi here for modern AVRs.
|
Beta Was this translation helpful? Give feedback.
-
Here is the readback function.
|
Beta Was this translation helpful? Give feedback.
-
Please continue in #1705. |
Beta Was this translation helpful? Give feedback.
-
I have updated the FAQ to recommend urboot bootloader for classic AVRs, also add some USB to Serial chip info. Please take a look as well and feel free to update the FAQ page to add more info. |
Beta Was this translation helpful? Give feedback.
-
So far I have the STK500v2 clone (HVPP capable, with ATmega8535 as main control MCU, PL2303HXA USB to serial chip) to be the fastest wthout using
-B 1
option. With-B 1
, an AVRISP mkii clone seems to be the fastest.Beta Was this translation helpful? Give feedback.
All reactions