I'm making a gadget recently. Since the first DEMO was completed on the Arduino Pro Mini, using various modules connected by enameled wires, I decided to continue making a complete PCB board based on the Arduino framework.
When purchasing a single-chip microcomputer chip, I found that ATMEGA168P is cheaper than ATMEGA328P, and it seems to be supported on the Arduino IDE. There is an option of ATMEGA168 in the IDE chip selection. Although the DEMO is based on ATMEGA328P, the program does not need to be modified when the chip is replaced on Arduino. So I bought ATMEGA168P (I really dug a hole for myself).
After the chip arrived, because Arduino programs are generally downloaded via the serial port, I only left the serial port interface on the PCB board I drew (in fact, it can be downloaded using ISP, using pins 11, 12, and 13, but I did not leave the interface on the PCB).
The difference from the directly purchased ProMini minimum system board is that the purchased development board merchant will first burn the BootLoader for you, so that you can download it directly through the serial port, but the purchased chip does not have anything burned.
In order to download the program conveniently (using the serial port to download), the first step is to flash the BOOTLOADER to the chip, which is the bootloader on the IDE. I thought I could download it using Arduino as ISP (using another Arduino as an ISP downloader), but I couldn't download it. The reason is that when I selected ATMEGA168 on the IDE, its signature is 1E:94:06, and I used ATMEGA168P, its signature is 1E:94:0B, so the ISP download failed.
After searching online for a while, I found that I had to modify the boards file and add the development board in the IDE according to the actual feature word. After trying for several hours, the Arduino IDE was messed up by my modification. Although there was no error message of feature word mismatch, the download still failed after waiting for more than ten seconds. So I gave up.
Chip model -> Characteristic word
ATMEGA328P -> 1E:95:0F
ATMEGA168 -> 1E:94:06
ATMEGA168P -> 1E:94:0B
Bought a USBISP and used AVR_FIGHTER.
ISP Interface Definition
Read the characteristic word first, and if the correct value can be read, it can be confirmed that there is no problem with the chip and crystal oscillator soldering.
If a prompt appears, ignore it, because the 168P chip does not exist in the chip selection of this software. Read all the readable data to confirm whether there is any problem with the connection again. It is important to be careful not to accidentally click on the write button, as writing the wrong value may lock the chip.
The default fuse bits of the chip are: low bit 0x62, high bit: DF, special bit: F9 (as shown above).
We want to set it to FF,DD,00
Next is to burn BOOTLOADER, install FLASH->select ATmegaBOOT_168_diecimila.hex->chip programming
Taking the IDE installed in the D drive as an example, the file is in D:Program Files (x86)Arduinohardwarearduinoavrbootloadersatmega
Wait for programming and verification to complete.
If the burning is successful, the LED light on pin 13 will flash every 1s.
Download the Blink program using the serial port successfully.
Pay attention to the reset circuit. The RESET pin of the microcontroller should be pulled up by a 10K resistor, and then connected to a 0.1u capacitor to the RTS interface of the USB to serial port (that is, DTR is connected to RTS) to achieve automatic reset when downloading the program.
Previous article:Repair of electric control board: Replacement of atmega8a main control chip
Next article:Burn bootloader to atmega168P
Recommended ReadingLatest update time:2024-11-15 15:55
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- PCB carries 10A current
- EEWORLD University ---- VICOR High Performance Power Conversion Seminar (2019.11)
- Simplify Your BOM with High Voltage Amplifiers
- TI Bluetooth Low Energy/Zigbee RF4CE Remote Control
- The wireless receiving signal brightness DBM is negative
- Million-dollar annual salary recruitment: Data algorithm engineer (video big data)
- TMS320F28377D_LED Experiment
- TCP and UDP packet structure
- VCA810 Distortion
- CC2531 USB Dongle Reference Design