且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Arduino - 无需外部晶体即可燃烧引导加载程序

更新时间:2023-12-05 20:09:10


对于无效的设备签名 -(如果内部时钟打开,通常会发生这种情况)

对于 ATMEGA328p,如果由于某种原因预加载了引导加载程序,则签名不匹配,因此您必须执行此操作,然后撤消它 <<请不要忘记,否则您每次编写脚本之前都必须进行引导加载,直到您撤消此操作.

For the ATMEGA328p if it is preloaded with a bootloader for some reason there is a mismatch in signatures so you'll have to do this THEN UNDO IT << please don't forget or else you'll have to bootload everytime before you write a script until you UNDO this.

  1. 您需要打开 Arduino 程序文件中的 avrdude.conf 文件

  1. You'll want to open up the avrdude.conf file in Arduino's program files

for mac: 显示 PC 和 Linux 的包内容只需搜索程序文件

for mac: show package contents for PC and Linux just search the Program Files

  • 在这个文件中搜索ATMEGA328P"应该是一个名为signature的字段,将0x1e 0x95 0x14"(328签名)替换为0x1e 0x95 0x0F"(328p签名)

  • in this file search for " ATMEGA328P " under it should be a field named signature replace "0x1e 0x95 0x14" (the 328 signature) with "0x1e 0x95 0x0F" (the 328p signature)

    如果内部时钟不在同步错误发生

    ATMEGA328p 有一个以 8MHz 运行的内部振荡器,但是当 16MHz 引导加载程序被烧毁时,这个振荡器显然是关闭的.所以如果你要烧一个 8MHz (lilypad) 类型的引导加载程序,你必须在适当的地方使用 16MHz 振荡器,这样才能打开内部时钟.

    The ATMEGA328p has an internal oscillator which operates at 8MHz but this oscillator is apparently turned off when the a 16MHz bootloader is burned to it. So if you are gonna burn an 8MHz (lilypad) type bootloader to it you'll have to do so with the 16MHz oscillator in place so the internal clock can be turned on.

    要做到这一点:

    1. 在 UNO R3 上加载 ArduinoISP 示例脚本,您将使用
    2. 启动加载
    3. (在工具 > 开发板 > LilyPad Arduino 或面包板上的 ATMEGA328 中配置)
    4. (在工具>端口>ArduinoISP中配置)
    5. 之后你应该准备好刻录引导加载程序了

    如果同步错误持续存在,则意味着时钟未对齐,这意味着您必须减慢引导加载程序的速度

    1. 在 Hardware 文件夹中搜索 avr 文件夹中的 board.txt 文件
    2. 将文件中包含atmega328bb.upload.speed=57600"的行编辑为atmega328bb.upload.speed=19200"
    3. 再次尝试上面的步骤 2 - 4

    以各种组合或随着问题的发展适当地尝试每个步骤.如果这似乎不起作用,请继续搜索论坛......我在大约 3 小时内在谷歌上找到了所有这些 - 祝你好运!

    Try each of these steps in various combinations or appropriately as the problem evolves. If this doesn't seem to work just continue search forums... I had found all this in about 3 hrs on google - good luck!