Make Arduino support ATMEGA 168P (burn BOOTLOADER)

Publisher:RadiantRiverLatest update time:2022-07-21 Source: csdnKeywords:Arduino  ATMEGA  168P Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:Arduino  ATMEGA  168P Reference address:Make Arduino support ATMEGA 168P (burn BOOTLOADER)

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

AVR Development Arduino Method (Part 3) Timer/Counter Subsystem
The main processor ATMega328P of Arduino UNO R3 has three timers/counters, namely Timer0, Timer1 and Timer2; they all complete basic timing/counting functions and some other functions by counting internal or external pulse signals. Timer0 and Timer2 are 8-bit timers/counters, and Timer1 is a 16-bit timer/counter. Th
[Microcontroller]
AVR Development Arduino Method (Part 3) Timer/Counter Subsystem
atmega8l direct drive pen segment lcd driver
#include "include.h" uchar lcdtab ={{{0x07,0x01,0x03},{0x04,0x00,0x02},{0x06,0x03,0x01}, {0x06,0x02,0x03},{0x05,0x02,0x02},{0x03,0x02,0x03},{0x03,0x03,0x03},{0x06,0x00,0x02}, {0x07,0x03,0x03} ,{0x07,0x02,0x03}}, {{0x18,0x14,0x0c},{0x10,0x10,0x00},{0x18,0x08,0x0c}, {0x18,0x18,0x08}, {0x10,0x1c,0x00},{0x08,0x1c,0x08},{
[Microcontroller]
Example of reading/writing atmega8515 internal EEPROM
/************************************************************** ;eeprom.c ; Example of reading/writing atmega8515 internal EEPROM ;Write data 0....9 into eeprom, then read it out and display it with digital tube ***************************************************************/ #include "avr/io.h" #include "avr/eeprom
[Microcontroller]
Transplantation of ucos on AVR ATmega32 (Part 1)
The basic scheduling principle was introduced earlier. Now let's apply it to the porting of ucos. If you don't understand scheduling yet, don't rush to port it, because the slightest error in the stack will cause the system to crash, and it will be difficult for you to find the cause. Let's take a look at the ucos pro
[Microcontroller]
Transplantation of ucos on AVR ATmega32 (Part 1)
ATmega48 External RC Oscillator
The chip can be driven by an external clock source, as shown in Figure 15. At this time, the CKSEL fuse bits must be programmed according to Table 15. After selecting this oscillator source, the startup time is determined by the fuse bit SUT, as shown in Table16. In order to ensure that the MCU can work stably, t
[Microcontroller]
ATmega48 External RC Oscillator
ATmega32 instruction execution timing
This section describes the access timing during instruction execution. The AVR CPU is driven by the system clock clkCPU. This clock comes directly from the selected clock source. This clock is not divided inside the chip. Figure 6 illustrates the concept of parallel instruction fetch and instruction execution determi
[Microcontroller]
ATmega32 instruction execution timing
Design and research of portable locomotive signal generator based on ATmega16
Abstract: The portable locomotive speed signal generator can simulate the locomotive running parameters and accurately output the speed change signal, which is convenient for maintenance staff to timely check the fault point and improve the maintenance efficiency. The device adopts a handheld structure, and mainly int
[Microcontroller]
Design and research of portable locomotive signal generator based on ATmega16
ATmega 16 microcontroller interrupt system related registers (VIII)
Reset and interrupt vectors Vector number Program address Interrupt source Interrupt definition1     0x000 RESET External pin level trigger, power-on, power-down detection, watchdog, and JTAG AVR reset2     0x002 INT0 External interrupt request 0 interrupt3     0x004 INT1 External interrupt request 1 interrupt4   
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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号