ATMega1284P Flashes bootloader but nothing else

Hi,

I have just finished making 4 boards based on the ATMega1284P.

The issue I am having is I have flash the bootlader onto the 4 boards and this seems to work fine while using a pro mini arduino as the ISP but if I try and upload a blink sketch via the ISP it just errors out not in sync

Trying via the FT232 USB - serial on the board also throws the error not in sysnc.

I have tried 2 USB cables, There is no issue uploading to an UNO board, The 1284P have been set to external 16Mhz and I have checked and there is a 16Mhz clock.

I managed to upload a programme to one board by USB/Serial but now it refuses to do anything.

The 4 boards are idential and I have tripple checked the wiring and checked the reset resistor/cap but I cannot for some reason get any of them to upload.

I understand its a high chance of a me issue, but I am stuck as to why it worked a few times over USB/serial and now no longer works.

Any idea of where to go would be much appreated. Below are the images of the PCB, Schematic, and IDE after a bootloader burn.

avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         MightyCore\hardware\avr\3.0.1\avrdude.conf

         Using Port                    : COM11
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash                  65    10   128    0 yes    131072  256    512  4500  4500 0x00 0x00
           lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
           hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
           efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
           lock                    0     0     0    0 no          1    1      0  9000  9000 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 = 0x1e9705 (probably m1284p)
avrdude: erasing chip

avrdude: processing -U lock:w:0xff:m
avrdude: reading input file 0xff for lock
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lock ...
avrdude: 1 byte of lock written
avrdude: verifying lock memory against 0xff
avrdude: 1 byte of lock verified

avrdude: processing -U efuse:w:0xfd:m
avrdude: reading input file 0xfd for efuse
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte efuse ...
avrdude: 1 byte of efuse written
avrdude: verifying efuse memory against 0xfd
avrdude: 1 byte of efuse verified

avrdude: processing -U hfuse:w:0xd7:m
avrdude: reading input file 0xd7 for hfuse
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte hfuse ...
avrdude: 1 byte of hfuse written
avrdude: verifying hfuse memory against 0xd7
avrdude: 1 byte of hfuse verified

avrdude: processing -U lfuse:w:0xf7:m
avrdude: reading input file 0xf7 for lfuse
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lfuse ...
avrdude: 1 byte of lfuse written
avrdude: verifying lfuse memory against 0xf7
avrdude: 1 byte of lfuse verified

avrdude done.  Thank you.

"

avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         \MightyCore\hardware\avr\3.0.1\avrdude.conf

         Using Port                    : COM11
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash                  65    10   128    0 yes    131072  256    512  4500  4500 0x00 0x00
           lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
           hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
           efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
           lock                    0     0     0    0 no          1    1      0  9000  9000 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 = 0x1e9705 (probably m1284p)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.
avrdude: erasing chip

avrdude: processing -U Local\Arduino15\packages\MightyCore\hardware\avr\3.0.1/bootloaders/urboot/atmega1284p/watchdog_1_s/autobaud/uart0_rxd0_txd1/led+b0/urboot_atmega1284p_pr_ee_ce.hex:i
avrdude: reading input Local\Arduino15\packages\MightyCore\hardware\avr\3.0.1/bootloaders/urboot/atmega1284p/watchdog_1_s/autobaud/uart0_rxd0_txd1/led+b0/urboot_atmega1284p_pr_ee_ce.hex for flash
         with 396 bytes in 2 sections within [0x1fe00, 0x1ffff]
         using 2 pages and 116 pad bytes
avrdude: writing 396 bytes flash ...
Writing | ################################################## | 100% 0.16s
avrdude: 396 bytes of flash written
avrdude: verifying flash memory against Arduino15\packages\MightyCore\hardware\avr\3.0.1/bootloaders/urboot/atmega1284p/watchdog_1_s/autobaud/uart0_rxd0_txd1/led+b0/urboot_atmega1284p_pr_ee_ce.hex
Reading | ################################################## | 100% 0.00s
avrdude: 396 bytes of flash verified

avrdude: processing -U lock:w:0xff:m
avrdude: reading input file 0xff for lock
         with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lock ...
avrdude: 1 byte of lock written
avrdude: verifying lock memory against 0xff
avrdude: 1 byte of lock verified

avrdude done.  Thank you.


This to me seems it worked, but USB / Serial will not sync and a direct go with the ISP has the same error and that doesnt require the bootloader.

urclock_getsync() warning: attempt 1 of 10: not in sync

The 1284P has a solid 5V and cermaics on all power pins, Reset is pulled up by 10K, 100nF cap to the FT Chip for reset.

There is a bus level shifter that shares the SPI lines, but I wouldnt think this affects the ISP since its all outgoing on that bus, No MISO



Try adding a protection diode from the reset pin to 5V. The 100nF capacitor may create a high-voltage spike that makes the ATmega1284P enter HVPP (High-voltage parallel programming) mode.

Have a look at this board and its schematics on Tindie as a reference. I've been selling these for years, and they work great with the Urboot bootloader as well.

Thankyou for the reply.

I have tried this with two signal diodes on the ISP header reset and this seems to work so that's a good sign but only for 2 of the 4 boards so far, but it seems I have other issues to look through.

One board uplaods but wont run the sketch, though the skecth will run on another 1284P and two boards will no upload over the ISP or bootlaoder ( it was flashed first time wihtout issue ) now they respond device signature = 0x000000 so there is no comunication.

The first board I built and did have working just ends up with ; 1 of 10: not in sync and failes to work over ISP aswell.

So for the moment 1 of the 4 boards runs as expected.

Going foward I still cannot get the 4 boards to play so I am going to try going back to my 328P build since this seems to be working fine, I had chosesn the 1284P for more code space since im near 75% on the 328P but I'm sure it's able to be lowerd.

I must have missed something but cannot seem to find it, just odd they did work and now are fussy or non responsive.

The upload issues you're facing are likely related to the reset pulse timing, and Avrdude 7.2 that MightyCore currently uses are pretty strict when it comes to component selection. Things have been smoothed out in Avrdude 7.3, but no statically linked binaries I can bundle with the core have been released yet, but I'll assume it will be a couple of weeks.

In the meanwhile, you may downgrade to the older Optiboot bootloader. Just install the latest MightyCore v2.x version, and burn the bootloader again. However, I'll recommend you to go back to v3.x once a new version (with Avrdude v7.3 bundled).

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.