Problem uploading sketches with FT232RL and ATMega328P-AU

Hi all

I have so far messed successfully with an Arduino Board and several shields.
I now decided that I want to design something on my own, namely a USB stick that provides meteo data (Temperature, pressure etc).
The basic components include a FTDI232RL for USB to Serial and a ATMega328P-AU for processing data coming out of a Bosch BME280.

The ATMega328P was bought from an online shop and are supposed to have the Optiboot bootloader already installed.

So I went ahead and drew a schematic in DipTrace and had boards made. Having soldered the components to the board, it does not really work.
The PC recognizes the new com port when I plug in the stick, but I am unable to upload any sketches to it. The output of the Arduino IDE is as follows:

vrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "D:\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM10
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x05
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x05

The only thing that varies from time to time is the response code. As it tells me that the programmer is not responding, I take it that there is something wrong with the ATMega, whatever that might be.
I tried with both the Uno and Duemillenove board settings.

I have checked that the ATMega get's +5V at the proper pins, and that everything is connected as it's supposed to be. I've also tripple checked that there are no soldering bridges, it all looks good to me.

While I am waiting for a TQFP Adapter so I can build the circuit on a breadboard for better troubleshooting, I thought to ask for a review / help / input on here.

I would greatly appreciate if someone could take a look at my schematics and review them for possible errors.

Thanks a bunch!
Martin

I can't see on your schematic the 1k resistors between the FT232 TX and RX pins, and the ATmega RX and TX pins.

You need to jumper TX and RX on the FT232 to perform the loopback test with the Serial Monitor. If the 1k resistors were forgotten, you can jumper the two two tracks and also jumper reset on the ATmega to ground to perform the loopback.

Thanks for your reply Paul.
It looks like I've indeed forgotten the 1k resistors. Do you think those could get the whole thing to fail?

What I don't really get is, I've built this circuit with slightly different components (no SMD of course) on a breadboard, that there it was working. Uploading to the ATMega in DIP layout worked just fine, as did the communication with the BME280.

Thanks again
Martin

The resistors are not essential, but a good idea, and especially for testing. Perhaps more important for the UNO and similar where the pins are brought out.

I was going to say that when a chip has the bootloader on it already, it should also have the test "blink" sketch so a LED and resistor connected to pin 13 should indicate this.

If you bought the 328P with a bootloader on it, they are generally expecting external 16 MHz crystal/caps, or a resonater. Bootload speed of 115200.

What is ECX2236? Not getting any hits at digikey.com.
What values are R1, C4, C5, C7? 10K, 0.1uF, and 22pf/22pf?
You don't have any decoupling caps on VCC and AVCC.

It's too bad you didn't bring the SPI pins out to an ICSP header. You can use an adapter like this to bootload the part if you decide that it isn't bootloaded now:

What online shop had pre-bootloaded TQFP parts?

Thanks for the replies CrossRoads and that link to that cable, going to order one of those right now! I was just about to redisgn my PCB because of the missing SPI Pins, but this may save them :smiley:

ECX2236 is a smd crystal that I am using. I'm using a 16Mhz model
http://www.ecsxtal.com/store/pdf/ecx-2236.pdf

I go the preloaded TQFP ATMega328P's here:
http://www.zbasic.net/Other-Microcontrollers/ATmega328P-TQFP/p-76.html

I've also ordered a cheap oscilloscope so I can verify whether the crystal is actually doing anything or not. If it is, it either means that the ATMega328P wasn't bootloaded or it is shot, as that's the only component left that could cause an issue at that point.

Do you think one decoupling capacitor for VCC and AVCC is enough, or does each line need it's own?

Thanks again!
Martin

Pogo30:
Do you think one decoupling capacitor for VCC and AVCC is enough, or does each line need it's own?

Well if it was directly below the chip, one would probably suffice. :grinning:

Sorry to bring this up again, but I'm a bit confused about the capacitor selection for the crystal.
The Spec Sheet of the Crystal lists a load capacitance of 8pF.
So with the formula I found on the net (C = 2(Cl-Cstray)) I would get 6pF for the capacitors, assuming a Cstray of 5pF.
The ATMega328P spec sheet recommends load capacitors from 12pF to 22pF on page 31.
http://www.atmel.com/images/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet_complete.pdf

So... do I have to choose a different crystal now that results in capacitor values in the recommended range, do I use something in that range despite the different value from the calculation, or do I just use the 6pF?

A confused thanks
Martin