I'm trying to use an Arduino Uno to burn the bootloader onto an ATMega168p. I uploaded the ArduinoISP sketch to my Arduino Uno and then followed the following wiring diagram. The resistor is 10K, the capacitors are 22pF, and the crystal is 16MHz.
I then set the board to ATMega168P using MiniCore (GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB ) and set the programmer to Arduino as ISP. But when I try to burn the bootloader, I get the following error:
avrdude: Version 7.1-arduino.1
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is C:\Users\T\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.2.1\avrdude.conf
Using Port : COM3
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATmega168P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : possible i/o
RETRY pulse : SCK
Serial program mode : yes
Parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 512 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 16384 128 128 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
calibration 0 0 0 0 no 1 1 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel STK500 version 1.x firmware
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000
avrdude main() error: Yikes! Invalid device signature.
avrdude main() error: expected signature for ATmega168P is 1E 94 0B
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Error while burning bootloader.
Does anyone know what I can do to burn the bootloader onto an ATMega168p?
Also, this is what I set for the clock, variant, and whatnot
ua6em
March 4, 2023, 7:32am
3
there is no 10 microfarad electrolytic capacitor in the circuit
@ua6em Where should that go?
I will give that a try, thank you.
I tried it with a 10uF capacitor connected to ground and reset and it didn't work, I got the same error
At least one 100 nF decoupling capacitor is required, as described in this excellent tutorial .
I'm getting stuck at the board detector part. I tried it without a crystal and with a 16MHz crystal and got the same output. It says "Programming mode off". This is what is being outputted to the serial monitor:
Atmega chip detector.
Wramming mode ....mmon.
Version 1.20
Compiled on Mar 11 2023 at 16:44:41 with Arduino IDE 10819.
Attempting to enter ICSP programming mode ....
Atmega chip detector.
Written by Nick Gammon.
Version 1.20
Compiled on Mar 11 2023 at 16:44:41 with Arduino IDE 10819.
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Programming mode off.
My wiring seems to be correct, could the chip be bad?
tomlightyear:
could the chip be bad?
Much more likely that the wiring is wrong. Post a clear, focused, close up picture of the setup.
This is my current wiring
Nothing obviously wrong, although long leads to the crystal can be problematic.
The next step is to use your multimeter to check whether 5V is present on Vcc of the target ATmega chip.
You should also use it to check continuity of all connections. Breadboards are not particularly reliable, and jumper wires can break internally.
Where did you get that ATmega168 chip?
If it came directly from the manufacturer, and is genuine, the fuses will be set to 8 MHz internal oscillator, with the CKDIV8 fuse set, so the MCU clock rate is 1 MHz.
I think it may be a problem with the crystal pins on the chip. There doesn't appear to be continuity between the chip crystal pins and the breadboard rails. I move the chip to a different spot on the breadboard and there's continuity between one of the pins and the breadboard, but not the other pin. I move the chip again to a different spot and there's continuity between the other pin, but not the first one.
Turns out the socket I had the chip plugged into wasn't making a good connection with the breadboard. I think I got the board detection part working now
Atmega chip detector.
o bytes.
LFuse = 0xF7
HFuse = 0xD5
EFuse = 0xFC
Lock byte = 0xCF
Clock calissor = ATmega168PA
Flash memory size = 16384 bytes.
LFuse = 0xF7
HFuse = 0xD5
EFuse = 0xFC
Lock byte = 0xCF
Clock calibration = 0x9⸮
B⸮
Flash memory size = 16384 bytes.
LFuse = 0xF7
HFuse = 0xD5
EFuse = 0xFC
Lock byte = 0xCF
Clock calibration = 0x9⸮
B⸮
Atmega chip detector.
Written by Nick Gammon.
Version 1.20
Compiled on Mar 11 2023 at 20:54:43 with Arduino IDE 10819.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x94 0x0B
Processor = ATmega168PA
Flash memory size = 16384 bytes.
LFuse = 0xF7
HFuse = 0xD5
EFuse = 0xFC
Lock byte = 0xCF
Clock calibration = 0x9B
Bootloader in use: Yes
EEPROM preserved through erase: Yes
Watchdog timer always on: No
Bootloader is 512 bytes starting at 3E00
Bootloader:
3E00: 0x01 0xC0 0xB7 0xC0 0x11 0x24 0x84 0xB7 0x90 0xE8 0x90 0x93 0x61 0x00 0x10 0x92
3E10: 0x61 0x00 0x88 0x23 0x61 0xF0 0x98 0x2F 0x9A 0x70 0x92 0x30 0x41 0xF0 0x81 0xFF
3E20: 0x02 0xC0 0x97 0xEF 0x94 0xBF 0x28 0x2E 0x80 0xE0 0xC6 0xD0 0xE9 0xC0 0x85 0xE0
3E30: 0x80 0x93 0x81 0x00 0x82 0xE0 0x80 0x93 0xC0 0x00 0x88 0xE1 0x80 0x93 0xC1 0x00
3E40: 0x80 0xE1 0x80 0x93 0xC4 0x00 0x86 0xE0 0x80 0x93 0xC2 0x00 0x8E 0xE0 0xB4 0xD0
3E50: 0x25 0x9A 0x84 0xE0 0x20 0xE3 0x3C 0xEF 0x91 0xE0 0x30 0x93 0x85 0x00 0x20 0x93
3E60: 0x84 0x00 0x96 0xBB 0xB0 0x9B 0xFE 0x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 0x33 0xD0 0x32 0xD0 0xF8 0x2E 0x30 0xD0
3F40: 0x41 0xD0 0x8E 0x01 0xF8 0x01 0x85 0x91 0x8F 0x01 0x23 0xD0 0xFA 0x94 0xF1 0x10
3F50: 0xF9 0xCF 0xA1 0xCF 0x85 0x37 0x39 0xF4 0x35 0xD0 0x8E 0xE1 0x1A 0xD0 0x84 0xE9
3F60: 0x18 0xD0 0x8B 0xE0 0x97 0xCF 0x81 0x35 0x09 0xF0 0xA9 0xCF 0x88 0xE0 0x24 0xD0
3F70: 0xA6 0xCF 0xFC 0x01 0x0A 0x01 0x67 0xBF 0xE8 0x95 0x11 0x24 0x07 0xB6 0x00 0xFC
3F80: 0xFD 0xCF 0x66 0x70 0x29 0xF0 0x45 0x2B 0x19 0xF4 0x81 0xE1 0x87 0xBF 0xE8 0x95
3F90: 0x08 0x95 0x90 0x91 0xC0 0x00 0x95 0xFF 0xFC 0xCF 0x80 0x93 0xC6 0x00 0x08 0x95
3FA0: 0x80 0x91 0xC0 0x00 0x87 0xFF 0xFC 0xCF 0x80 0x91 0xC0 0x00 0x84 0xFD 0x01 0xC0
3FB0: 0xA8 0x95 0x80 0x91 0xC6 0x00 0x08 0x95 0xE0 0xE6 0xF0 0xE0 0x98 0xE1 0x90 0x83
3FC0: 0x80 0x83 0x08 0x95 0xED 0xDF 0x80 0x32 0x19 0xF0 0x88 0xE0 0xF5 0xDF 0xFF 0xCF
3FD0: 0x84 0xE1 0xDF 0xCF 0xCF 0x93 0xC8 0x2F 0xE3 0xDF 0xC1 0x50 0xE9 0xF7 0xCF 0x91
3FE0: 0xF1 0xCF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
3FF0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 0x08
MD5 sum of bootloader = 0x09 0x27 0x0F 0xED 0x81 0x9D 0x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FF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
C0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
D0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
E0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
F0: 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
Programming mode off.
There should not be continuity between those points. Glad you got it working!
I got the bootloader onto the chip. Thank you for all your help, I really appreciate it. Now to try and program the chip.
system
Closed
September 8, 2023, 2:21am
17
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.