I have made a device which, at the moment, is essentially a 328 with an LED on pin15
( but is called Arduino pin 9 ). I burned a bootloader into it, using a commercial UNO as
the ISP, and then transferred it to its standalone board. Rx and TX are connected to a USB-UART
module ( uses the CP2102 ) I got on Ebay and which seems to be OK because it is recognised by the
pc. I also connected the GND and RST pins. I have tried to upload the basic 'Blink' sketch to the 328
using the Arduio IDE, but without success. In fact I've tried all sorts of things, including changing the name of the
board and the name of the programmer ) All I ever get is a message saying there is a
' sync error 0X00', IIRC.
I thought you could upload sketches to a standalone board using the Arduino IDE via the serial Rx and Tx pins
provided the chip had a bootloader. Does anyone know what the mistake is?
Thanks for a quick reply!
Yes I did burn a bootloader, using my commercial UNO with the new 328 on a breadboard.
Then I transferred the new 328 to it's new home. I have supplied it with a 16MHz Xtal and 2 caps as recommended.
Perhaps I should burn the BL again and check the new 328 is OK by swapping it for the one in the UNO.
However, if that all goes to plan, the question is still: am I right to assume I can upload sketches to
this new 328 in its new board, using the CP2102 USB serial device using the Arduino IDE?
poriet:
...Rx and TX are connected to a USB-UART
module ( uses the CP2102 ) I got on Ebay and which seems to be OK because it is recognised by the
pc. I also connected the GND and RST pins. I have tried to upload the basic 'Blink' sketch to the 328
using the Arduio IDE, but without success...
Also, all the CP2102 boards that I have seen do not have DTR/RTS to reset the chip. You might have to manually reset your 328 by waiting till the "Binary Sketch Size 1024 bytes" comes up then press and hold reset till the Rx on the "USB-UART Module" blinks twice, then release.
"am I right to assume I can upload sketches to this new 328 in its new board, using the CP2102 USB serial device using the Arduino IDE?"
Yes.
Did you modify the CP2102 module so it can assert DTR thru a 0.1uF cap and reset the uC as part of the programming process?
The USB to UART CP2101 module is from China and the make is ( as far as I can tell ) 'BAITE'.
Its a 6-pin job. GND, Rx,Tx,5v,3.3V and then a RST/DTR. I'm having trouble with that last pin.
My understanding was that the upload program had to hold the Reset pin LOW while the chip was being programmed.
I dont know the meaning of 'DTR'. Ergo, I connected the RST/DTR pin direct to pin 1 (RST) on the 328.
Later, I saw a schematic in which the RST/DTR pin of a FTDI module was connected to the '328 Reset pin
via a capacitor.
Was this an awful mistake and would it give the same error code I get ( avrdude....sync error...0X00 )
BTW, just to help confuse matters, I tried uploading the sketch after I'd removed the '328 board, in order to see if there were any little flashing lights on the CP2102 module. I didnt see any, and it gave the same error code,
which I thought was blooming queer, and made me suspect the modyule was iffy.
The RST (reset) pin is an input to the CP2102 chip. You cut the trace and connect the DTR signal, which is an output from the CP2102 chip, and goes to your ATMega chip to create a reset.
Thanks guys.
I think you need to walk before you run, so...
I'll reload the BL with my UNO and check it's OK by fitting the new '328 in the UNO board.
( Thank God for PDIPs ).
Then I do some homework on the CP2102 device.
I thought the DTR 'handshake' pin was obsolete on the serial link these days.
Before I start hacking at my FTDI module with a pen-knife, I need to find out what's going on here.
If it is necessary to separate DTR from RST, why are they on the same pin?
I'll try the 100nF capacitor first.
However, I still have a big puzzle here: 'Cyclegadget' recommends Rx to RX and Tx to Tx,
but the schematic for the 'Minimal Arduino' shows Rx to Tx and vice-versa. Who do I believe?
poriet:
However, I still have a big puzzle here: 'Cyclegadget' recommends Rx to RX and Tx to Tx,
but the schematic for the 'Minimal Arduino' shows Rx to Tx and vice-versa. Who do I believe?
bruce
My Breadboard Arduino is FTDI Tx to Atmega PD0(Pin 2/RXD) and FTDI Rx to Atmega PD1 (Pin 3/TXD).
However, I still have a big puzzle here: 'Cyclegadget' recommends Rx to RX and Tx to Tx,
but the schematic for the 'Minimal Arduino' shows Rx to Tx and vice-versa. Who do I believe?
I know it sounds incorrect but, I learned it with experience and using a google search. I can say that you can reverse the RX, and TX and not cause harm but, it will not program or output serial if you have them backwards.
I dunno cyclegadget, my boards and the schematic (Arduino Pro, virtually a breadboard Arduino) show on the FTDI header (JP5) the Tx<->Rx and Rx<->Tx crossover.
Reversing them (Tx<->Tx, etc) give me sync errors.
I have a different FTDI board but it has...
Pin 1 = DTR
Pin 2 = RX1
Pin 3 = TX0
Pin 4 = VCC
Pin 5 = GND
Pin 6 = GND
DTR is connected through a 0.1uF capacitor to pin1 (RESET)
RX1 is connected to pin 3 (TXD)
TX0 is conncted to pin 2 (RXD)
Both RX1 & TX0 have 10K pulldown resistors connected to GND
VCC & GND are connected to relevant ATMega pins
Then I do some homework on the CP2102 device.
I thought the DTR 'handshake' pin was obsolete on the serial link these days.
Before I start hacking at my FTDI module with a pen-knife, I need to find out what's going on here.
If it is necessary to separate DTR from RST, why are they on the same pin?
You are not changing the FTDI module. You are changing the CP2102 module.
Cut the trace leading to the RST IO pin.
Connect that pin to the DTR hole on the board.
That DTR pin will connect to your standalone board. There needs to be a 100nf, or 0.1uF, cap between the CP2102 and the uC reset pin (which also has a pullup resistor to +5). The cap can be used to connect the DTR hole to the IO pin on the CP2102 module. Or the cap can be between the standalone boaard's IO and reset pin. Or you can press your reset button every time.
Reversing them (Tx<->Tx, etc) give me sync errors.
I am speaking of my CP2102 USB to Uart board connecting to a small Arduino 328. I just now tested my board again to make sure I was telling you the truth.
Also here is a link to a person that connected his/her board the same way except without the capacitor on DTR. http://blog.tarn-vedra.de/2011/09/using-cp2102-on-arduino.html
By the way, I just wanted to let you know what is working for me and I don't wish to lead you the wrong way.
Reversing them (Tx<->Tx, etc) give me sync errors.
I am speaking of my CP2102 USB to Uart board connecting to a small Arduino 328. I just now tested my board again to make sure I was telling you the truth.
Also here is a link to a person that connected his/her board the same way except without the capacitor on DTR. http://blog.tarn-vedra.de/2011/09/using-cp2102-on-arduino.html
By the way, I just wanted to let you know what is working for me and I don't wish to lead you the wrong way.
I apologize for doubting your understanding of this board. I have a very similar board with the CP2102 as well, and it crosses Rx/Tx. It is understandable now that "BAITE" silked the board backwards of convention (Receiving from Transmitter and vice versa).
I was a little worried reading such "crazy talk" from you though Order is restored.
Hello guys,
This is turning out to be a real game and a half.
Cycledagdet, we were all wrong about you! There does seem to be something rather Mickey-Mouse about the 'BAITE' board.
I have taken this evening to check that the '328 I'm using really does have a boot-loader, and will upload programs when I
plug it into the UNO board. So far, so good.
Tomorrow I am going to attempt again to upload programs to this '328 chip using the CP2102 board/module.
However, the story about the DTR/RST pin is confusing.
I think I will connect a 100nF direct from the DTR 'hole' to the reset pin (#1) on the Atmega328 ( which is,
in turn, connected to 5V by a 10K resistor). The RST pin on the 2102 module I will ignore. I hope that's right.
First I will attempt to upload with Rx-Rx; Tx-Tx. If that fails, I'll cross them over. If that fails, I will shoot myself.
Kindest thing, really.