- Wed Sep 02, 2009 9:42 am
#80121
I am new to AVR microcontroller and I have problem with my first project: blinking an LED.
Problem: I can't get it to blink.
I recently bought ATmega328 with Sparkfun AVR Pocket Programmer and I'm not sure if it is my circuit or programmer or microcontroller that is wrong.
I stronly feel that the programmer is not working properly but I thought that asking here before sending an email to Sparkfun is a good idea.
OS: Microsoft Windows XP Proffesional Version 2002 Service Pack 3
Programmer: Pocket AVR Programmer (usbtiny from Sparkfun)
(installer for it is in the same page as in hyperlink above)
Program used: AVRDude
Microcontroller: ATMEGA328P-PU
File used: blink_1MHz.hex (from Sparkfun Tutorial)
(above zip also contains C code)
Most of the time after connecting the USB, the computer detects unkown hardware although I installed it.
When this happens, only the blue light in the programmer lights up.
I typed the following in command prompt after changing directory to where blink_1MHz.hex is saved:
Once in a while (after disconnecting and re-connecting the usb about 20-30 times), the Stat1-red-light in the programmer lights up.
When this happens, I type the above command again and get the same results.
However, sometimes, the Stat2-red-light blinks once and the result is:
Image 1:
Image 2:
Image 3:
Image 4:
Image 5:
Image 6:
Image 7:
I have checked the circuit several times including making sure that the wires were firmly connected.
Other facts:
I do not have a usb hub as this page suggests to use (and I do not want to buy one since it might still not work).
One of the comments in this page from Sparkfun says that the MISO,SCK,RST,MOSI is printed in reverse but I have tried connecting both ways.
Is it the programmer thats broken?
Is it the microcontroller thats broken?
Is my circuit wrong?
Should I contact Sparkfun?
Did this happen to those using the same Pocket Programmer?
I would appreciate any comments, suggestions, opinions, similar problems, etc.
Thank you!!
Problem: I can't get it to blink.
I recently bought ATmega328 with Sparkfun AVR Pocket Programmer and I'm not sure if it is my circuit or programmer or microcontroller that is wrong.
I stronly feel that the programmer is not working properly but I thought that asking here before sending an email to Sparkfun is a good idea.
OS: Microsoft Windows XP Proffesional Version 2002 Service Pack 3
Programmer: Pocket AVR Programmer (usbtiny from Sparkfun)
(installer for it is in the same page as in hyperlink above)
Program used: AVRDude
Microcontroller: ATMEGA328P-PU
File used: blink_1MHz.hex (from Sparkfun Tutorial)
(above zip also contains C code)
Most of the time after connecting the USB, the computer detects unkown hardware although I installed it.
When this happens, only the blue light in the programmer lights up.
I typed the following in command prompt after changing directory to where blink_1MHz.hex is saved:
Code: Select all
The result is:
avrdude -c usbtiny -B 1 -p atmega328p -U flash:w:blink_1MHz.hex
Code: Select all
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
Once in a while (after disconnecting and re-connecting the usb about 20-30 times), the Stat1-red-light in the programmer lights up.
When this happens, I type the above command again and get the same results.
However, sometimes, the Stat2-red-light blinks once and the result is:
Code: Select all
Once in about another 20-30 times of repeating the above when Stat1-red-light is lit, I get the following:
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Code: Select all
avrdude: error: usbtiny_transmit: usb_control_msg: sending control message faile
d, win error: A device attached to the system is not functioning.
avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed
, win error: A device attached to the system is not functioning.
(expected 4, got -5)
avrdude: AVR device initialized and ready to accept instructions
Reading | | 0% 0.00s
avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed
, win error: A device attached to the system is not functioning.
(expected 4, got -5)
avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed
, win error: A device attached to the system is not functioning.
(expected 4, got -5)
Reading | ################# | 33% 0.10s
avrdude: error: usbtiny_receive: usb_control_msg: sending control message failed
, win error: A device attached to the system is not functioning.
(expected 4, got -5)
Reading | ################################################## | 100% 0.14s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude: error: usbtiny_transmit: usb_control_msg: sending control message faile
d, win error: A device attached to the system is not functioning.
avrdude done. Thank you.
Image 1:
Image 2:
Image 3:
Image 4:
Image 5:
Image 6:
Image 7:
I have checked the circuit several times including making sure that the wires were firmly connected.
Other facts:
I do not have a usb hub as this page suggests to use (and I do not want to buy one since it might still not work).
One of the comments in this page from Sparkfun says that the MISO,SCK,RST,MOSI is printed in reverse but I have tried connecting both ways.
Is it the programmer thats broken?
Is it the microcontroller thats broken?
Is my circuit wrong?
Should I contact Sparkfun?
Did this happen to those using the same Pocket Programmer?
I would appreciate any comments, suggestions, opinions, similar problems, etc.
Thank you!!