arduino pro mini ATMEGA328P 连线和点亮第一盏LED(同时记录烧录失败的问题stk500_recv)
arduino pro mini ATMEGA328P 连线和点亮第一盏LED(同时记录烧录失败的问题stk500_recv)重点写在最前面把,主要是波特率未同步,需要你手动给板子复位一下短接一下RST和 GND,主要是短接的时机就1-2秒,错过了就要从新搞用镊子按住GND碰一下RST就松开
先说一句,买了这个片的最好使用avr编程器,或者用其他 arduino 烧写了 ISP下载程序作为编程器给 pro mini下载,或者用ch340引出DTR接到rst使用(前提是pro mini里面有bootloader 不是空白芯片)
正常avr芯片下载使用6线,vcc gnd sck mosi miso rst ,也就是 SPI 的5条线加上RST复位
我用ch340也是临时用法,当时手里没有avr下载器,板载按钮是RST复位按钮,忽略下面提到的镊子短接RST,下载提示的时候,需要按一下rst
或者参考我修改ch340引出DTR的方法,在文章最后有电路图,把DTR接到RST
PY32F003 入门-CSDN博客PY32F003
https://blog.csdn.net/firseve/article/details/126661827
以前写的内容,这里作分隔符
还有一个就是你的 0和1 接了外设,这2个口是串口,下载程序的时候,不能接其他设备会造成串口干扰,拔了。
直接跟TB抓了张图作为开始
与其他arduino的开发板不同的是,这块板子没有USB接口,所以我们无法直接连接到电脑~
这时候我们需要的是通过TTL方式连接,使用 VCC GND TX RX

这里我们需要的是USB转TTL的转接板,我这个是 ch340g,也就是很多开发板上都会集成的廉价国产芯片,国外很多板子喜欢使用的是cp210x 系列的芯片,还有 pl230x 系列的(大锅盖中9升级更新用这个芯片)

(上面的就是ch340g)
下面给张正面照

多手截图,选择开发板的位置,处理器注意选择对应的型号(看不清就点开或者另存为,都是大图)
这里需要注意的除了使用5v或者3.3v去接arduino的vcc,gnd接gnd,RX和TX是反接的(上面的RX接下面的TX)

敲黑板的重点!!!!!
提前看好了 arduino这块板子的供电是 5v 还是 3.3v,如果操作不当看错了参数小心冒烟,虽然短时间不会坏,但能活多久这是个问题)
然后是准备一个代码用来测试
void setup() {
delay(2000);
Serial.begin(115200);
Serial.println("LED blink");
// 这里会输出13,因为println后面要求是字符串,因此想要看东西要强转String
Serial.println(String(LED_BUILTIN));
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT); // 指定这个针脚是用来做输出使用的,对应的也就是高低电平 1和0
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}

写在最后这里的另一个重点是!!!!
每次点右箭头→但是程序运行到上图位置之后会提示错误(后面还有重复10次都失败的提示)
avrdude: stk500_recv(): programmer is not responding
因为程序运行到这个位置的时候需要你 手动RST 复位板子(pro mini 有一个板载按钮,作用虽然是复位,但是烧录的时候也需要你在程序停在上图位置的时候按一下。)
Using Programmer : arduino
Overriding Baud Rate : 57600
然后程序会继续写入,同样
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\Administrator.T420\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"
Using Port : COM3
Using Programmer : arduino
Overriding Baud Rate : 57600
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 Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 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 : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.16
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.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\ADMINI~1.T42\AppData\Local\Temp\arduino_build_450173/ProMini-Blink.ino.hex"
avrdude: writing flash (3350 bytes):
Writing | ################################################## | 100% 1.00s
avrdude: 3350 bytes of flash written
avrdude: verifying flash memory against C:\Users\ADMINI~1.T42\AppData\Local\Temp\arduino_build_450173/ProMini-Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\ADMINI~1.T42\AppData\Local\Temp\arduino_build_450173/ProMini-Blink.ino.hex:
avrdude: input file C:\Users\ADMINI~1.T42\AppData\Local\Temp\arduino_build_450173/ProMini-Blink.ino.hex contains 3350 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.74s
avrdude: verifying ...
avrdude: 3350 bytes of flash verified
avrdude done. Thank you.
更多推荐



所有评论(0)