ATMega328P-AU, blink doesn't work, serial works

Hello!
Trying to build up some custom project based on ATMega328P-AU. Soldered 3 pieces, one of them works as expected, two other working very strange. All of them has minimum circuit, 10k pull-up on reset, 16Mhz resonator, decoupling 0.1uF cap.

I'm able to write bootloader (tried Uno otpiboot, and tried also with internal 8Mhz resonator) and program.
Arduino IDE 1.0.6 confirms that bootloader is written and verification was succeed:
avrdude: input file C:\Program Files (x86)\Arduino\hardware\arduino\bootloaders\optiboot\optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 32.89s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified

Uploading Blink (added Serial.begin(9600); in setup() and Serial.println("Test msg"); in loop()):
avrdude: load data flash data from input file C:\Users*\AppData\Local\Temp\build3951918742515243614.tmp\Blink.cpp.hex:
avrdude: input file C:\Users*
\AppData\Local\Temp\build3951918742515243614.tmp\Blink.cpp.hex contains 2632 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.56s

avrdude: verifying ...
avrdude: 2632 bytes of flash verified

Adding led to pin 13 do not work, pin 13 measured with multimeter always giving low (0 V).
Tried another digital pin, result the same.

Adding board to FTDI adapter gives "Test msg" in serial - so this works. But trying to program with FTDI adapter giving an error:
avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM13
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [00]
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done. Thank you.

Do not have an ideas, please help! :slight_smile:

Read an article - ATmega Slugs - News - SparkFun Electronics
My chips also came from China (ebay). If no other suggestions, will try some trusted suplier and their chips.

ieris:
Trying to build up some custom project based on ATMega328P-AU. Soldered 3 pieces, one of them works as expected, two other working very strange. All of them has minimum circuit, 10k pull-up on reset, 16Mhz resonator, decoupling 0.1uF cap.

You didn't mention the loading capacitors on the resonator.

Once you start breadboarding, simple errors trump dodgy components from China.

Adding led to pin 13 do not work,

Physical pin 13? Which is not the same as D13 - which is PB5, physical pin 19 on the TQFP package.

CrossRoads:

Adding led to pin 13 do not work,

Physical pin 13? Which is not the same as D13 - which is PB5, physical pin 19 on the TQFP package.

Grrrr... :0
Can't believe that I made so trivial error! :slight_smile:

Thank you!

Glad to help.

Have you apologized to the Chinese?