Can't upload sketch to Atemga328p

Hi again,

I'm succesfully bootloaded Atmega328p without any items (only wires) but i have problem.
When i connected 13 arduinopin to led it blinks :slight_smile: I removed atmega from arduino and connect it to PC. I uploaded succesfully sketch Fade do 13arduinopin (TX and RX fast blink) but it blinks again.

Please help me fast.

I removed atmega from arduino and connect it to PC.

How'd you do that?

If you expand the bottom area of the IDE, does it show a successful download?
With a small area, you might just see "avrdude done. thank you"
which doesn't really tell you anthing.

You can also select File:Preferences and turn on Verbose Outputs to see a lot more of what really happens during the download.

Sorry for my mistake.
I removed atmega from arduino and connect ardunio with atmega on breadboard to PC.

I enabled Verbose outputs and this is log from uploading:

Use the Reply button and the Additional Options to Attach your picture.
Or just Copy & Paste the bottom area of the Ardiuno screen here. I can't open pastebin pictures.

When I compile it i see this on end:

avrdude: Recv: . [10] 
### | 100% 0.41s

avrdude: verifying ...
avrdude: 1346 bytes of flash verified
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

On bottom blue panel i see only board name


Please help me... I need it for Christmas

That upload looks okay. So what is it you want it to do?
Post you sketch and what you have wired up.

Sketch is normal Fade with changed pin to 13
I use this photo:

I connect VCC(pin 7) and GND(pin 8) to 5V usb 1a.
19pin on ATmega (PB5) goes to "+" of LED with resistor
GND from power adaptor connected to "-" LED

In sketch only change is:
"int led = 13;"

You need to connect AVCC to VCC.
You need to connect to both GNDs on the chip.

Which board type did you select when you bootloaded the chip?

I've connected AVCC ang GND's and nothing happen.
I selected Atmega328(internal 8mhz), the same which I used to bootload

This is where those components come - 10K reset pullup resistor, 0.1uF cap from Vcc & AVcc to Gnd.

Where does the 'Fade' sketch come from?

This one, from the examples?

 This example shows how to fade an LED on pin 9
 using the analogWrite() function.
 This example code is in the public domain.

int led = 9;           // the pin that the LED is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by

// the setup routine runs once when you press reset:
void setup()  { 
  // declare pin 9 to be an output:
  pinMode(led, OUTPUT);

// the loop routine runs over and over again forever:
void loop()  { 
  // set the brightness of pin 9:
  analogWrite(led, brightness);    

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade: 
  if (brightness == 0 || brightness == 255) {
    fadeAmount = -fadeAmount ; 
  // wait for 30 milliseconds to see the dimming effect    

That works because 3,5,6,9,10,11 support analogWrite to supply a hardware PWM signal to the pin.
13 does not, the sketch would need to be rewritten to create a software PWM.
Try with one of the PWM pins.

Thank you it works :slight_smile:
Small mistakes are the worst :smiley:

No problem. I've done the same myself.
Worst: using SPI to send data to shift registers, while also trying to use the L LED for debugging. And worse, I had forgotten I had moved L LED to another pin because I knew I was going to be doing a lot of SPI activity (uses SCK, D13, which normally drives L LED).

Another gotcha - downloading to a new board without burning the bootloader first. Always good for a 1/2 hour to two of frustration. Haven't done that in a while.