Clone experts? unable to upload to clone ATMega328

Hi Folks,

I have a few clone devices, specifically the ATMega328, seemingly the clone of the Micro / Mini.

The same code and application load onto the "Uno" (seemingly a clone also) but this device just will not receive the code. I had a post about it elsewhere in the forum (codes generated included 0x00 after 10 failed attempts).

I am looking to make the device usable, and I have seen things about trying to set in the Arduino app, the correct board (or most suited in this case) and to change the bootloader in use (done also) - but this hasnt allowed it to communicate either. Is anyone able to advise were I might be going wrong? is there a way to "inspect" the device to see what code / bootloader it is using / what the chipsets reflect, that will allow me to apply the appropriate configuration?

What PC Operating System are you using?

Have you installed the correct driver for the USB connection to the clone?

Please post a link that shows exactly what clone board you have.

...R

Hi Robin,

Using Windows 10 and Linux Mint also. with the Windows 10 its using the standard Prolific USB driver, on Linux I didn't provide a driver as its picking up the relevant files from within linux.

This is the exact board purchased which is having issues:

This one however is the second boar which arrived, and works perfectly, same code, same OS's, everything except the cable.

The FTDI cable works, as I shorted the TX/RX and tested with Putty, confirmed receiving the data, and the device is powered by the cable, so I know they work.

If you have an ICSP programmer like USBasp you may compare bootloader and fuses of both boards

It looks like the 328 board does not have a USB interface so the question of driver is irrelevant.

Nick Gammon has some useful diagnostic programs including one to identify the chip and another to upload a bootloader. But you will need an ICSP programmer - either the type mentioned in Reply #2 or an Arduino 328 with the ArduinoISP program installed (it comes with the Arduino IDE).

...R

Hi,
Have you tried Tx to Rx and Rx to Tx between the ProMini and the FTDI.

Programming a 5V Arduino Pro Mini
To use this programmer to program a 5V Arduino Pro Mini, do the following:

  • Connect to target Arduino board. Remember to set 5V/3.3V switch to 5V voltage! We recommend using a 6pin female to female cable for connecting to target board. See picture above showing programmer connected to Arduino Pro Mini.
  • Connect to USB port of PC running the Arduino IDE.
  • A notification on your computer should appear that driver was installed successfully. If not, see troubleshooting below.
  • In the Arduino IDE, select your target board in "Tools" --> "Board" menu. For this example, select "Arduino Pro or Pro Min".
  • In the Arduino IDE, select the programmer's port in "Tools" --> "Port" menu. Note that this might be a different port than what is used for programming other Arduino boards! If unsure, see troubleshooting below.
  • Program board in Arduino as normal (click on "Upload" button").

Programming a 3V Arduino Pro Mini
To use this programmer to program a 3.3V Arduino Pro Mini, do the following (see description above for note on programming 3.3V Pro Mini):

  • Ensure pro mini IS NOT connected to any circuit! This is very important, because this programmer will put 5V on the pro mini VCC pin, which is 3.3V under normal circumstances! Or, if connected to a circuit, ensure it will tolerate 5V on the Pro Mini VCC line! See description above for details!
  • Connect to target Arduino board. Remember to set 5V/3.3V switch to 3V3 side (text is a bit hidden under switch)! We recommend using a 6pin female to female cable for connecting to target board. See picture below showing programmer connected to Arduino Pro Mini.
  • Connect to USB port of PC running the Arduino IDE.
  • A notification on your computer should appear that driver was installed successfully. If not, see troubleshooting below.
  • In the Arduino IDE, select your target board in "Tools" --> "Board" menu. For this example, select "Arduino Pro or Pro Min".
  • In the Arduino IDE, select the programmer's port in "Tools" --> "Port" menu. Note that this might be a different port than what is used for programming other Arduino boards! If unsure, see troubleshooting below.
  • Program board in Arduino as normal (click on "Upload" button").

http://modtronix.com/pgm-ftdi-basic.html

Tom.. :slight_smile:

ard2dee2:
This is the exact board purchased which is having issues:

https://www.ebay.co.uk/itm/Pro-Mini-atmega328-5V-16Mhz-Arduino-Comp

It is a standard Pro Mini. It is the same as mine and is programmed with a D-Sun 2303HX USB to TTL adapter, which is probably available from the same source. I understand there are differences in the adapters, and there is some discussion about this in the forum.

TomGeorge:
Hi,
Have you tried Tx to Rx and Rx to Tx between the ProMini and the FTDI.

http://modtronix.com/pgm-ftdi-basic.html

Tom.. :slight_smile:

Hi Tom, not with that board, but I did short out the TX/RX an dusing putty an other tools, tested the comms. Type in a command its received, disconnect TX/RX and it stops, so I am confident the cable is OK. Is this particular device required as part of the process?

Nick_Pyner:
It is a standard Pro Mini. It is the same as mine and is programmed with a D-Sun 2303HX USB to TTL adapter, which is probably available from the same source. I understand there are differences in the adapters, and there is some discussion about this in the forum.

Tanks Nick, I will see if I can download the drivers for that specific adapter. I will also take a look and see if I can find these adapter discussions in a bit and see if I can find anything different.

Just looking at that adapter I was connecting a USB into the laptop, and its FTDI end direct onto those pins, rather than using a USB into the USB board, and then the pinout over to the mini?

Is it as stupid as I have 50% of the components only, which is why its not working?

ard2dee2:
Just looking at that adapter I was connecting a USB into the laptop, and its FTDI end direct onto those pins,

That sounds correct. But to avoid any ambiguity please make a simple pencil drawing showing how everything is connected and post a photo of the drawing. See this Simple Image Posting Guide

...R

Hi,
Are you connecting like this?

The connections to make from the FTDI FT232RL and the Pro Mini are:
GND --> GND
CTS --> GND
VCC --> VCC
TXD --> RXD
RXD --> TXD
DTR --> DTR

Tom.... :slight_smile:

Excuse the terrible “drawing”, but I include photos also. I tried swapping TX/RX over to see if that would help but it didn’t…
effectively, the picture just above the one you shared Tom (on that websites) is this, and this is what I am running:

attached scribble and photos in the PDF as one photo is double the allowance per post on attachments.

PDF.pdf (1.07 MB)

ard2dee2:
I tried swapping TX/RX over to see if that would help but it didn't...

Tx>Rx and Rx<Tx. Transmitters transmit to receivers, no exceptions.

Thanks NIck - I thought I had replied earlier, but I cant see it, apologies if this duplicates the post.

I have tried the following connection methods unsuccessfully:

GND > GND
VCC > VCC
TX > TX
RX > RX

GND > GND
VCC > VCC
TX > RX
RX > TX

sadly, it still comes up with the upload error 0x00?

The reason why I posted is that you are truly wasting your time with Tx>Tx. Transmitters don’t receive.

Since you are using a four wire TTL adapter, are you using the reset button?

(From some body else)…“You need to manually hold the reset button on the board just after you press the upload button in the IDE and wait until the progress bar gets to about 80% and stops while it waits for the Ardiuno
When the progress gets to 80% and stops getting higher, you release the reset on the mini arduino and it does the upload.”

Nick_Pyner:
The reason why I posted is that you are truly wasting your time with Tx>Tx. Transmitters don't receive.

The problem with that statement is that you inevitably run into a board that is labeled Tx on the Rx pin, and vise versa, because the person who made the board intends the labeling to mean "you need to connect your Tx line to this pin".

Hi,
You are only connecting Vcc, Gnd, Tx and Rx.
The instructions I posted list 6 connections, which your adapter does not have.
When I program Pro Mini I connect as per those instructions and have a 6 pin adapter.

If I get a chance later today, I will get a Pro Mini out and see if it will program with 4 pins.

Tom... :slight_smile:

Thanks Nick, I saw something about pressing reset once, so set it off, press then released reset - I havent tried holding reset down though, so will give that a go.

I also received another arduino, the micro with an micro-usb connection on the other end - so I can look to try that as well.

So its still not working on the mini with the FTDI USB, it keeps receiving the error below. In the meantime I will dig out the other device and see what I can do with it - despite hitting and holding reset...

Arduino: 1.8.12 (Linux), Board: "Arduino Mini, ATmega328P"

/home/james/Downloads/arduino-1.8.12/arduino-builder -dump-prefs -logger=machine -hardware /home/james/Downloads/arduino-1.8.12/hardware -tools /home/james/Downloads/arduino-1.8.12/tools-builder -tools /home/james/Downloads/arduino-1.8.12/hardware/tools/avr -built-in-libraries /home/james/Downloads/arduino-1.8.12/libraries -libraries /home/james/Arduino/libraries -fqbn=arduino:avr:mini:cpu=atmega328 -vid-pid=067B_2303 -ide-version=10812 -build-path /tmp/arduino_build_72843 -warnings=all -build-cache /tmp/arduino_cache_188754 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -verbose /home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino
/home/james/Downloads/arduino-1.8.12/arduino-builder -compile -logger=machine -hardware /home/james/Downloads/arduino-1.8.12/hardware -tools /home/james/Downloads/arduino-1.8.12/tools-builder -tools /home/james/Downloads/arduino-1.8.12/hardware/tools/avr -built-in-libraries /home/james/Downloads/arduino-1.8.12/libraries -libraries /home/james/Arduino/libraries -fqbn=arduino:avr:mini:cpu=atmega328 -vid-pid=067B_2303 -ide-version=10812 -build-path /tmp/arduino_build_72843 -warnings=all -build-cache /tmp/arduino_cache_188754 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=/home/james/Downloads/arduino-1.8.12/hardware/tools/avr -verbose /home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino
Using board 'mini' from platform in folder: /home/james/Downloads/arduino-1.8.12/hardware/arduino/avr
Using core 'arduino' from platform in folder: /home/james/Downloads/arduino-1.8.12/hardware/arduino/avr
Detecting libraries used...
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MINI -DARDUINO_ARCH_AVR -I/home/james/Downloads/arduino-1.8.12/hardware/arduino/avr/cores/arduino -I/home/james/Downloads/arduino-1.8.12/hardware/arduino/avr/variants/eightanaloginputs /tmp/arduino_build_72843/sketch/PWM_Pin_9_100__duty_cycle.ino.cpp -o /dev/null
Generating function prototypes...
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MINI -DARDUINO_ARCH_AVR -I/home/james/Downloads/arduino-1.8.12/hardware/arduino/avr/cores/arduino -I/home/james/Downloads/arduino-1.8.12/hardware/arduino/avr/variants/eightanaloginputs /tmp/arduino_build_72843/sketch/PWM_Pin_9_100__duty_cycle.ino.cpp -o /tmp/arduino_build_72843/preproc/ctags_target_for_gcc_minus_e.cpp
/home/james/Downloads/arduino-1.8.12/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_72843/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_MINI -DARDUINO_ARCH_AVR -I/home/james/Downloads/arduino-1.8.12/hardware/arduino/avr/cores/arduino -I/home/james/Downloads/arduino-1.8.12/hardware/arduino/avr/variants/eightanaloginputs /tmp/arduino_build_72843/sketch/PWM_Pin_9_100__duty_cycle.ino.cpp -o /tmp/arduino_build_72843/sketch/PWM_Pin_9_100__duty_cycle.ino.cpp.o
/home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino: In function 'void setup()':
/home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino:29:19: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
   TCCR0B = TCCR0B & B11111000 | B00000011;    // set timer 0 divisor to    64 for PWM frequency of   976.56 Hz (The DEFAULT)
/home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino:38:19: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
   TCCR1B = TCCR1B & B11111000 | B00000011;    // set timer 1 divisor to    64 for PWM frequency of   490.20 Hz (The DEFAULT)
/home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino:47:19: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
   TCCR2B = TCCR2B & B11111000 | B00000100;    // set timer 2 divisor to    64 for PWM frequency of   490.20 Hz (The DEFAULT)
/home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino: In function 'void loop()':
/home/james/Arduino/PWM_Pin_9_100__duty_cycle/PWM_Pin_9_100__duty_cycle.ino:114:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (reading == HIGH && previous == LOW && millis() - time > debounce) {   // If this looks like it was a valid button press

(part 2 - as there was too much data for one reply)

               ~~~~~~~~~~~~~~~~^~~~~~~~~~
Compiling libraries...
Compiling core...
Using precompiled core: /tmp/arduino_cache_188754/core/core_arduino_avr_mini_cpu_atmega328_b3f78442f929b72705f11d185d5df15f.a
Linking everything together...
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-gcc -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.elf /tmp/arduino_build_72843/sketch/PWM_Pin_9_100__duty_cycle.ino.cpp.o /tmp/arduino_build_72843/../arduino_cache_188754/core/core_arduino_avr_mini_cpu_atmega328_b3f78442f929b72705f11d185d5df15f.a -L/tmp/arduino_build_72843 -lm
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.elf /tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.eep
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.elf /tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.hex
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avr-size -A /tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.elf
Sketch uses 3446 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 354 bytes (17%) of dynamic memory, leaving 1694 bytes for local variables. Maximum is 2048 bytes.
/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/bin/avrdude -C/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:/tmp/arduino_build_72843/PWM_Pin_9_100__duty_cycle.ino.hex:i 

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

         System wide configuration file is "/home/james/Downloads/arduino-1.8.12/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/james/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.