-1

我正在使用eclipse软件,当我想将我的代码上传到时钟为16MHZ的MCU(atmega32)时,avrdude花费的时间比它应该的要长,但是程序运行正常,但唯一的问题是avrdude上传时间。下面的例子显示上传程序花了超过1.5分钟,那么我该如何减少这个时间呢?

Launching D:\Programs\03- IMT SDK\IMT_SDK_Win_64\WinAVR\bin\avrdude -pm32 -cusbasp -P230400 -b230400 -Uflash:w:1542.hex:a 
Output:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9502
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "1542.hex"
avrdude: input file 1542.hex auto detected as Intel Hex
avrdude: writing flash (7518 bytes):

Writing | ################################################## | 100% 62.72s

avrdude: 7518 bytes of flash written
avrdude: verifying flash memory against 1542.hex:
avrdude: load data flash data from input file 1542.hex:
avrdude: input file 1542.hex auto detected as Intel Hex
avrdude: input file 1542.hex contains 7518 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 34.79s

avrdude: verifying ...
avrdude: 7518 bytes of flash verified

avrdude done.  Thank you.

avrdude finished
4

1 回答 1

0

计算 的值7518 bytes / 62.72 s给出的上传速度为120 bytes/sec,而 USBasp 的编程速度可达5 kBytes/sec. 上传速度当然可以提高。

首先,确保 USBasp 的 PC2 端口连接的跳线被移除。它旨在激活慢速操作选项以支持具有低时钟速度 (< 1,5 MHz) 的目标。

其次,您不必手动指定上传速度,因此可以简化命令:

avrdude –c usbasp –p m32 –U flash:w:1542.hex

于 2021-09-13T22:46:35.410 回答