Go Down

Topic: Breadboard ATMega328 with FTDI Cable (Read 556 times) previous topic - next topic

ross246

Hi Everyone

First post here hope I am in the right section. I am having an issue with a circuit I am trying to build on a breadboard. I have searched the forums and tried everything I could find but nothing has worked so far.

I am building a circuit which needs a stand alone ATMega328 so I am doing some tests on a breadboard before I assemble the circuit. I have connected an ATMega328 with the Arduino Bootloader to an external 16Mhz crystal with 2 x 18pF caps and I also have a 10k pull up resistor to the reset pin. The blink sample runs perfectly when I power on the circuit which I think is then safe to assume I have connected the crystal and 328 correctly. I followed this circuit here:

http://arduino.cc/en/Tutorial/ArduinoToBreadboard

I can also successfully program my breadboard circuit by removing the IC from my Uno and wiring it up as per the link above. The problem comes in when I try to use my FTDI Cable to do the programming, I have my FTDI Cable wired up as follows:

Green - Reset with 104 cap in series (tried without the cap too)
Yellow - Tx
Orange -  Rx
Red - Vcc
Brown - Nothing
Black - Gnd

I have tried to switch the Tx and Rx still no joy. The error I receive is:

avrdude: stk500_getsync(): not in sync: resp=0x00

I have wired and rewired the circuit. When ever I connect the Uno without the 328 to the breadboard I am able to program the breadboard circuit. I have also tested the FTDI cable with my Arduino Ethernet and it programs it correctly so I would imagine this would eliminate an issue with the FTDI cable or drivers. A lot of the issues and posts online are regarding the FTDI break out board, I can't imagine there being a difference from my FTDI cable. As I understand it as long as the 328 has power all I need is the Ground/Rx/Tx and it should program.

Is there something I am missing here?

I am running Windows 8 and I am using the drivers which Windows installed. I tried using the drivers from the FTDI site but windows said the installed drivers were better. I am making sure I am selecting the correct port, I am selecting Arduino Uno as my board. Could this be an issue?

Any advice will be greatly appreciated

retrolefty

Simple problem missed by many building their first standalone. The arduino IDE utilizes the serial DTR or RTS control signal to trigger a reset on the target thus activating the bootload that can then let the IDE download the sketch to the target. You can usually get by it by using the manual reset button on your target chip but it has to be timed correctly just at the time the IDE is starting the upload operation. The better option is to see if your serial cable makes the DTR or RTS control signal avalible and wire that through a series .1ufd cap to the target's reset pin. Are you sure the green wire is the DTR or RTS signal?


Robin2

I have a breadboard 8Mhz 328 built using the same reference page and my FTDI cable seems to have the same coloured wiring as yours except that I have a label on mine with Orange Tx and Yellow Rx. To be honest I can't remember if that means those are the FTDI usage of the wires or if they are the crossed-over labels. I can't recall having any problem programming the 328 with the cable.

In case you are interested I have two sets of pins on my 328 board for connecting the FTDI cable. One set doesn't have a pin for RTS so I can read the 328 without causing it to reset.

...R

ross246

Thanks retrolefty

This is the cable which I am using https://www.sparkfun.com/products/9718

It does make the RTS control signal available and I do have it wired in series with a cap to the reset pin on the 328. If i monitor the voltage on the reset pin it is being brought down when I try and upload the sketch so I am quite sure this is working correctly. I also tried to perform a manual reset just before pressing upload button but still the same error. Because I have the blink sketch on the chip I can see the reset event when it is fired because the led I have hooked up for the blink sketch flashes erratically when reset.

ross246

I have also noticed a few circuits like this one:

https://nurdspace.nl/Arduino_on_a_breadboard
and this one:
http://www.jameco.com/Jameco/workshop/JamecoBuilds/arduinocircuit.html

Where pin 21 (ARef) gets connected to +5v. Is this necessary or could this make a difference? The original circuit I posted from the official Arduino site did not connect this pin to +5v. It only illustrated the pins on either side (22, 20) to be connected to Ground and +5v respectively.

retrolefty

Let me ask this, which bootloader did you burn to it? Also you say it's running the blink sketch, how did you load the blink program to the chip, using the upload using programmer option?


ross246

It came with the arduino boot loader installed. I also loaded the boot loader using an Uno and the Arduino IDE just to be sure. I can program my circuit using the ftdi functionality on the arduino uno just not using the FTDI cable. Will try rip apart the circuit again and rebuild it  :smiley-roll-sweat:

retrolefty


It came with the arduino boot loader installed. I also loaded the boot loader using an Uno and the Arduino IDE just to be sure. I can program my circuit using the ftdi functionality on the arduino uno just not using the FTDI cable. Will try rip apart the circuit again and rebuild it  :smiley-roll-sweat:


Well I;m somewhat confused, it came with a bootloader already installed on the chip, but then you burned a bootloader onto it anyway? What board type had you selected prior to performing the burn bootloader step?

You say it's running a blink sketch? How did you load the blink sketch to the chip? if you used the load sketch using programmer option that will erase any bootloader that may have been on the chip?


Go Up