Electronics > Microcontrollers

problem flashing bootloader to ATMega328PB

(1/4) > >>

AndyNZ:
Hi all,

I've created my first simple microcontroller PCB and had 2 prototypes printed and assembled by JLCPCB. It is a simple serial controlled switch for a 12V solenoid valve, I'm using one of the outputs of the ATMega to drive a MOSFET (AO3400A), with some buttons and status LEDs (see attached schematic)
I've included a ISP header basically according to the MiniCore wiring diagram (MOSI,MISO,SCK,RST,VCC and GND), and tried to flash the bootloader according to the instructions at the MiniCore Github, but am only getting the following error:
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
I haven't connected the 12V power or solendoid valve, yet, but this would not affect the flashing process I hope.

I've used an external 16 MHz resonator on XTAL1 and 2 (CSTCE16M0V53-R0, LCSC C32180), I thought I had seen this being successfully used with an ATMega328 before, but I'm not sure if this may be the issue.
I've also tried to flash the bootloader with the internal 8MHz clock option, same error.

Any advice would be much appreciated.
Thanks,
Andreas

Ian.M:
Lets see the rest of the schematic so we can eliminate possible conflicts on the ISP pins, or problematic /Reset circuits.

What AVR programmer are you using?
Paste the *full* AVRdude command line so we can confirm the options used.

Check target VCC - If your programmer isn't powering the target, MISO would be held low by its internal protection diodes, resulting in all zeros response to any attempt to read the device ID.

AndyNZ:
Thanks for your reply, and yes, I did forget to add some crucial information: I'm using a Uno R3 as ISP, the target board is hooked up to its ISP header.
It seems I've accidentally overwritten the schematic with some modifications, but I've attached the PCB layout, maybe that makes it a bit clearer.


The full error message:
Arduino: 1.8.15 (Windows 10), Board: "ATmega328, Yes (UART0), EEPROM retained, 328PB, BOD 2.7V, LTO disabled, External 16 MHz"
avrdude: Version 6.3-20201216
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch
         System wide configuration file is "C:\Users\1520004\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf"
         Using Port                    : COM8
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328PB
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 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
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
       Double check connections and try again, or use -F to override this check.
avrdude done.  Thank you.
Error while burning bootloader.
Error while burning bootloader.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Ian.M:
Confirm the AVR is fitted in the correct orientation with all pins properly soldered and no bridges between pins.
Connect AVCC to VCC (see datasheet sect. 5.1.8 ).
Confirm you are actually getting 5V at the VCC pin!

AndyNZ:
Thanks for the pointers, the 328PB chip is soldered in correctly by JLCPCB assembly service, I've continuity tested the connections, that seems all OK. But I haven't connected AVCC at all, that would probably do it?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod