Unable to Upload Sketches to Arduino on Breadboard ATMega328P-PU Using a CP2102

First off, thank you to those of you that respond to all of these forums; I use them frequently! I am new to the Arduino world as of this January, but I am somewhat of an experienced VBA user.

Problem: I am unable to upload sketches to my Arduino on a breadboard when using my CP2102 Module. I get the following error; “avrdude: stk500_getsync(): not in sync: resp=0x00” at the bottom of the Arduino window.

Details:

  • CP2102 Module Purchased - http://amzn.com/B009T2ZR6W

  • ATMega328P-PU – I am sure that this chip works. I bootloaded 4 chips and then successfully uploaded the “Blink” example sketch using the Arduino as ISP. I swapped out other ATMega328P-PU chips to make sure that it was not a corrupt bootloader.

  • Wiring (See screenshots for more details / confirmation.)
    Arduino CP2102
    VCC ==> VCC
    GND ==> GND
    TX ==> RXI
    RX ==> TXO
    RST ==> Capacitor to DTR

  • Reset Button – I have tried holding the reset button until the “uploading sketch” text comes up in the Arduino software. This did not work.

  • TX vs. RX – I have also tried swapping the wires so it is TX==>TX and RX==>RX vs. the above wiring. This did not work either.

  • 3.3v vs. 5v – I have confirmed that the Arduino on the breadboard is getting power (red LED on breadboard). Using a different voltage has not worked either.

  • Power through Voltage Regulator – I have tried routing the power through my 5v voltage regulator setup from the CP2102 module vs. directly into the VCC rail.

  • Programmer – I have tried using the regular Arduino programmer. I have also tried holding down the shift key and uploading sketches via the AVR ISP and the AVR ISP mkII programmer options.

  • TX and RX Lights – It appears as though there are TX and RX lights on the CP2102, but they do not appear to light up when I attempt to upload a sketch. I have hooked up a multimeter to the TX and RX leads, and there is 5v running through each lead.

  • CTS – the light for this pin is on when I plug the CP2102 into my breadboard, but I’m not sure what this pin is for.

  • Header Pins – I soldered the 8 header pins (4 holes x 2 rows) that run along the sides of the CP2102 module, thinking I would need to use the RST pin (which only resets the CP2102 board from what I can tell). I did this after exhausting many of the options above.

Please tell me what I’m doing wrong! I would really like to get this unit to work vs. purchasing an expensive FTDI unit to upload sketches to my Breaduino! Thank you!

expensive FTDI unit

Where are you shopping? They are $7, I just picked up a bunch from www.tinyosshop.com

Your circuit needs 0.1uF caps on the VCC, AVCC pins.
The crystal has 22pF caps?
How is power getting to the bottom rail? I don't see the connection for it.

CrossRoads, Thank you for the quick reply!

I didn’t realize I could get them that cheap. Oh well, I guess I’m committed to giving this CP2102 one last try before I junk it and by a different module.

I added 0.1 uF caps to the VCC and AVCC pins as requested. I was still unable to upload the sketch.

Yes, the crystal has 22 pF caps on both legs of the crystal. I also switched out the crystal a while back to rule that out.

The picture is unclear, but there is a brown jumper wire going from the VCC pin of the CP2102 module to the power rail.


Is there a way to test the TX and RX communication via a multimeter, LED, or through my Arduino UNO?

What other factors could I rule out?


I’ve attached pictures this time. I’m not sure why they would not attach to my original post.

Connect Rx to Tx on the CP2102, open the serial monitor, anything you type should be echoed.

That worked. Everything was echoed.

CrossRoads, If the TX and RX functionality works properly on the CP2102 module and I have my "Breaduino" is setup correctly, what other actions should I try?


Sorry for the double post, I thought maybe my "That worked." comment might have made it seem as though my problem was resolved.

No, it was late and I went to bed.

Review the wiring:
How does power get from top rail to bottom rail? I don't see that anywhere.
Same with grounds, I don't see how they connect.

If they are indeed connected, then I am stumped.

CrossRoads, there are jumper wires at the bottom of the breadboard that connect the VCC and GND rails on each side. The red LED near the reset switch is a power indicator, and it lights up whenever I have the USB cable plugged in. I used a multimeter a while back to check if both rails were working properly and they were fine.

Should I be using any other pins on the CP2102 module? I’m not using the CTS, 3V3, RTS, SPD, RTS, or DCD pins.

Does it matter if I use 3.3 or 5v?

For 16 MHz xtal, you want 5V.
CTS should connect to Gnd, tells CP2102 that it is Clear To Send.

CrossRoads, I connected the CTS pin to ground with a jumper wire and tried uploading the blink sketch to my Breaduino and it still did not work. Should I be using a Cap to connect the CTS pin to GND?

I just checked the voltage using my multimeter and both rails appear to be at about 4.90v.

I did install the drivers to my computer from Silabs, but do you think that it is possible that the drivers are corrupt. My computer recognizes the CP2102 when I connect it via USB, so that tells me that the drivers can be ruled out. Is that correct?

No, CTS to Gnd.
I would think so.

Someone in another post (link below) stated that you needed to use some resistors with the TX and RX connections? Is this correct or would it help?

If so, I only have 330 and 10k resistors at home; would it matter if I used one of these or would it have to be a 1k resistor?


What board should I be using from the drop down menu? I've just left it as the Arduino UNO. I have an ATMega328P-PU, should I be using a different board type, such as the duemilanove?

No resistors needed.
What bootloader did you put on the chip? That's the board type to select.

I’m almost certain that it was the Arduino Uno, simply because that’s what I always set it to. I used my Arduino Uno to bootload my ATMega328P-PU chips and also to upload the blink sketch to it. I’ve slightly modified the blink example sketch (the delay) to upload using the CP2102 module, but it still has not worked properly.

I replaced the 16 MHz crystal as well again just to be sure that was not the problem.

Just to be clear, I should NOT be holding down the shift key to “Upload Using Programmer,” correct?

I’ve attached a picture so you can see all of my connections again. Does my DTR to cap to RST connection look correct?

I’m just guessing, but it seems like the reset function is not working properly. That said, I’ve tried the manual reset process and that hasn’t worked either.

Just to be clear, I should NOT be holding down the shift key to "Upload Using Programmer," correct?

Correct.
DTR in the picture - I can't tell.

[SOLVED!] (via another forum post of mine - Unable to Upload Sketches to Arduino on Breadboard ATMega328P-PU Using a FT232R - Programming Questions - Arduino Forum)

I was able to get both my FT232R and my CP2102 modules to work! The problem came down to the capacitor I was using and how I had it connected to my Breaduino.

I still currently have to perform a manual reset in order to upload sketches, but at least I am able to upload sketches.