Avrdude error for Nano

I get this error:

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

When I upload this code to my Nano:

#include <Servo.h>

Servo myservo;  
int potpin = A0;
int val;   

void setup() {
  myservo.attach(9); 
} 

void loop() {
  val = analogRead(potpin);        
  val = map(val, 0, 1023, 0, 180);    
  myservo.write(val);                  
delay(15);                          
}

The Arduino help center says I might have selected the wrong board and port. So I reselected the Nano board and put in COM3. I also reinstalled the CH340 driver as my Arduino is a clone. I’ve tried reuploading and restarting but nothing seems to work and I get the same error. Anyone know how to fix this?

Any help is much appreciated.

Have you tried the different processor options in the IDE under tools -> processor. Most clones use the old bootloader, some might require the 168P.

Thanks for the suggestion, I tried using all bootloaders and none of them worked at all. I tried the loopback test but that didn’t work either. The help center said if it didn’t work the bootloader is malfunctioning and I should get a new board.

Is it a good idea to get another clone or are there too many malfunctions that I should just get the official one?

On a board with CH340 chip, the loopback test is non-conclusive.

Was anything connected when you tested?
How do you power the servo?

I haven't had any problems with my clones.

I had only the jumper wires connected to the appropriate pins for the test. I powered the servo with my clone which was connected to my computer.

I found this link:

(Arduino failing loopback test despite working perfectly otherwise - #5 by kprims)

And on the 5th reply, he says the RX/TX pins are connected to the 328P and it’s why the loopback test does not work for CH340 clones. They fixed this problem by removing the RX and TX LED. I did the same thing and it worked however, I still can’t upload a simple sketch. I’m planning on getting a new NANO but the official store ran out of stock. Should I just get another NANO clone or buy the genuine UNO?

You chose a Nano for a purpose, why switch to an Uno?

I normally don't buy clones, the Nanos are exceptions. As said, I have not had issues with them.

I chose the Nano as my starting board as it was small and the clone was cheap. I was thinking of the UNO as an alternative to the Nano because they ran out of stock for the Nano.

My Chinese nano is not a clone, it is an LGT8F328 though there are no marks on the chip. It can run twice as fast, resolve analog to digital to more bits, and has other enhancements, but is cheaper.
It has taken me a while to get it up and running.
1 It needs its own driver.https://github.com/dbuezas/lgt8fx tells you how to install it.
2 The upload speed still did not match my chip. I had to change the upload speed at about line 18 in the file boards.txt to 115200.
You may find in 2 places,
C:\Users\jonathan\AppData\Local\Arduino15\packages\LGT8fx Boards\hardware\avr\1.0.6
or
C:\Program Files (x86)\Arduino\hardware\lgt8fx-master\lgt8f
I hope this solves your problem.

PS You must restart the Arduino IDE for the change to take effect

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.