Pages: [1]   Go Down
Author Topic: Help on "Arduino on breadboard"  (Read 1381 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.
I'm trying to build this http://siliconrepublic.blogspot.in/2011/02/arduino-based-pc-ambient-lighting.html ambient light controller for PC. This worked flawlessly on my Arduino Uno smiley. My next step was to make it using "Arduino on a breadboard" http://arduino.cc/en/Main/Standalone. So I bought a blank Atmega328 chip and burned the Arduino bootloader (for the board "Arduino Duemilanove w/ ATmega328") onto it using the Arduino IDE and USBasp; and I know this has been loaded properly as an LED at pin 13 blinks, as said in here: http://arduino.cc/en/Guide/Troubleshooting#toc1 (under the subheading "Bootloader").
Then I made the USB-to-serial converter using FT232RLhttp://www.sparkfun.com/tutorials/108; but the drivers didn't install on my PC (Windows 7 x64). I suspect I overheated the surface-mount FTDI chip and killed it while hand-soldering it. smiley-sad
Now I've got a USB to serial converter bridge: http://www.silabs.com/products/interface/usbtouart/Pages/default.aspx which also has an ST232CN chip on it.
I'm not sure if I should use another MAX232 IC to convert it to TTL logic level suitable for TR/RX pins of the ATmega328? Are the TX/RX pins from the USB-to-serial converter at TTL logic level or of RS-232 standards with +/- 12V?
And I tried this circuit: http://arduino.cc/en/uploads/Main/ArduinoSeverinoSchematic.png using the USB-to-serial converter, but I had no idea which "Programmer" I should select in the Arduino IDE. I tried all of them, and I got this error:
Code:
avrdude: stk500_getsync(): not in sync: resp=0x00
Which is the correct programmer I should select for this circuit? And why this error?smiley-confuse
Thanks in advance smiley
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does your bootloaded atmega328 chip work in your Uno?

Does your computer recognize the homemade USB-to-Serial converter (with the FT232RL)?

If you're just trying to upload a sketch and not burn another bootloader, changing the programmer shouldn't make a difference.

Can you try a verbose upload (hold shift+ press upload) and copy your error messages here? Are you currently using a 12V logic USB-to-serial device? Check the atmega328 datasheet - you definitely don't want to be putting 12v signals into the TX RX pins. You MIGHT be able to get away with using a resistive divider to get the correct logic levels, otherwise the MAX232 will be fine.

Last suggestion. Try adding a couple of 1k pull-up resistors on pins 2 and 3 of the atmega328 (tx and rx pins) on your breadboard before uploading.



Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@boredat20. Thanks for the quick reply.
Quote
Does your bootloaded atmega328 chip work in your Uno?
Checked it now. Yes it works fine. I just have to select the "board" as "Arduino Duemilanove w/ ATmega328".
Quote
Does your computer recognize the homemade USB-to-Serial converter (with the FT232RL)?
It detects it as an unknown device. When I try to update its drivers from the FTDI site, it shows an error something like your driver is already upto date, and still it is unrecognized as a usb-to-serial converter. So I've kept it aside for now, and am working with the usb-to-serial converter cable.
And I used an ST232CN, which is similar to the MAX232 IC, to convert to TTL levelhttp://www.sigma-shop.com/manuals/max232_manual.pdf. And this works fine, as I verified from a loopback test. And I've connected pin 9 of ST232 to pin 2 of ATmega, and pin 10 to pin 3.
So I guess the problem is in the serial communication from the ST232 to ATmega?
And this is the message/error I got when I did the verbose upload:
Code:
Binary sketch size: 1026 bytes (of a 30720 byte maximum)
avrdude: usbdev_open(): did not find any USB device "usb"
And as before, the error I get using normal upload (of the Blink example) is:
Code:
Binary sketch size: 1026 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00
Quote
Try adding a couple of 1k pull-up resistors
Tried it. Adding them didn't make any difference, and got the same error.
Is there any special connection to the Reset pin of ATmega? I've just pulled it up to 5V with a 10k resistor.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So you're using a serial port on your computer and not a USB-Serial converter? Don't know if I can help you there. I don't own a PC with a serial port.

Quote
Now I've got a USB to serial converter bridge: http://www.silabs.com/products/interface/usbtouart/Pages/default.aspx which also has an ST232CN chip on it.
I am not familiar with the ST232CN, although I can't understand where you are using that.This links to a few different USB to UART bridges, CP210X, none of which have an "ST232CN chip on it".

If you're using the Silabs CP210x (which is what you linked to), it's possible you're not resetting the atmega328 at the right time. Are you manually resetting the board or using the DTR pin? Try connecting the DTR pin through a 0.1uf capacitor to pin 1 (reset) on your atmega. Keep the reset pin pulled high by connecting pin 1 to +5v. You don't need the 10k.

I would try figuring out why your FTDI device doesn't work. What OS are you running?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@boredat20
No i'm using the USB-to-serial bridge on my laptop (Running windows 7 x64): http://imgur.com/a/lfExC. The ST232CN is similar to MAX232. On the bridge, I guess it is used to convert the TTL logic level output from the CP210x TX and RX pins to RS232 levels of +/- 12V.
And thanks for that resetting tip! When I press the upload button on Arduino IDE, I start pressing the reset button on the breadboard (i.e. ground the Reset pin of ATmega) and it takes around 6-8 seconds to compile. As soon as it shows "Uploading" I unground the Reset pin, and the program gets uploaded without any error! I'd like to know the reason behind this, though. And I've not yet tried with the DTR pin.
And I tried installing drivers for FT232RL with both 32 bit and 64 bit systems, from here: http://www.ftdichip.com/Drivers/VCP.htm. Everytime, it shows that the drivers are upto date and the device is still unrecognized.
And this is exactly the board I did for FT232: http://i.imgur.com/cFAoV.jpg, except that I shorted the connection for ferrite bead, as I couldn't find it near where I live. Does that cause such serious problem?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Resetting the atmega328 tells the bootloader to stop and wait for new instructions (i.e. a new sketch to be uploaded). If you don't reset at the right time, the chip will start running the sketch already present on it and will not accept new sketches until it is reset again.

Adding a 0.1uf cap in series from DTR->Reset will make that process automatic as the DTR pin will send a pulse dropping the reset pin to GND and then back to +5 at the right time. The cap, if I'm not mistaken, provides the appropriate "delay", allowing the chip to stay in reset long enough for the sketch to compile.

As for your FT232, I can't speak about the importance of the ferrite bead, IIRC it is there for power supply noise supression. I have a homemade board using that chip in which I omitted the ferrite bead and it seems to work fine. It is however recommended in the official datasheet for the FT232RL so take that for what you will. If you look at the schematic for the Sparfun FTDI breakout board, you'll notice they have omitted it as well.

My guess is it's not the lack of the ferrite bead that is tripping up your FTDI board. Do a google search. Your problem is a fairly common one, although I do not know the solution.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah. The 0.1uF cap at the DTR to Reset pin works perfect.
Still trying to figure about the FT232RL. Tried a few solutions like this: http://www.lynxmotion.net/viewtopic.php?f=45&t=6502&p=64226&hilit=ftdichip#p64226
in vain..
Will update here if I find any solution for it.
Logged

Pages: [1]   Go Up
Jump to: