Hi,
I have been programming smd 32 pins atmega328p’s for a while and everything worked perfect until I might have misclicked or misplugged something tonight. It is chaos. I manage to upload, but my upload times are super slow.
Here is a verbose upload
avrdude: Version 6.3, compiled on Sep 12 2016 at 17:24:16
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\Jean-Christophe\.platformio\packages\tool-avrdude\avrdude.conf"
Using Port : usb
Using Programmer : atmelice_isp
Overriding Baud Rate : 115200
avrdude: usbdev_open(): Found Atmel-ICE CMSIS-DAP, serno: J42700010786
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
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 : JTAG3_ISP
Description : Atmel-ICE (ARM/AVR) in ISP mode
Vtarget : 5.0 V
SCK period : 8.00 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FF
avrdude: erasing chip
avrdude: reading input file ".pio\build\ATmega328P\firmware.hex"
avrdude: writing flash (1884 bytes):
Writing | ################################################## | 100% 0.55s
avrdude: 1884 bytes of flash written
avrdude: verifying flash memory against .pio\build\ATmega328P\firmware.hex:
avrdude: load data flash data from input file .pio\build\ATmega328P\firmware.hex:
avrdude: input file .pio\build\ATmega328P\firmware.hex contains 1884 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.54s
avrdude: verifying ...
avrdude: 1884 bytes of flash verified
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK (E:FF, H:D9, L:62)
avrdude done. Thank you.
========================================================== [SUCCESS] Took 12.85 seconds ==========================================================
I am not sure what caused the problem. It is not just the chip, because I get the same problem for every new chip I try to upload to. It is either my platformIO setup with fuses or whatever that changed or my atmel ICE itself (maybe its broken?) I have 3 ideas.
-
I had my atmega and everything hooked up at 3v3 and had an I2C LCD. SDA and SCL were at 3v3 but I decided to plug the VCC at 5v. Maybe the SDA and SCL pins of the LCD at 5v bugged something on the chip or even on the atmel ICE?
-
Maybe I clicked on set fuses and something changed in the code/ICE
-
Maybe it has something to do with that safemode in my upload script. I do not recall seeing this before.
Here is my .ini when uploading with ICE: I added the two last lines after the bug in hope it would resolve but no. (Anyway [env:ATmega328P] doesn’t even recognize oscillator = external)
[env:ATmega328P]
platform = atmelavr
board = ATmega328P
framework = arduino
upload_protocol = atmelice_isp
upload_flags = -e
upload_port = usb
board_build.f_cpu = 16000000L
oscillator = external
Also, is there memory on the atmel ICE? Like does it save how to set fuses when it uploads or it is entirely up to PlatformIO? Im just really scared I broke my ICE. Its too expensive to buy a new one… Thanks!