Greetings! I am trying to connect to an atmega328p-pu using a usbtiny built from the adafruit kit. I'm using avrdude 5.11.1 on Ubuntu 12.04 on a Lenovo Essential B570. I'm using a diy unpowered 6-pin target board a la Evil Mad Scientist here: http://www.evilmadscientist.com/2007/us ... et-boards/.
The green LED lights when I connect the programmer and I get the "initialization failed, rc=-1" message and a brief flash from the red LED on the programmer. However, I get that whether the programmer is attached to the target board or not. I've checked the connections on the target board for shorts, haven't found any (a miracle considering my poor soldering skills!); I've checked that the pins are connected to the ZIF socket with success; and I've double checked the pinout of the 328p and I don't see anything wrong. I don't have an oscilloscope to watch what's going on on the pins.
I've attached a screenshot of my avrdude command and the error message, along with top and bottom shots of the usbtiny board. I can also attach shots of the target board if that will be helpful.
Thanks for any help!
-dmogle
Can't connect to target atmega328p-pu
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 1
- Joined: Wed May 16, 2012 9:59 pm
Can't connect to target atmega328p-pu
- Attachments
-
- usbtiny board bottom
- dmogle_usbtiny_bottom.jpg (104.42 KiB) Viewed 2666 times
-
- usbtiny board top
- dmogle_usbtiny_top.jpg (61.03 KiB) Viewed 2666 times
-
- avrdude command and error
- dmogle_avrdude.png (33.04 KiB) Viewed 2666 times
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Can't connect to target atmega328p-pu
it sounds like you have a wiring problem to the chip - the usbtiny is working fine and talking to the computer, it cant find the target chip
- abqlewis
- Posts: 71
- Joined: Fri Dec 11, 2009 2:19 am
Re: Can't connect to target atmega328p-pu
A few ideas:
1) show us your target board - even if you don't have a short on it, there might be something visible.
2) The ISP connector confuses a lot of people - If you have a meter - remove the 328 from the target board and plug it into the usbtiny and plug the usbtiny into the computer (you say you've already checked for shorts!). You should be able to measure +5v from pin 8 to 7 (and maybe 20 and 21). If you don't read 5v, the isp connector could be mis-wired or backwards (mine was backwards the first time I used my usbtiny).
3) Depending on where you got the 328, it may be setup (fuses) to require an external clock. You can try a different 328, or (what I did) get a resonator (or crystal) and hook it to the xtal inputs (9&10 I think).
4) I don't see a lot of these target (or minimalistic programming) boards with bypass caps on them, yet most would agree that a cap is extremely important, if not required, when running the micro-controller. I bricked the 2nd (or maybe 3rd) AVR I tried to program. Now my little programming board has a cap from Vcc to Gnd, and no problem since. I think it's a .1uF.
1) show us your target board - even if you don't have a short on it, there might be something visible.
2) The ISP connector confuses a lot of people - If you have a meter - remove the 328 from the target board and plug it into the usbtiny and plug the usbtiny into the computer (you say you've already checked for shorts!). You should be able to measure +5v from pin 8 to 7 (and maybe 20 and 21). If you don't read 5v, the isp connector could be mis-wired or backwards (mine was backwards the first time I used my usbtiny).
3) Depending on where you got the 328, it may be setup (fuses) to require an external clock. You can try a different 328, or (what I did) get a resonator (or crystal) and hook it to the xtal inputs (9&10 I think).
4) I don't see a lot of these target (or minimalistic programming) boards with bypass caps on them, yet most would agree that a cap is extremely important, if not required, when running the micro-controller. I bricked the 2nd (or maybe 3rd) AVR I tried to program. Now my little programming board has a cap from Vcc to Gnd, and no problem since. I think it's a .1uF.
-
- Posts: 5
- Joined: Thu Oct 14, 2010 11:04 am
Re: Can't connect to target atmega328p-pu
Hi, dmogle,
Yep, I also had the same problem where initialization failed in Ubuntu Linux.
Solution number 3 (above) worked for me, though! I threw in a 16 [mhz] oscillator on pins 9 and 10 along with two 22 [pF] capacitors. I also placed a capacitor between vcc and gnd. After that, I was able to rewrite the fuse bits, pull out the oscillator and two capacitors out, and program without them.
(I got my atmega328p-pu chips from Digi-Key)
cheers!
-- Poofjunior
Yep, I also had the same problem where initialization failed in Ubuntu Linux.
Solution number 3 (above) worked for me, though! I threw in a 16 [mhz] oscillator on pins 9 and 10 along with two 22 [pF] capacitors. I also placed a capacitor between vcc and gnd. After that, I was able to rewrite the fuse bits, pull out the oscillator and two capacitors out, and program without them.
(I got my atmega328p-pu chips from Digi-Key)
cheers!
-- Poofjunior
Please be positive and constructive with your questions and comments.