There is not much way to tell what may be wrong. Please give a lot more information. Does the ATmega328P have a bootloader on it, and if so, what bootloader? What selections do you make from the Tools menu in the IDE? Version of IDE and OS? Set the IDE preferences to show verbose output on upload and show the results of an attempted upload. Show a photo of both sides of the board when connected using your FTDI. Show a schematic of the PCB. I suggest removing the 1K resistor to ground. Do the loopback test mentioned in one of the pinned posts on the Installation and Troubleshooting forum and tell results of that. Tell what happens with the flashing of an LED connected to PB5 during upload and during reset of the MCU.
As my experiences this fault is usually caused by Reset pin not working properly. So focus on the Reset pin.
It's also possible that the fault is from the FTDI device. Have you tried using UNO board to upload programs. I think UNO board is more reliable than FTDI device.
I have checked the RESET pin 1 on the MCU. It goes from 5V to 0V when Reset button is pressed or when DTR is asserted when downloading code ( or trying to download !)
I have changed the crystal
I am yet to change the two 22pf capacitors from pins 9 and 10 to GND.
I loaded the MCU with a simple Blink sketch on a UNO , removed the MCU and put it on this new board. Blink does not blink
So its clear that the Oscillator section is dead on board ... but cannot figure out why. For those interested I have attached the schematic as the PCB was made...
I want to use a 30MHz Oscilloscope and see if the oscillator is beating... how to go about this ??
OK got it .. I should expect to see a Square wave of period 0.0625 micro second across pins 9 and 10 . Lemme try this and get back.
But what is confounding is the fact that the MCU is refuses to oscillate - I suppose if the MCU / 16Mhz crystal and the two 22PF capacitors are OK / Reset pulled up to 5V, Oscillation should set in ?
Mogaraghu:
<...>
But what is confounding is the fact that the MCU is refuses to oscillate - I suppose if the MCU / 16Mhz crystal and the two 22PF capacitors are OK / Reset pulled up to 5V, Oscillation should set in ?
One would expect so...
But, while the barebones circuit is simple, lots can go wrong...
breadboards and jumpers add capacitance and
jumpers add resistance and inductance
Do you even know for sure that the 22pF are really 22pF? Like, were they ordered from a reputable vendor? Do you have a capacitance meter?