Flash Arduino pro mini and change fuses


  • Hardware Contributor

    Perhaps you guys can help me on my odyssee towards a pro mini with lower BOD level (1.8V) and my own program on it for my battery sensor.
    I bought some arduino pro minis and programmed them via a serial-usb-converter. Everything working fine. They did shut down when the voltage fell under 2.7V so I had to change the efuse to set the bod level down.
    I connected the pro mini to an arduino uno with the ISP sketch and a small cap between ground and reset and then fired up avrdude on the commandline.

    Running this worked and changed the fuses:

    avrdude -c avrisp -p m328p -P COM5 -b 19200 -U lfuse:w:0xff:m -U hfuse:w:0xda:m -U efuse:w:0x06:m
    

    Unfortunately I had some problems with the efuse earlier (the calculator said efuse = 0xFE, but that doesn't get verified. The problem is that undefined bits are set to 0 instead of 1. With 0x06 everything works). So I ran avrdude with -e to erase everything before changing the fuses. That might have bricked something I fear.
    So while changing the fuses still works and the leds start to blink at the low battery voltage everything the mini does is flashing the led (not the power one, the other) about every 1-2s regularly). When trying to upload a sketch via the arduino IDE V1.0.3 I get an

    avrdude: stk500_getsync(): not in sync: resp=0x1c
    

    error. I also created my own board in the boards.txt copying the normal one and changing the fuses:

    ##############################################################
    
    pro328.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328 BOD 1.8V
    
    pro328.upload.protocol=arduino
    pro328.upload.maximum_size=30720
    pro328.upload.speed=57600
    
    pro328.bootloader.low_fuses=0xFF
    pro328.bootloader.high_fuses=0xDA
    pro328.bootloader.extended_fuses=0x06
    pro328.bootloader.path=atmega
    pro328.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
    pro328.bootloader.unlock_bits=0x3F
    pro328.bootloader.lock_bits=0x0F
    
    pro328.build.mcu=atmega328p
    pro328.build.f_cpu=8000000L
    pro328.build.core=arduino
    pro328.build.variant=standard
    

    and burned the bootloader again from the IDE. Nothing changed.
    I also tried the 1.6.4 IDE but there I only get this error:

             Using Port                    : COM5
             Using Programmer              : arduino
             Overriding Baud Rate          : 57600
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x75
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x1c
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c
    
    avrdude done.  Thank you.
    
    

    What did I do wrong? How do I get my arduino up and running? Thanks for the help!


  • Hardware Contributor

    And the "strangeness" continues....

    I found this post and therefore tried it with a lower baud rate. The standard settign in the arduino IDE is 57600 but that doesn't work with avrdude either. Only 19200.

    So I changed the settings posted above to use 19200 and used the 1.0.3 IDE to burn the new bootloader. That worked so I upladed the blink sketch, which also worked. Yeah 😉 Now I tried to upload my mysensors testsketch (temp/humidity sensor that only sends random numbers) and got:

    avrdude: verification error, first mismatch at byte 0x0002
             0x69 != 0x61
    avrdude: verification error; content mismatch
    

    Whats happening??
    I now there are some problems with the old IDEs and mysensors, so I tried 1.6.4 but there I get the out of sync error from above because it's still using the 57600 baudrate. Is there any way to add my custom board to 1.6.4? I coudn't find any?

    I really want this to work though. Any ideas guys?


  • Hardware Contributor

    So using "upload with programmer" from the newer IDE has worked. The pro mini is up and running again.
    I still don't get why changing the fuses destroyes the serial communication though... How do you guys are doing this? I am not the first one here wanting to build a battery powered mini based sensor?!



  • I haven't actually yet tried to run one at lower voltages, but I recall from looking into it a bit that you can't run at 8Mhz below 2.4v. I think 4Mhz was the max at 1.8 (but that's from memory so might check) -- but to do that would require a new crystal. Hence why most often people will jump down to 1Mhz using the internal osc. But at that speed you probably can't do 57600, and will probably want to go lower, 19200 or 9600 or something.

    Google should find you some more detailed info, or even just a search on this forum for low power and 1Mhz or similar.


  • Hardware Contributor

    I've low power hacked APM and bare bone 328p. As I think I've linked from here, at 1MHz (internal) 9600 baud was the maximum and each baud rate required their own bootloader version. To do it easy I just used precompiled Optiboot for this.


  • Hardware Contributor

    @m26872 said:

    I've low power hacked APM and bare bone 328p. As I think I've linked from here, at 1MHz (internal) 9600 baud was the maximum and each baud rate required their own bootloader version. To do it easy I just used precompiled Optiboot for this.

    Thanks you, thats a very interesting read! I will try some of that myself.


Log in to reply
 

Suggested Topics

  • 87
  • 7
  • 10
  • 5
  • 2
  • 3

58
Online

11.4k
Users

11.1k
Topics

112.7k
Posts