通通

[Verified] Arduino development board (ATMEGA328P-MU)

 
Overview

Preface

Some time ago, I bought a set of Haoxiang ToF module and 4-in-1 ESC for RMB 48 (picking up trash), which contains 4 ATMEGA328P-MU microcontrollers, so I drew this Arduino development board.

This project is based on this solution verification board, adding a serial port download module, TYPE-C interface, etc.

https://oshwhub.com/li-chuang-zhi-neng-ying-jian-bu/atmega328pb-au-fang-an-yan-zheng-ban_transfer_transfer_transfer

1. Solder PCB

2. Burn Bootloader for the chip

The role of bootloader

Arduino boots the burning program through a pre-written bootloader. Every time a program is downloaded to the Arduino board through the serial port, the Arduino board will be reset first, so that the bootloader is entered first, and then specific download instructions are sent to the Arduino board. After the bootloader recognizes these instructions, it will start to receive the remaining program. The new program code is written into the internal flash. If the bootloader does not recognize the download instruction, it will jump to the program area and work normally.

There is no bootloader in the newly shipped microcontroller, so you need to burn it in yourself.

Two methods to burn bootloader

Two ways:

  1. Burn Bootloader through AVR downloader
  2. Using another Arduino as ISP to flash the Bootloader

Arduino programming bootloader: https://www.jianshu.com/p/2f274f8b3dab

How to make your own Arduino development board: http://www.basemu.com/how-to-make-an-Arduino-clone-board.html

2.1 Use USBISP downloader to burn Bootloader

It is recommended to buy this kind. The other one I bought cannot be used.

Open the PROGISP software, select the chip model, and connect the USBISP downloader to the Arduino development board:

ISP Downloader--Target Board

MISO-----MISO

VCC------5V

SCK------SCK

MOSI-----MOSI

RST-------RST

GND------GND

Click to load Flash and select the D:Program FilesArduinohardwarearduinoavr ootloadersatmega folder under the arduino installation directory

If the crystal oscillator used by your development board is 8MHz , then choose ATmegaBOOT_168_atmega328 _pro_8MHz .hex

If the crystal oscillator used by your development board is 16MHz , then choose ATmegaBOOT_168_atmega328.hex

The author uses 16MHz, so I chose ATmegaBOOT_168_atmega328.hex

The bootloader file must match the crystal oscillator, otherwise you will not be able to use the serial port to download the program!

 

2.2 Use Arduino development board to burn Bootloader

Open the Tools -> Programmer of the arduino IDE and a list of all supported programmers is displayed. It is recommended to use the Arduino as ISP method, which is relatively simple and has a high success rate.

Arduino as ISP is simply to use another Arduino board, download a special program to it in the normal way , turn it into an ISP downloader, and then connect its corresponding pins to the board to be programmed with the bootloader , and then through Arduino IDE is used to control bootloader programming . Here italics show the three steps.

  • To make an ISP board,
    open the IDE, Files -> Examples -> ArduinoISP -> ArduinoISP, and use this program to download it to an Arduino board. Let's call this board the ISP board.

  • The connection between the ISP board and the target board
    can be seen from the previous introduction. Here, the pins of the ISP board should be connected to the ICSP interface on the target board. The connection correspondence table is as follows (taking UNO as an ISP board as an example)

ISP board

target board

MISO/12

MISO/ICSP-1

Vcc/5V

Vcc/ICSP-2

SCK/13

SCK/ICSP-3

MOSI/11

MOSI/ICSP-4

10

Reset/ICSP-5

GND

GND/ICSP-6

The actual connection circuit is as follows. The left side is the ISP board, connected to the computer, and the right side is the target board waiting to download the bootloader.

  • Use arduino IDE to program the bootloader for the target board.
    After connecting the ISP board and the target board according to the previous method, connect the ISP board to the computer, open the IDE, first hold down ctrl + shift + M to open the serial port debugging window, and then click Tools - > Boards select the type of target board. Then select Arduino as ISP in Tools -> Programmer, and finally click Tools -> Burn boot program. At this time, programming will begin. At the same time, there will be relevant prompts and confirmations in the serial port debugging window. Just enter the corresponding keys according to the instructions. Finish.


Reference: https://www.jianshu.com/p/2f274f8b3dab

3. Serial port download test

Open Blink in the example and use the USB-TTL downloader to connect to the Arduino development board:

Downloader--Arduino development board

GND---GND

RXD---D1 (TXD)

TXD---D0 (RXD)

5V------VCC

 

 The author uses a 16MHz crystal oscillator . Select the download method as shown below. 8MHz selection (3.3V, 8MHz), the chip supply voltage is 3.3V

Notice:

This 0.1uF capacitor realizes automatic downloading without pressing the RESET button every time it is downloaded.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 22:37:24

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号