Hi, i'm new of this Forum, but i have some experience with Arduino.
I'm using ATmega328 standalone with external 16 MHz crystal. The upload of sketch is done with an USB-Serial converter without particular problems. But when i put the ATmega in the circuit, it has stop to work. I've done a test: upload the Blink sketch adding serial communication for reporting the correct execution of the program. The serial comunication runs fine, but the led is always OFF!! I had already done this circuit and, at time, it worked, but now nothing work well!
Have 22pF caps to Gnd on the crystal pins?
Have a 10K reset pin pullup resistor?
Have 0.1uF/100nF caps on Vcc, Avcc, Aref to Gnd?
LED (and current limit resistor) oriented correctly? (anode to pin if writing High to turn on, with cathode (flat bar side, & usually the shorter lead) to a resistor to Gnd)
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
Serial.write("test");
}
Your LED is connected to physical leg 13, not digital pin 13 as referenced in your blinky code (D13 is physical pin 19 on the other side and further up some).