Problem Uploading the code to atmega328p using FTDI(FT232)

Hi, I am currently working on my project , which requires uploading my working code to atmega328p via FTDI module (FTDI232).
After so many efforts with uploading the code I had this result :
1. Don't know whether I have proper drivers for this FTDI on my pc. But it shows the
port no. to me so I assumed there is no problem with that.
2. Code shows uploading for a long time and after that it gives this error:
An error occurred while uploading the sketch
and nothing else.
3. I have checked the atmega328p and it's working well.
4. Checked the connections.
5. Used 10nF capacitor between DTR pin of FTDI and Reset pin of atmega328p.
6. atmega328p was on uno board before, so no need to burn the bootloader.
7. Don't know if oscillator is working well, don't know how to check that...
8. An LED was on while uploading the code (not the power on led) it was either tx or rx.
have uploaded the schematic Here.
here's the FTDI I am using : ftdi hosted at ImgBB — ImgBB
Can someone Please help me with this....

Don’t see a pullup resistor on the Reset pin.

Yes, there is...but you have to look for it...it's in the Powerstage block; the middle bit around the FSM16JH switch is apparently a reset circuit.

What does seem to be missing is the obligatory array of decoupling capacitors around the 328P, unless they should pop up as well in a "where's Waldo" exercise...

Look @radnem, you have a board with quite a few things going on, so I'd isolate the problem and place your ATMega on a breadboard (with oscillator & caps, power supply decoupling capacitors and reset pullup) and connect that to your FTDI. Work on that setup until you manage to program it. Only then start moving it to the PCB.

@anon35827816 thanks for the reply, already tried my setup on breadboard before with basic arrangement ,same as you have suggested. There were much more problems on breadboard, plus I had to check each connection after each iteration ( you might know the problems with breadboard connection XC even when my breadboard is reliable enough )
I had those problems while testing on breadboard :
1. An led flashes three times and becomes off on ftdi when uploading starts(its the same led as before).
2. The compiler shows me this error
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

      avrdude done.  Thank you.

     An error occurred while uploading the sketch
3. I tried pressing reset button manually at the time of upload by removing DTR pin 
    connection to reset pin via the 10nF cap, no results.

tried that for 3 days, came to conclusion that I would shift to pcb due to time constrains..
4. about the capacitors, used a 10uF capacitor at regulator output, and 100nF cap near the atmega328p..is it the correct config ?

So basically you didn't have a working setup, and then moved to a more complex situation in the hope this would solve it. I understand your reasoning, but in reality, this is usually counter-productive. I'd go back to the breadboard.

To be honest I have often made sufficiently reliable circuits with a breadboard for the kind of thing you're doing. The fact that you didn't get it to work probably wasn't due to the use of a breadboard. It only underlines the need to troubleshoot this part of your project before moving on to the PCB...

Yes, I see it now, sorry. I'd place a 100nF cap very close to pin 7 and to pin 21 as well as pin 20. In this case I'd probably do it the dirty way and tie 21 & 20 together and use one cap for both. In your schematic I only see the 10uF close to pin 7, but that's not ideal. You want something like 47~220nF close to the microcontroller's Vcc pins (one cap for each Vcc pin) to clean up the power supply. It's likely not the cause of your problem though.

Look, first get that FTDI connection to work with the 328P on a breadboard. Before you get that working, it's a wild goose chase anyway since we might be facing issues with your PCB (and underlying schematic) or some other issue.

You can try downloading and installing the latest FTDI driver following the steps below:

  1. Download the driver executable file from FTDI's website here into the Arduino drivers folder on your computer and run it from there.
  2. In the dialogue box that opens, extract the executable installation file.
  3. On the FTDI CDM Drivers dialogue page, click on Extract.
  4. Click on Next in the Device Driver Installation Wizard dialogue page.
  5. Thick I accept this aggreement and click Next in the Licence Agreement dialogue page.
  6. Click Finish to complete the installation.

yeah, I swapped the values of caps at regulator output cap and the cap near the pin 7. though i didn't used cap at AVCC as I thought ferrite will work.

@Dozie thanks for the info. I will update the ftdi driver, set my circuit up on breadboard, and update you guys asap.

@Dozie @anon35827816 glad to let you know it is working on breadboard..I don't understand what did I do different this time...But I think I understood the mistakes I did on PCB :

  1. Mistakenly used 100nF cap between reset and DTR instead of 10nf.
  2. Used high values of termination resistors (1k).
  3. Didn't update the drivers.
  4. Had to manually press reset button at correct time just before the three time blinking
    if these three mistakes were present, to upload it successfully.
    thanks, @koraks... one should always look for the basics first.

Sounds good, this is very promising; well done!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.