bonarm 发表于 2016-7-18 16:35:47

简易快速多功能TQFP32烧写/下载器(bootloader & sketch)

本帖最后由 bonarm 于 2016-7-19 00:15 编辑

做其他项目时,利用PCB的边角料顺手做了块Arudino的快速多功能TQFP32封装的烧写/下载器,不用焊接,直接把芯片按在焊盘上就行了。可以烧写Arduino的bootloader,也可以下载sketch。

下载bootloader时,用Arduino as ISP的方法,需要一块Arduino的板子作为编程器,具体方法已经有不少介绍,这里就不再赘述了。将本烧写/下载器的GND、+5V、D11、D12和D13共5根线接到作为编程器的Arduino板子上的对应脚位,RST接到D10即可。
共需要接6根线。


下载Sketch时,将GND、+5V、TXD、RXD及DTR接到USB转换器的对应脚即可。我用的是CP2102的转换器,自己接了DTR出来替换了原来的Reset脚,这样不需要下载时按Reset了。








芯片1脚在左下方,不必要的脚只保留了几个用于定位。

右方偏下的LED用于测试,bootlader烧好后下载个测试程序,成功的话LED会闪烁。

void setup() {
pinMode(5,OUTPUT);
}

void loop() {
digitalWrite(5,!digitalRead(5));
delay(300);
}


开始烧了几片ATMEGA328P都很顺利,烧ATMEGA168PA时遇到了麻烦。后来修改了avrdude.conf文件中168P的配置,主要是签名码、E2PROM大小,烧好bootloader后再改回来才能下载Sketch。

darkorigin 发表于 2016-7-18 21:49:46

没看懂啊~~~有使用的视频不?

个人觉得直接烧AVR意义似乎有限,毕竟AVR离开外围电路似乎工作也会有问题。

用来测试还是很不错的

bonarm 发表于 2016-7-18 22:27:51

darkorigin 发表于 2016-7-18 21:49 static/image/common/back.gif
没看懂啊~~~有使用的视频不?

个人觉得直接烧AVR意义似乎有限,毕竟AVR离开外围电路似乎工作也会有问题。 ...

没看懂?要视频?没这么复杂吧。就是一个最小系统,TQFP32的不要焊接罢了。

“直接烧AVR意义似乎有限,毕竟AVR离开外围电路似乎工作也会有问题”这句话倒是没看懂。哪个MCU离开外围电路工作会没有问题?

拿Arduino搞些小开发很方便,但有时想做个独立的作品出来,放一个Arduino的板子又不太合适,例如面积体积有限制等,还是需要直接使用芯片。但是芯片首先需要烧Arduino的bootloader进去,成品板上最多放个下载Sketch的连接器(4~5根线)用于更新,不太会在成品板上烧bootloader的。这个主要就是烧bootloader用的。用的时候接好线,把TQFP32的ATMEGA328或168芯片直接放在中间的焊盘上用手按住,把作为编程器的Arduino板子插上USB口,就能利用Arduino as ISP来烧写bootloader了。

烧写成功后的提示信息(例):
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM3 -b19200 -Uflash:w:C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328-Mini.hex:i -Ulock:w:0x0F:m
Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.Thank you.


avrdude: Version 6.0.1, compiled on Jan 15 2015 at 16:58:43
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"

         Using Port                  : COM3
         Using Programmer            : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay            : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode         : yes
         parallel program mode         : yes
         Timeout                     : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail               :

                                  Block Poll               Page                     Polled
         Memory Type Mode Delay SizeIndx PagedSize   Size #Pages MinWMaxW   ReadBack
         ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
         eeprom      65    20   4    0 no       1024    4      036003600 0xff 0xff
         flash         65   6   128    0 yes   32768128    25645004500 0xff 0xff
         lfuse          0   0   0    0 no          1    0      045004500 0x00 0x00
         hfuse          0   0   0    0 no          1    0      045004500 0x00 0x00
         efuse          0   0   0    0 no          1    0      045004500 0x00 0x00
         lock         0   0   0    0 no          1    0      045004500 0x00 0x00
         calibration    0   0   0    0 no          1    0      0   0   0 0x00 0x00
         signature      0   0   0    0 no          3    0      0   0   0 0x00 0x00

         Programmer Type : STK500
         Description   : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef         : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e950f
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 "C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328-Mini.hex"
avrdude: writing flash (32748 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 32748 bytes of flash written
avrdude: verifying flash memory against C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328-Mini.hex:
avrdude: load data flash data from input file C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328-Mini.hex:
avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328-Mini.hex contains 32748 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% -0.00s

avrdude: verifying ...
avrdude: 32748 bytes of flash verified
avrdude: reading input file "0x0F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0F:
avrdude: load data lock data from input file 0x0F:
avrdude: input file 0x0F contains 1 bytes
avrdude: reading on-chip lock data:

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

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.Thank you.

bonarm 发表于 2016-7-19 00:08:12

本帖最后由 bonarm 于 2016-7-19 00:56 编辑

下面两张图左边的是用Arduino Nano板开发的,由于空间有限需要减小PCB的尺寸,为此直接用了ATMEGA328,如图右边部分所示。




tempchar 发表于 2016-7-19 15:04:14

bonarm 发表于 2016-7-19 00:08 static/image/common/back.gif
下面两张图左边的是用Arduino Nano板开发的,由于空间有限需要减小PCB的尺寸,为此直接用了ATMEGA328,如图 ...

连阻焊都刷了,板子做的好精致啊
话说这个是用来做什么的?

bonarm 发表于 2016-7-19 19:48:52

本帖最后由 bonarm 于 2016-7-19 19:50 编辑

tempchar 发表于 2016-7-19 15:04
连阻焊都刷了,板子做的好精致啊
话说这个是用来做什么的?

阻焊不难弄的。最难的是贴感光干膜,要尽量没有气泡。

功放的MCU部分,主要是遥控控制,还有马达音量电位器驱动等,详见:
http://blog.sina.cn/dpool/blog/s/blog_939243320102wpfy.html?wm=3049_a111
页: [1]
查看完整版本: 简易快速多功能TQFP32烧写/下载器(bootloader & sketch)