Go Down

Topic: WEMOS D1 Mini Pro : AVRISP WiFi programmer (Read 107 times) previous topic - next topic

wagnerosss

Hi all,

Since few days I am struggling with some problems connected with ESP8266AVRISP library. Each time I get questions concerning "fuse changed!".

Overview
I have an old PCB based on ATmega32A, which I want to update via WiFi. The supply is 5V, so I prepared a small PCB with TXB0104, to fit the logical level for ESP8266 (in my situation it's Wemos D1 mini Pro). I connected the pins as follows:
SCK  D5
MISO  D6
MOSI  D7
RST  D1
TB0104_OE    D3 (through 10K resistor)
TB0104_VCCA    3V3
TB0104_VCCB    5V


Test
Using avrdude I launch this command:
Quote
avrdude -p m32 -c arduino -P net:10.0.2.196:328 -U flash:r:oldCode.hex:i -U eeprom:r:memory.eep:i -v
Then I get this:
Code: [Select]
avrdude: Version 6.2
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/pwg/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : net:10.0.2.196:328
         Using Programmer              : arduino
ioctl("TIOCMGET"): Inappropriate ioctl for device
ioctl("TIOCMGET"): Inappropriate ioctl for device
         AVR Part                      : ATmega32
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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         4    10    64    0 no       1024    4      0  9000  9000 0xff 0xff
           flash         33     6    64    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  2000  2000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         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.08s

avrdude: Device signature = 0x1e9502 (probably m32)
avrdude: safemode: hfuse reads as D1
avrdude: reading flash memory:

Reading | ################################################## | 100% 59.89s

avrdude: writing output file "oldCode.hex"
avrdude: reading eeprom memory:

Reading | ################################################## | 100% 67.57s

avrdude: writing output file "memory.eep"

avrdude: safemode: hfuse reads as 0
avrdude: safemode: lfuse changed! Was ef, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: hfuse changed! Was d1, and is now 0
Would you like this fuse to be changed back? [y/n] n
avrdude: safemode: Fuses OK (E:FF, H:D1, L:EF)
ioctl("TIOCMGET"): Inappropriate ioctl for device

avrdude done.  Thank you.


After the line with the device signature the hfuse value is correct, but on the end there is a change. Why?
I tried to program the AVR (not read) and then the chip was blocked, so I needed to reprogram it. I used then a NodeMCU V3 connected directly to ATmega (the chip was supplied by NodeMCU's 3.3V) and I didn't get any questions about the fuses. I don't know why. The logical converter must work, because it reads the device signature (if the OE pin is low, then there is no possibility to read the signature, so I assume that's the proof). Maybe you can explain me what's going on with it?

Best regards,
wagnerosss

pylon

My guess is that the sketch you loaded onto the ESP8266 doesn't support all necessary functions. As you failed to provide the relevant sketch code this is wild guessing.

wagnerosss

I took the board and tested it on different target (supply 5V, ATmega32A in DIP version). I loaded the same sketch and I don't have any questions about the fuses. Now I'm thinking that the supply can be the cause (actual target is power from USB, but the proper target is power by DC/DC converter with 2A current output; on input and output side there are capacitors recommended by converter datasheet). Is it possible that the wireless network (low quality of signal) can cause these problems?

pylon

Post a complete wiring diagram and the sketch you load onto the ESP.

Go Up