Using two different USB Serial adapters, one Arduino USB-Serial from DigiKey and one Silicon Labs CP210x clone.
Well "using" is actually inaccurate.
Both are recognized in Windoze and get a COM port assigned.
I can upload (using a programmer) a sketch to my Uno and output some stuff to Serial and see that output with the serial adapter in a putty terminal.
The Uno blinks when powered up, so the bootloader is there, or so it seems.
Problem is - I can't upload anything through either USB Serial adapters.
I tried swapping Tx/Rx pairs, I tried holding reset until 'Uploading' appears in the IDE, I tried a 100nF cap between the reset pin of the programmer and the Uno's reset, nothing works.
Programmer not responding is what I always get, not in sync, with different response codes.
Does anyone have a decent troubleshooting guide for uploading with an USB to Serial adapter?
I am at my wit's end.
Why are you using a USB Serial adapter to upload to an Uno? It has a usb-serial adapter built in.
The autoreset won't work, and it's quite hard to do it manually (optiboot doesn't wait very long before starting the application - you have to time it perfectly. It usually takes me many attempts to time the reset right).
The 0.1uf cap goes between DTR of programmer (not reset!) and reset of the Arduino. It will not work on an Uno without you cutting the trace on the board to disconnect the cap connected to DTR of the on-board adapter (there can't be anything else connected to reset)
The 0.1uf cap goes between DTR of programmer (not reset!)
In particular, many of the 3rd party USB/Serial boards have a pin labeled "RESET" or similar, but it is frequently NOT the right signal to connect to RESET on your arduino. (Sigh.) (And since you usually don't get any schematic or documentation, it can be hard to check for sure.)
I am testing with the Uno because I figured I must be doing something wrong with the Optiboot on my 1284p.
So I took the steps of troubleshooting with a device that is known to work.
Both of my converters have a pin marked RST (the Arduino-branded one actually says 'EXT reset', which I read as external). So I assumed that those must be the DTR pins so that is why I connected the cap to it.
I didn't know I couldn't use the Uno this way, but my goal is to use it with the 1284p.
I will try again and try to time it right.
Is auto-reset really far-fetched, though?
So many seem to be taking this approach...
[url=http://media.digikey.com/pdf/Data%20Sheets/Arduino%20PDFs/ArduinoUSBSerial_Web.pdf[/url]
"Automatic (Software) Reset
The USB Serial connector is designed in a way that allows it to reset an attached board by software running on a connected computer. The external reset line mirrors the DTR line of the virtual serial device on the computer. It's typically connected to the reset line of the connected board (e.g. an Arduino Ethernet board) through a 100 nF capacitor, allowing the board to reset on upload."
Seems like that's what you'd want.
I use a FTDI Basic clone from www.tinyosshop.com for offboard USB/Serial adapters, couple examples:
[http://media.digikey.com/pdf/Data%20Sheets/Arduino%20PDFs/ArduinoUSBSerial_Web.pdf[/ur]
"Automatic (Software) Reset
The USB Serial connector is designed in a way that allows it to reset an attached board by software running on a connected computer. The external reset line mirrors the DTR line of the virtual serial device on the computer. It's typically connected to the reset line of the connected board (e.g. an Arduino Ethernet board) through a 100 nF capacitor, allowing the board to reset on upload."
Seems like that's what you'd want.
I use a FTDI Basic clone from www.tinyosshop.com for offboard USB/Serial adapters, couple examples: http://www.crossroadsfencing.com/BobuinoRev17/
]Cross Roads Electronics]http://media.digikey.com/pdf/Data%20Sheets/Arduino%20PDFs/ArduinoUSBSerial_Web.pdf[/ur]
"Automatic (Software) Reset
The USB Serial connector is designed in a way that allows it to reset an attached board by software running on a connected computer. The external reset line mirrors the DTR line of the virtual serial device on the computer. It's typically connected to the reset line of the connected board (e.g. an Arduino Ethernet board) through a 100 nF capacitor, allowing the board to reset on upload."
Seems like that's what you'd want.
I use a FTDI Basic clone from ](Cross Roads Electronics)www.tinyosshop.com for offboard USB/Serial adapters, couple examples: Cross Roads Electronics
Thanks Bob, I had already read your page and I thought I had it, but still no success uploading.
I don't have an FTDI, I have a CP2102 and an Arduino-branded 8U2 adapter, but functionally they are the same as the FTDI.
I tried with and without the 10k pull-up resistor on reset, to no avail.
When the IDE finished compiling and the message 'Uploading" shows up, I can see that the LED blinking changes and there is a longer delay between the loops (the sets of 3 blinks), but it still won't upload.
I also tried a 220nF cap, thinking that a longer pulse would help, I will try a 50nF next.
The TxRx connection is right because if I use my Uno to upload a sketch to the 1284 and output something to serial, I can see it in a terminal connected to the COM port of the USB-Serial adapter.
I then re-uploaded the bootloader with the Uno and now I am trying to upload a sketch via the bootloader.
I believe that the Arduino USB 2 Serial needs to have the EXT RESET pin connected directly to the reset pin of the 1284p.
For two reasons, I looked at the diagram and it comes out of one of the I/O pins of the 8U2, so it makes sense, and two, when I try to upload a sketch to the 1284p, the LED stops flashing, which could mean the chip is in programming mode (much like what it does when I upload with SPI).
Having said that, I am still unable to upload anything with the bootloader.
I will try to compile Optiboot with UART=1 and switch to the other serial port on the 1284p.
I suggest taking the approach of validating exactly what your USB to serial adapter does, and re-visit getting it working with your Uno. That way you would eliminate that part as an unknown. Can you cut the RESET-EN jumper pad of your Uno? If you do, then you can test the full functionality of the USB to serial adapter with your Uno, including the auto reset part of the circuit, and you will know exactly how to connect it to your 1284p. You can bridge a solder blob or small wire across the jumper later on, to restore the Uno.
Proceed with Uno which has been tested and is known to upload sketches through the USB port.
Then cut the RESET-EN jumper pad.
Wire: USB2SerialUNO
GND GND
5V 5V
TX RX
RX TX
EXT-RESET to 100nF cap to RESET
Connect the USB to Serial adapter to the computer, select the USB to Serial port in the IDE, and upload a sketch.
Once you verify it works ok with the Uno, you will know if you connect it to the 1284p and it doesn't work, the problem is isolated to just the bootloader.
I should have thought of that myself, especially since I have a 328p on a perforated board that I can test with.
Swapping it onto the Uno to load the bootloader (i have an external programmer) and then back to test with the USB-Serial should do the trick.
I suspect that there won't be a need for the cap to the reset pin for the 8U2 adapter, only for the 2102, but I will post the results.
If you have a look at the schematic for the USB2Serial Light you see the EXT RESET pin is actually DTR. That means it goes low and stays low while the serial connection is open. The 100nF capacitor converts that into a momentary pulse low. I predict you'll need it. Measure the voltage on the DTR pin to confirm it goes from high to 0V and stays at 0V all during the open serial connection. It would be possible to change the firmware on the ATmega8u2 to change the DTR signal to a momentary pulse out of PD7, making sort of a software capacitor...
Update: The setup works fine, even with the 1284p.
There are a few important prerequisites, and here they are for further reference:
Optiboot for 1284p needs to be compiled with BAUD=19200 (that is why it wasn't working, but worked on the 328p)
In order for the 100nF cap to work, the 10K pull-up on the /RESET pin must be present. My test board didn't have that pull-up, which I usually hide right under the 1284, so I was scratching my noodle as to why I am not seeing any sign of a reset on this particular board, but it was working on two others
Both USB-Serial adapters I used, the Arduino USB2SERIAL and a CP2102 clone needed the cap between the DTR pin and /RESET, even though both have the DTR pin marked as RST.
As a side note, the CP2102 module had RST connected to the reset pin of the CP2102!!!
This is my first one, so it's news to me and I find it hilarious!!!
So I removed a resistor to free up the trace and soldered the 100nF cap right in there, it wasn't terribly hard, in spite of the minute lead on the CP2012. Good thing it's the last in the row (pin 28), or it would have been a different story.
Since I had a bit of a hard time putting all of this info together, I am asking the admins if I should share my experience in a separate post, or will this one suffice.
Optiboot for 1284p needs to be compiled with BAUD=19200 (that is why it wasn't working, but worked on the 328p)
That doesn't sound right... It should work at 115200 just fine.
19200 is the speed used for BURNING the bootloader using the ArduinoISP sketch, but the speed that the bootloader runs at is completely separate. (It still has to match whatever you have in the relevant boards.txt...)