Burning bootloader on Atmega using Arduino Errors

So I'll have enough? From the sounds of it, yes.

Coding badly, Sensei, where do I proceed from here? I am running windows 7.

After changing “COM9” to the serial port of your Duemilanove, run this…

avrdude -patmega328p -cstk500v1 -P\.<mark>COM9 -b19200

Ah, that helps, However, I still can’t see the point of using the bootloader with the internal oscilator, because unless you calibrate the oscillator, surely the serial timing is likely to be too far out for communication to the bootloader via a serial interface to work?

Xyver: ... SO after all this, how many I/O pins will be available? 23 total, minus the crystal that uses 2, so down to 21?

EDIT:: I need to run 5 RGB LED's (15 digital outputs), 6 pushbuttons (6 digital inputs), and one microphone (analogue input) for a total of 21 digital I/O's, and 1 analogue input. Is there anyway to use that on less pins?

There are many ways to use fewer pins:

  • You could multiplex the 5 RGB LEDs 5 x 3 using some transistors (saves 7 pins)
  • You could multiplex the pushbuttons 3 x 2 using 2 digital outputs and 3 digital inputs (or vice versa) using some diodes (saves 1 pin)
  • You could do both of the above and make the 3 digital outputs common to both the LEDs and the pushbuttons (saves 8 pins)
  • You could use a TLC5940 chip to drive the LEDs from 3 digital outputs, if they are common anode (saves 12 pins)

However, unless you need the timing accuracy of a crystal oscillator, you may as well use the internal oscillator, giving you 22 pins (or 23 if you don't need RESET).

[EDIT: yet another solution is to use the 32-pin SMD version of the atmega328p because it has 2 extra i/o pins.]

Well, I already bought these 328's, maybe ill but the different ones for a future project. I don't believe I need reset, I'm setting up two boards, one to program the chip, and then moving it over to the other board that will be on the project.

I dont need super precise accuracy, so I am not planning on using an external crystal. Pretty much, the project reads the state of the button, and how many times they were pressed, and lights up different lights according to what state the buttons are at.

Version two, is using a microphone to listen to the beat of music, and flashing the lights on in time to the music.

I'll be working on this tonight, so I'll be back with more questions, I'm sure.

I changed it to COM5, and then ran it in the command line. Thats what you meant, right?

Anyways, it thought for a sec, then the same error came up. Not in sync.

After, it said avrdude done. Thank you.

And yes, I checked, and the line arduinoisp.speed 19200 is there.

This error...

avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude: stk500_getsync(): not in sync: resp=0x15

Add verbose…

avrdude -v -patmega328p -cstk500v1 -P\.\COM5 -b19200

Late in the output should be this…

avrdude: AVR device initialized and ready to accept instructions

C:\Windows\system32>avrdude -v -patmega328p -cstk500v1 -P\.\COM5 -b19200

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"

Using Port : \.\COM5 Using Programmer : stk500v1 Overriding Baud Rate : 19200 avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done. Thank you.

C:\Windows\system32>

Error resp0x00 instead of error resp 0x15... Something has changed.

Arduino ISP did not respond. Very likely because auto-reset is not disabled.

Re-upload the Arduino ISP sketch to ensure it is installed.

Connect a 120 ohm resistor from RESET to 5V.

Try the command in my previous post.

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>avrdude -v -patmega328p -cstk500v1 -P\.\COM5 -b19200

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"

Using Port : \.\COM5 Using Programmer : stk500v1 Overriding Baud Rate : 19200 AVR Part : ATMEGA328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail :

Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Max W ReadBack



eeprom 65 5 4 0 no 1024 4 0 3600 36 00 0xff 0xff flash 65 6 128 0 yes 32768 128 256 4500 45 00 0xff 0xff lfuse 0 0 0 0 no 1 0 0 4500 45 00 0x00 0x00 hfuse 0 0 0 0 no 1 0 0 4500 45 00 0x00 0x00 efuse 0 0 0 0 no 1 0 0 4500 45 00 0x00 0x00 lock 0 0 0 0 no 1 0 0 4500 45 00 0x00 0x00 calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00 signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500 Description : Atmel STK500 Version 1.x firmware Hardware Version: 2 Firmware Version: 1.18 Topcard : Unknown Vtarget : 0.0 V Varef : 0.0 V Oscillator : Off SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.

avrdude done. Thank you.

When I go back to try and burn bootloader, it still says error, not in sync (resp 0x15).

Should I try another 328? I might have screwed this one up. I might have accidentally try to burn the uploader when "Atmega 328 (use internal clock)" wasnt selected...

Or should I continue?

EDIT:: Tried a new chip. same errors.

avrdude: AVR device initialized and ready to accept instructions

Perfect. That means everything up-to the target processor is working correctly.

Should I try another 328?

Yes but do not try to burn the bootloader until the previous command outputs the fuse settings and no error messages.

I might have screwed this one up. I might have accidentally try to burn the uploader when “Atmega 328 (use internal clock)” wasnt selected…

If you did, the processor will have to have an external clock. Put a sticky-note on that processor with a brief description of the situation and move on to a fresh processor.

EDIT:: Tried a new chip. same errors.

“Tried a new chip”? Using the AVRDUDE command in the earlier post? Or trying to burn the bootloader?

AVRdude commands.

The command line also says this:

avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.

What does that mean? Can we ignore it?

What does that mean?

It means that the programmer (your Duemilanove) is not communicating with the target processor.

Is that the result of trying to communicate with a fresh processor? If yes, then you need to very carefully check the wiring.

Can we ignore it?

No. Until the previous AVRDUDE command outputs the fuse settings and no error messages there is no point in continuing.

Well, still getting the "Yikes!" message. My wiring is identical to this: http://arduino.cc/en/Tutorial/ArduinoToBreadboard (which I've been following from the beginning.

Pin 10 (arduino) to Pin 1 (ATMEGA) Pin 11 to Pin 16 Pin 12 to Pin 17 Pin 13 to Pin 18.

Pin 11 to Pin 16

No matter how you number the pins, that connection cannot possibly be correct.

... This is the part where I'm about to feel like an idiot for missing something important...

EDIT:: Nope, only a little idiot :D I didn't connect it that way, I just reported it wrong. Was miscounting the pins.

11 to 17 12 to 18 and 13 to 19.

Exactly how it shows it done in that tutorial.

And I looked it up, and those connections line up (I think... not sure if I completally understand MOSI and MISO).

Pin 11 on the arduino is MOSI (master out, slave in), and pin 17 is MOSI as well. So since the arduino is the master, and the ATEMEGA is the slave, do I connect Arduinos MOSI to ATMEGAS MOSI? Or Arduino MOSI to ATMEGAS MISO.

The three lines are connected to each other: SCK connected to SCK, MISO to MISO, MOSI to MOSI.

Is the target a fresh processor?

Yes. Those lines are correct, and the target is a fresh processor