NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » Unable To Use Nerdkits USB Cable and ATmega32 or ATmega32A
October 02, 2010 by JimSmith4321 |
I'm unable to get the NK USB programmer to work with ATmega32/ATmega32A. The foodloader compile goes fine:
I then program that foodloader.hex into the ATmega32 or ATmega32A using an STK500 with essentially the same settings as for a 328p. But when I try to use the NK USB to load a program, avrdude goes into an infinite loop:
NK USB cable is connected as follows: red: unconnected, black: ground, yellow: MCU pin 14 ((RXD) PD0), turquoise: MCU pin 15 ((TXD) PD1) I have tried setting MCU pins 20 ((ICP1) PD6) and 16 ((INT0) PD2) to ground - same result. The ATmega31/ATmega32A breadboard is configured as: power supply = 5.0 v at VCC, AVCC, AREF, and RESET (tried RESET connected and unconnected - same result), 0.1uF cap between VCC and GND, 14.7465 crystal between XTAL1 and XTAL2, XTAL1 and XTAL2 connected to GND via 18pF caps. Any suggestions? |
---|---|
October 03, 2010 by mrobbins (NerdKits Staff) |
Hi Jim, While I don't have the ATmega32 or ATmega32A chips to look at here, I would suggest that you take a close look at the microcontroller's fuse settings. There are several settings that control whether a bootloader is used at all upon chip startup, and what memory location that bootloader is held in. You might also try interacting with the bootloader via a serial terminal program to see if that code is running at all. Mike |
October 24, 2010 by JimSmith4321 |
Can you please comment on mcu 328P pin 14 (labeled PB0, PCINT0/CLKO/ICP1 in the 328P datasheet) and mcu 32A pins 20 (PD6, ICP1) and 16 (PD2, INT0). In the NK LCD project pin 14 is set to ground to set the mcu to programming mode. Which 32A pin should serve this function? |
October 24, 2010 by Ralphxyz |
"But when I try to use the NK USB to load a program, avrdude goes into an infinite loop:
On a 168 and 328 that hang up is usually fixed by unplugging and replugging in the USB cable. A alternate fix is a reboot. Just out of curiosity if you have a STK500 couldn't you load a program using ISP without having a bootloader? That might be a good way to check your fuse settings also. Ralph |
October 24, 2010 by Rick_S |
Unless you changed the code in the bootloader, PB0 is located on pin 1 of the Atmega32a. That would be the pin that would have to be grounded to place the bootloader into programming mode. Rick |
October 24, 2010 by JimSmith4321 |
Rick_S --- Thanks, I do understand which pin PB0 is - I want to know which pin serves the same function (setting the mcu prepared for in-system-programming) in the ATmega32A as 14 does with the 328P. Ralphxyz --- yea I've found that same fix. I want to use the NK programmer for in-system-programming. That is to use the STK500 I have to remove the mcu from its application circuit and place it in the STK500. With the NK USB isp I won't have to that. Thanks anyway guys. |
October 24, 2010 by Rick_S |
Pin 1 on the Atmega32 is the equivlant of pin 14 on the 168/328. Pin 1 of the Atmega32 would be the pin to ground to put the 32 into programming mode if the bootloader was compiled with it's default settings. Rick |
October 24, 2010 by Rick_S |
Also, you do realize to install the bootloader, you will have to use the ISP programming from your STK500. You will also have to set the fuses to configure the bootloader space and lock it so it won't get overwritten. You should be able to figure out the fuse settings by looking at the fuse settings for the 168 or 328 and determining what the equivalent in the 32 would be. Rick |
Please log in to post a reply.
Did you know that you can make a capacitive proximity sensor with some aluminum foil and paperclips? Learn more...
|