Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:21 02 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : Mab1's wiseguy inverter build - transformer options

     Page 6 of 6    
Author Message
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1816
Posted: 12:04am 29 Apr 2025
Copy link to clipboard 
Print this post

No, I think the IDE version of AvrDude and more importantly the Configuration file has been modified to run with how Arduino IDE wants the bits set.

The information from the later versions is superior in every way. I believe the IDE settings for the configuration file could stopping you from setting some of the Lock Bits.

Notice the absence of other fuse access reads apart from what we requested it to do.

Reading | ################################################## | 100% 0.00 s
avrdude: device signature = 0x1e950f (probably m328p)

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 ...
Writing | ################################################## | 100% 0.00 s
avrdude: 1 byte of lock written
avrdude: verifying lock memory against 0xFF
avrdude: reading on-chip lock data ...
Reading | ################################################## | 100% 0.00 s
avrdude: verifying ...
avrdude: 1 byte of lock verified

avrdude done.  Thank you.

The above is straight from the command line batch.

I think we can modify the paths to the later version of  Avrdude and its config to solve this
.
Edited 2025-04-29 10:05 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1816
Posted: 12:17am 29 Apr 2025
Copy link to clipboard 
Print this post

Here is the Full output from the two fuse commands.  
D:\A_Varoius Backup Folders\__NANO\Avrdudess Loader>avrdude -c usbasp-clone -p m328p -P usb -b 57600 -F -v -v -U lfuse:w:0xFF:m -U hfuse:w:0xD7:m -U efuse:w:0xFD:m

avrdude: Version 7.3
        Copyright the AVRDUDE authors;
        see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

        System wide configuration file is D:\A_Varoius Backup Folders\__NANO\Avrdudess Loader\avrdude.conf

        Using port            : usb
        Using programmer      : usbasp-clone
        Setting baud rate     : 57600
avrdude: seen device from vendor >www.fischl.de<
avrdude: seen product >USBasp<
        AVR Part              : ATmega328P
        Programming modes     : ISP, HVPP, debugWIRE, SPM

        Memory        Size  Pg size
        ---------------------------
        eeprom        1024        4
        flash        32768      128
        efuse            1        1
        hfuse            1        1
        lfuse            1        1
        lock             1        1
        signature        3        1
        calibration      1        1
        io             224        1
        sram          2048        1

        Variants         Package  F max   T range         V range
        ----------------------------------------------------------------
        ATmega328P       N/A      20 MHz  [-40 C,   N/A]  [1.8 V, 5.5 V]
        ATmega328P-15MZ  MLF32    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-AN    TQFP32   20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-ANR   TQFP32   20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-AU    TQFP32   20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-AUR   TQFP32   20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MMH   MLF28    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MMHR  MLF28    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MN    QFN32    20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-MNR   MLF32    20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-MU    MLF32    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MUR   MLF32    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-PN    PDIP28   20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-PU    PDIP28   20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]

        Programmer Type       : usbasp
        Description           : Any usbasp clone with correct VID/PID
avrdude: auto set sck period (because given equals null)
avrdude usbasp_spi_set_sck_period() error: cannot set sck period; please check for usbasp firmware update
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01 s
avrdude: device signature = 0x1e950f (probably m328p)

avrdude: processing -U lfuse:w:0xFF:m
avrdude: reading input file 0xFF for lfuse
        with 1 byte in 1 section within [0, 0]
avrdude: writing 1 byte lfuse ...
Writing | ################################################## | 100% 0.00 s
avrdude: 1 byte of lfuse written
avrdude: verifying lfuse memory against 0xFF
avrdude: reading on-chip lfuse data ...
Reading | ################################################## | 100% 0.00 s
avrdude: verifying ...
avrdude: 1 byte of lfuse 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 ...
Writing | ################################################## | 100% 0.00 s
avrdude: 1 byte of hfuse written
avrdude: verifying hfuse memory against 0xD7
avrdude: reading on-chip hfuse data ...
Reading | ################################################## | 100% 0.00 s
avrdude: verifying ...
avrdude: 1 byte of hfuse 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 ...
Writing | ################################################## | 100% 0.00 s
avrdude: 1 byte of efuse written
avrdude: verifying efuse memory against 0xFD
avrdude: reading on-chip efuse data ...
Reading | ################################################## | 100% 0.00 s
avrdude: verifying ...
avrdude: 1 byte of efuse verified

avrdude done.  Thank you.

D:\A_Varoius Backup Folders\__NANO\Avrdudess Loader>avrdude -c usbasp-clone -p m328p -P usb -b 57600 -F -v -v -U lock:w:0xFF:m

avrdude: Version 7.3
        Copyright the AVRDUDE authors;
        see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

        System wide configuration file is D:\A_Varoius Backup Folders\__NANO\Avrdudess Loader\avrdude.conf

        Using port            : usb
        Using programmer      : usbasp-clone
        Setting baud rate     : 57600
avrdude: seen device from vendor >www.fischl.de<
avrdude: seen product >USBasp<
        AVR Part              : ATmega328P
        Programming modes     : ISP, HVPP, debugWIRE, SPM

        Memory        Size  Pg size
        ---------------------------
        eeprom        1024        4
        flash        32768      128
        efuse            1        1
        hfuse            1        1
        lfuse            1        1
        lock             1        1
        signature        3        1
        calibration      1        1
        io             224        1
        sram          2048        1

        Variants         Package  F max   T range         V range
        ----------------------------------------------------------------
        ATmega328P       N/A      20 MHz  [-40 C,   N/A]  [1.8 V, 5.5 V]
        ATmega328P-15MZ  MLF32    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-AN    TQFP32   20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-ANR   TQFP32   20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-AU    TQFP32   20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-AUR   TQFP32   20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MMH   MLF28    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MMHR  MLF28    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MN    QFN32    20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-MNR   MLF32    20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-MU    MLF32    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-MUR   MLF32    20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]
        ATmega328P-PN    PDIP28   20 MHz  [-40 C, 105 C]  [1.8 V, 5.5 V]
        ATmega328P-PU    PDIP28   20 MHz  [-40 C,  85 C]  [1.8 V, 5.5 V]

        Programmer Type       : usbasp
        Description           : Any usbasp clone with correct VID/PID
avrdude: auto set sck period (because given equals null)
avrdude usbasp_spi_set_sck_period() error: cannot set sck period; please check for usbasp firmware update
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s
avrdude: device signature = 0x1e950f (probably m328p)

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 ...
Writing | ################################################## | 100% 0.00 s
avrdude: 1 byte of lock written
avrdude: verifying lock memory against 0xFF
avrdude: reading on-chip lock data ...
Reading | ################################################## | 100% 0.00 s
avrdude: verifying ...
avrdude: 1 byte of lock verified

avrdude done.  Thank you.

NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
mab1
Senior Member

Joined: 10/02/2015
Location: United Kingdom
Posts: 237
Posted: 12:59am 29 Apr 2025
Copy link to clipboard 
Print this post

Hmm... i'm not so sure changing paths will work:

The paths (to avrdude and avrdude.conf) that work on the imac are via the arduino.app .
when i try setting the path to avrdude.exe in your unzipped directory, it won't run the .exe files. that's what i was trying previously.

Unless i run them via 'mono'?

Sorry - off to bed again - will have a think for tomorrow.
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1816
Posted: 01:08am 29 Apr 2025
Copy link to clipboard 
Print this post


NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1816
Posted: 06:26am 29 Apr 2025
Copy link to clipboard 
Print this post

Looks like the IDE config is setting Fuse Safe Mode. That means it will read the Fuses on entry, which your setup is doing, and reset any Fuse that change on Exit, once again seems to be doing that.

I've tested a few ideas and the best way to do this is to erase the Chip.

So don't wast time on trying anything else. Once you erase the chip, the Lock bits are cleared. These do not need to be programmed again.

ERASE:

-c usbasp-clone -p m328pb -P usb -b 57600 -F -v -v -U -e

Then upload the Hex File again and it should be fine.  
.
Edited 2025-04-29 16:50 by KeepIS
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
mab1
Senior Member

Joined: 10/02/2015
Location: United Kingdom
Posts: 237
Posted: 10:52pm 29 Apr 2025
Copy link to clipboard 
Print this post

Progress  

1st: I traced the problem on the WG30 power board (fault no output from one of the 12v isolated power supplies). I'm a bit embarrassed about it though.




Doh!    I must be getting old.

2nd: I found a version of zadig ( V2.2XP) which runs under xp (the version 2.7 included the win32 driver, but zadig2.7 won't run on win32   . Once I'd run that and set the right driver, avrdudess2.17 could see the usbasp  

So I plugged in the 2nd nano we've been trying to set the fuses on in terminal on the imac. Read the fuses and clicked the bit selector:-



So it looks like your imac command lines worked after all   and it was already right.

I plugged in the 1st nano with just the hex file, that I didn't try setting the fuses on - and it's bitselector map was correct too  

Just as a sanity check, I plugged in a fresh nano - straight out of its wrapper. Checked the bit selector, and the lockbits were set 0xCF

Tried to set them using avrdudess and got the same error I was getting on the imac yesterday:



Tried it a couple of times but the error seemed to repeat. So set the tick boxes to set lock when programming and uploaded the hex file. That seemed to set the lockbits :




But I don't know how the lockbits got cleared on the original nano - unless uploading the hex file on the imac erased them anyway?

No matter though - it looks like I can (finally) use either avrdudess on winxp or command line on the imac  
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1816
Posted: 11:10pm 29 Apr 2025
Copy link to clipboard 
Print this post

Great to find such an easy fix on the Power Board, although I bet you were secretly  happy to find that pin floating

Yes that is common problem with programming the Lock bits, when you upload the HEX with standard settings, the Flash is Erased first.

So, to erase the flash, the Lock bits are set to FF, after the upload, unless some other command is sneaked in, they remain off.

I found earlier versions AdrDudess do not return/display the Lock and general status bits correctly.

Normally you press each READ button twice (to be sure) and then press Bit Selector to display the results, but sometimes it's still incorrect

The Important Fuse Bit is EESAVE, it must be 0, this preserves your Settings when you upload a new Hex file.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
mab1
Senior Member

Joined: 10/02/2015
Location: United Kingdom
Posts: 237
Posted: 12:05am 30 Apr 2025
Copy link to clipboard 
Print this post





I'm going to have to get back to winding the transformer I guess    
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1816
Posted: 12:45am 30 Apr 2025
Copy link to clipboard 
Print this post

It's always a great feeling when all the effort and time we put in to assembling the Power boards and Controller produce what you hoped for

Yes, the dreaded Toriod - The hardest part of my Toroid winding is finding three Very early Solar Inverters for the Toriods, no winding except for 14 turns of 2G cable through 3 stacked Toroids, which takes all of 10 minutes to wind      

At least now you have the incentive to wind one
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
     Page 6 of 6    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025