0

Hi and thank you reading my question !

I need for my projects to design as small as i can. Both the skills, and the hardware counts. So i can't use a DIP package for them, and i have gone for a TQFP package. The point is to programm a TQFP ATmega328P using an external board without soldering it, which plugs into a Arduino UNO. Like that no need to constantly check the connection and everything. The shield is a basically a fat Arduino Pro Mini, with all the options available (3.3V/5V, 8MHz/16MHz, Sparkfun FTDI can be connected, ...) as shown below :

enter image description here

As you can see I am the enginneer of Gymetrics, but not an electronic enginner nor a programmer ... I actually did some mistakes designing it with the SS pin pins connected together and not the one of the Arduino UNO to the reset pin of the target, and added a capacitor in the wrong place. I did manage to connect the pin 10 of the Arduino to the reset pin of the target on another shield and take out that capacitor. When you order one you got tens of them at the minimum ...

As the schematic is the same as the Mini, and i don't think it's needed. I know that burn in sockets already exists, but because you to reverse enginneer the pins to make it works, i prefered design my own. Ok sorry for that long introduction, but i prefered you to know the full reflexion. As you imagine, i've been searching on so many forum, tutoriels, and so ever to do it and still it doesn't work.

As it is the first time i burn a bootloader into an ATmega328P, i am not confident in what i am doing. So i tried to burn a bootloader into an Arduino Pro Mini, it works fine. I'm happy on a point : I know how to follow a step by step procedure !

The microcontroller i use (ATmega328P) is the same as the one on the Arduino Pro Mini, so the configuration in the Arduino IDE is the same. However, when the work is done easily with the Arduino Pro Mini, it doesn't work with my board. Here is what the IDE errors shows :

Arduino : 1.8.12 (Windows 10), Carte : "Arduino Pro or Pro Mini, ATmega328P (3.3V, 8 MHz)"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files 
(x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM7 -b19200 -e - 
Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

 avrdude: Version 6.3-20190619
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files 
 (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : COM7
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     AVR Part                      : ATmega328P
     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
       efuse          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

     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 = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDA"
avrdude: writing hfuse (1 bytes):

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files         (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM7 -b19200 -    Uflash:w:C:\Program Files     (x86)\Arduino\hardware\arduino\avr/bootloaders/atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex:i -    Ulock:w:0x0F:m 
Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDA:
avrdude: load data hfuse data from input file 0xDA:
avrdude: input file 0xDA contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.03s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.01s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.


avrdude: Version 6.3-20190619
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Program Files     (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

     Using Port                    : COM7
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     AVR Part                      : ATmega328P
     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
       efuse          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

     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)

Erreur lors de la gravure de la séquence d'initialisation.
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.

Something very weird is that it reads the first and second time the right signature, and it's what i understand reading the error, and then doesn't read the signature anymore. If i try to burn again the bootloader, it can't read the signature anymore. I don't know what i am missing here.

What should i do ? I'm gonna try soldering an ATmega328P directly to see if it's a problem in the socket, but i don't think it is as it is working in the first communications.

Thank you !

EDIT

Programming interface :

UNO               Target

10                RST
11                MOSI
12                MISO
13                SCK
  • What is your programming interface connections? Pro Mini often need the DTR pin for programming. – hcheung May 5 at 14:25
  • I do not use the DTR pin on the Pro Mini to burn the bootloader. I directly plug the reset of the pro mini (target) to the pin 10 of the UNO. – Hugo Vernier-Lambert May 5 at 14:28
  • Just give it a try. DTR ensure there is a short single pulse while the timing for reset may not work, plus it could have the multiple bouncing effect. When I programming Pro Mini, reset never works while DTR will. – hcheung May 5 at 14:40
  • With the DTR pin instead of the reset pin, i get a wrong device signature changing every time, but better than nothing. It never reads 0x000000 anymore, but some random bytes : 0x0000FF or 0x000007 or 0x00FF00 – Hugo Vernier-Lambert May 5 at 14:55
  • 1
    The first time the fuses are still in the factory default settings. That is; internal oscillator. After setting the fuses to the values you specifies, the chip uses the external crystal. The fact that you don't get a response could indicate a problem with the crystal (or it's loading capacitors). Looking at your board it seem like you added the option to change crystals by moving jumpers. However in the picture there are no jumpers present. – Gerben May 5 at 15:12
1

Problem solved, i did put two capacitors way to big on the XTAL's pins, which was making the crystal unable to resonate.

Thanks to @Wirewrap for finding the mistake

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.