Porting the Arduino Nano circuit to your own board step by step

Since the advent of Arduino, it has greatly promoted the development of global makers. The development environment of Arduino has integrated many library files, making programming extremely simple. So transplanting the Arduino circuit to your own board is also a good choice. This article takes Arduino Nano as an example to introduce the process of migrating from hardware schematic to firmware programming.

1. Schematic design

There are many schematic diagrams of Arduino Nano on the Internet. You can find the schematic diagram and PCB in AD format in the download channel of CSDN. Nano's board schematic diagram is relatively simple, the problem is not big, pay attention to retaining the ICSP programming interface, and burn the firmware after the board is completed. In addition, you need to choose different devices according to the industry characteristics of your products. For example, if the product is used in the industrial field, try to replace the crystal oscillator and LDO power supply in the schematic diagram with more reliable models.

2. Circuit board welding

When the circuit board is soldered, it is necessary to carefully check that there are no pin short circuits, false soldering, etc. For bare boards, the crystal oscillator of Atmega 328P will not start to oscillate after power on. Don't mistake it for board problem or chip problem.

3. Firmware burning

There are three main programs for firmware programming. Firstly, the method of programming via USBASP programmer is introduced. Other programs will be added later when there is time.
a. There are USBASP programmers on Taobao, which cost more than ten yuan each.
b. Install the USBASP driver, you can ask the store owner for the driver.
b. Download a PROGISP firmware programming software.
c. Connect the programmer to the programming interface of your own board, pay attention to the signal sequence:
MOSI connects MOSI, SCK connects SCK, MISO connects MISO, RESET connects RSET, and finally connect VCC and GND. (USBasp can provide 5V power supply to arduino, so There is no need to supply power to the arduino. If your board is complicated, the board can supply 5V independently, VCC can be disconnected, just connect the common ground to GND)
d. Run PROGISP, find Atmega 328P in the Select Chip option, this can be read ID, verify that the programming line is connected properly, if the line connection is ok, and the ID still prompts an error, it may be that the chip is not soldered well.
Before proceeding to the next step, you need to write the programmed fuse value first, click the position of the horizontal line in the figure below or the position marked with 3.
Insert picture description here
Here you need to manually fill in the low value, high value, and extended bit value. How can this value be obtained? In the installation directory of Arduino IDE, find the boards.txt file (…\Arduino\hardware\arduino\avr\boards.txt)

Insert picture description here
Search for 238p in the document, you can see low_fuses=xxxx, fill in the low value, high value, and extended value corresponding to these three groups of values. Note that you must manually click Write, otherwise the program will not write the fuse value to 328P by itself. After writing, you can click to read and verify.
Insert picture description here
e. Back to the main interface of the program, click Load Flash in the upper right corner, and find the installation path of Arduino IDE. My path is as follows: D:\Program Files\Arduino\hardware\arduino\avr\bootloaders\atmega, select ATmegaBOOT_168_atmega328.hex
and then Click Auto, wait for the progress bar to finish, complete the programming and Flash verification.
Insert picture description here
Start your arduino programming journey later.

Guess you like

Origin blog.csdn.net/malcolm_110/article/details/106711136