Problem with Arduino Pro Mini Fuse Bits

Hey

So recently, i've bought an arduino pro mini 3.3v. For the first time i connected it to my pc using PL2303 USB-TO-TTL Adapater and uploaded an blink sketch to it.
Right after that, i wanted to upload something else and i was getting "avrdude: stk500_getsync(): not in sync: resp=0x00"
I did some search on the internet and tried to program it using USBASP programmer or an arduino uno as ISP. Using both way, i got no result because apparently the chip signature was changing every time i applied voltage to the board (which was either 5v or 9v to the raw pin).
So i used the "ProgISP" program and tried to write the default fuse bits in case that solves the problem. Suddenly i noticed the fuse bits change constantly (every time i pressed "Read" i was getting a new set of fuse bits!) and after a few tries i was getting "Chip enable program error" which i guess is because change of CKSEL fuse bits.
Now i cant burn the bootloader, or upload using programmer because i am getting :

Arduino: 1.8.9 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (3.3V, 8 MHz)"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         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 : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: error: program enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Error while burning bootloader.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Since Arduino Pro Mini's ATMEGA328P is not dip, is there anyway i can connect external crystal OR HV program it to reset fuse bits or should i buy a new arduino? :frowning:

Regards

It seems odd to me you were able to upload a sketch and then immediately could not load any more sketches. Reading the fuses differently each time may indicate a wiring problem.
Did you solder the pins to the Pro Mini in order to use it and to program it?

"Can only upload once" is often an indication that the auto reset circuit is not working correctly. That's even more likely to happen with the Pro Mini, where you have the chance of incorrectly connecting the external USB to TTL serial adapter (or getting one of the cheapo ones that don't even break out the DTR pin).

However, that wouldn't explain the fuse bits changing, so this may indicate a different problem.

Another thing to consider is you have uploaded to your 3.3V board using the 5V Processor settings in the board menu.
I have done the opposite a couple of times of uploading using 3.3V Processor settings to a 5V board.
To recover this is a PITA but basically you need to double tap the reset button just as you upload a sketch. Getting the timing correct can be a pain, especially if your board goes to sleep just after power on like mine do.
Clipboard-1.jpg

Clipboard-1.jpg

Thanks for the quick responses.

dmjlambert:
It seems odd to me you were able to upload a sketch and then immediately could not load any more sketches. Reading the fuses differently each time may indicate a wiring problem.
Did you solder the pins to the Pro Mini in order to use it and to program it?

Yep, i've soldered pin header and the soldering is quite good which means all the pins are correctly soldered to the board.
I've attached pic of the board.

About fuse bits i've read it somewhere that insufficient voltage can cause this. Basically i was giving 3.3V to VCC pin, now i am trying 9V to RAW pin in case 3.3V was not enough (because of you know, ohm law and loss of voltage which may result in input voltage lower than 3.3V) for the board to run.

pert:
"Can only upload once" is often an indication that the auto reset circuit is not working correctly. That's even more likely to happen with the Pro Mini, where you have the chance of incorrectly connecting the external USB to TTL serial adapter (or getting one of the cheapo ones that don't even break out the DTR pin).

However, that wouldn't explain the fuse bits changing, so this may indicate a different problem.

Can you elaborate this? the only time i was able to upload i connected TX, RX to the RXO TXO pins and 3v3 GND to the corresponding pins. However my USB TO TTL does not have a reset pin and i use the "RST" pin of Arduino pro mini when programming it with USBASP or Another UNO as ISP (Which i've never managed to get working)
In this case whats is the difference between RST pin and DTR?

Riva:
Another thing to consider is you have uploaded to your 3.3V board using the 5V Processor settings in the board menu.
I have done the opposite a couple of times of uploading using 3.3V Processor settings to a 5V board.
To recover this is a PITA but basically you need to double tap the reset button just as you upload a sketch. Getting the timing correct can be a pain, especially if your board goes to sleep just after power on like mine do.
Clipboard-1.jpg

Will that reset the fuse bits or solve the problem? I've done something similar with MKRFOX1200 where the COM port was changing right after upload (i had to press reset button once or twice while uploading)
I'm gonna try this with USBASP and USB-TO-TTL adapter and check if it works or not.

Another thing:

When i connect the pro mini board to usbasp via pins 11 12 13 and GND RST (Not VCC), the board powers on and i see both red LEDs turn on. Is this normal? Since the RAW or VCC pins are not connected to anywhere and this means the board is getting power through one of 11 12 13 or RSTpins.

Ignore my post, just realized your using pro mini and not pro micro. Totally different MCU.

Albis:
However my USB TO TTL does not have a reset pin and i use the "RST" pin of Arduino pro mini when programming it with USBASP or Another UNO as ISP (Which i've never managed to get working)
In this case whats is the difference between RST pin and DTR?

In order to upload, the bootloader needs to be activated. This is done by resetting the microcontroller. However, the bootloader only runs for a short time before timing out and switching to running your sketch so the reset has to be timed just right during the upload. Normally, we have an auto-reset circuit set up that resets the microcontroller at just the right time during the upload. The auto reset circuit consists of the DTR or RTS (note, it's RTS not "RST") on the USB to TTL serial adapter chip connected to the reset pin (marked RST on the Pro Mini) via a 0.1 uF capacitor. You can use either DTR or RTS, it doesn't matter which. This converts the signal on the DTR or RTS pin into a reset pulse at the right moment of the upload. You can't connect the DTR or RTS pin of the USB to TTL serial adapter directly to the Pro Mini's RST pin because then you'd be missing the capacitor. You need to connect the DTR or RTS pin of the USB to TTL serial adapter to the pin marked "GRN" on the Pro Mini. Note this is a different pin from the one marked "GND". The "GRN" pin is so marked because on the FTDI cables that were commonly used when the Pro Mini first came out the DTR or RTS pin was a green wire.

Some poorly designed USB to TTL serial adapters didn't bother to break out the DTR or RTS pins. If you have one of these, you'll need to manually reset your Pro Mini. When you don't have that auto-reset, and are resetting manually, you need to get the timing right. If you press the reset button too early, the bootloader will have already timed out by the time the upload starts. The tricky thing is that when you press the "Upload" button in the Arduino IDE, it first compiles your sketch before starting the actual upload. So you need to wait until after the compilation finishes before pressing the reset button. The way to get the timing right is to watch the black console window at the bottom of the Arduino IDE window. As soon as you see something like this:

Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

press and release the reset button.

When you get a new Pro Mini, there is no sketch installed. That causes the bootloader to run constantly. For that reason, you can do the first upload to a new board without a reset, but on all subsequent uploads there is a sketch on the board and the bootloader now times out so you need the reset.

pert:
In order to upload, the bootloader needs to be activated. This is done by resetting the microcontroller. However, the bootloader only runs for a short time before timing out and switching to running your sketch so the reset has to be timed just right during the upload. Normally, we have an auto-reset circuit set up that resets the microcontroller at just the right time during the upload. The auto reset circuit consists of the DTR or RTS (note, it's RTS not "RST") on the USB to TTL serial adapter chip connected to the reset pin (marked RST on the Pro Mini) via a 0.1 uF capacitor. You can use either DTR or RTS, it doesn't matter which. This converts the signal on the DTR or RTS pin into a reset pulse at the right moment of the upload. You can't connect the DTR or RTS pin of the USB to TTL serial adapter directly to the Pro Mini's RST pin because then you'd be missing the capacitor. You need to connect the DTR or RTS pin of the USB to TTL serial adapter to the pin marked "GRN" on the Pro Mini. Note this is a different pin from the one marked "GND". The "GRN" pin is so marked because on the FTDI cables that were commonly used when the Pro Mini first came out the DTR or RTS pin was a green wire.

Some poorly designed USB to TTL serial adapters didn't bother to break out the DTR or RTS pins. If you have one of these, you'll need to manually reset your Pro Mini. When you don't have that auto-reset, and are resetting manually, you need to get the timing right. If you press the reset button too early, the bootloader will have already timed out by the time the upload starts. The tricky thing is that when you press the "Upload" button in the Arduino IDE, it first compiles your sketch before starting the actual upload. So you need to wait until after the compilation finishes before pressing the reset button. The way to get the timing right is to watch the black console window at the bottom of the Arduino IDE window. As soon as you see something like this:

Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.

Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.



press and release the reset button.

When you get a new Pro Mini, there is no sketch installed. That causes the bootloader to run constantly. For that reason, you can do the first upload to a new board without a reset, but on all subsequent uploads there is a sketch on the board and the bootloader now times out so you need the reset.

Thanks man, this explains the situation. Right now i've managed to program the board with USBASP (obviously it has a reset pin) but not the USB TO TTL because it does not have one. As you just explained i am getting "out of sync" problem when trying with USB TO TTL.

Anyways i guess the problem is kinda solved. I managed to upload the blink example.
However for some reason the Pro Mini's clock is not 8MHZ but way lower. (fuse bits, i assume)
According to this link default fuse bits for 328P 8Mhz 3.3 should be 0xFF 0xDA 0x05. However when i press the "default fuse bits" in the ProgISP Software i get 0x62 0xD9 0xFF.
I've tried to write FF DA 05 in the chip, but right after writing, whenever you press the "read fuse bits" button you get random HighValue and ExtValue which is frustrating.

For the right clock value, I've chose E2 D9 FF which sets the clock on INT RC OSC 8MHz, disables clock divide and brownout sets boot flash to 2048 and disables all locks.
I've no idea why the default fuse bits enable "Divide clock by 8 internally"

Anyways problem solved. If anyone got the same problem just try everything that has been mentioned here.

Albis:
Right now i've managed to program the board with USBASP (obviously it has a reset pin) but not the USB TO TTL because it does not have one.

The USBasp uses a different system for programming the microcontroller that doesn't use the bootloader. In fact, when you program the microcontroller with the USBasp it erases the bootloader. This means you can't upload to the Pro Mini using your USB to TTL serial adapter until you've flashed the Pro Mini with a bootloader again.

Albis:
According to this link default fuse bits for 328P 8Mhz 3.3 should be 0xFF 0xDA 0x05. However when i press the "default fuse bits" in the ProgISP Software i get 0x62 0xD9 0xFF.

The 0xFF 0xDA 0x05 are the default fuse values for the Pro Mini as defined by Arduino:

The 0x62 0xD9 0xFF is probably the factory default values the bare chips come with from the manufacturer. During the assembly process of the Pro Mini the fuse values are updated and the bootloader is installed so the Pro Mini's manufacturer can set any default fuse values they like.