NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » usbasp ISP Programmer

January 11, 2010
by carlhako
carlhako's Avatar

Hi

I finally received my usbasp isp from hong kong took about 2 weeks via ebay :). Anyway I have a 2nd blank chip i purchased from farnell trying to get this thing working so far no luck. Ive googled alot looking at various ways other ppl have attempted for the past 2-3hrs still no luck so i thought i would try posting here. I have tried under ubuntu and windows with the exact same output from avrdude. I suspect its my wiring from the usbasp to the chip so i have takes some pics 1 2 to give you an idea what ive done. using the ribbon cable seems to swap the rows around also i have tried powering off the nerkits usb cable and also flicking dip 2 up and down which apparently changed the speed. My output from command prompt is exactly the same as what i get from ubuntu.

I have also tried swapping for the known working nerdkits chip, not sure if still works afterwards tho have not tested yet lol. any help very much appreciated.

C:Userscarl>avrdude -c usbasp -p m168 -t

avrdude: error: programm enable: target doesn't answer. 1 avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check.

avrdude done. Thank you.

C:Userscarl>avrdude -c usbasp -p m168 -t -F

avrdude: error: programm enable: target doesn't answer. 1 avrdude: initialization failed, rc=-1 avrdude: AVR device initialized and ready to accept instructions avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. avrdude: Expected signature for ATMEGA168 is 1E 94 06 avrdude> ^C

January 11, 2010
by BobaMosfet
BobaMosfet's Avatar

I don't see anything connected to power the internal clock.

January 12, 2010
by carlhako
carlhako's Avatar

Spot on BobaMosfet i put the crystal that came with the kit between pin 9-10 worked straight away. Thanks now i can have a dedicated chip for the led array.

January 12, 2010
by Rick_S
Rick_S's Avatar

That's interesting... I've programmed many blank chips without a crystal attached. By default the micro-controller is set to use it's internal oscillator with divide by 8 on giving it a 1Mhz internal clock. (Datasheet Section 8.2.1). A new chip shouldn't need a crystal to fire up and be programmed.

On the other hand, I have purchased a couple of 328's that had an arduino bootloader installed. On those, I had to use a crystal oscillator to re-program them. This was because similarly to the NK bootloader, the Arduino bootloader uses an external clock source and the fuse bits are programmed accordingly for that.

Rick

January 12, 2010
by BobaMosfet
BobaMosfet's Avatar

carlhako-

Hahaha.... wow. I applaud you for finding a solution-- but I was actually hoping you'd peek at something else in your circuit. By seeing both sides of this however, you've just learned something really cool and expanded your understanding. Read on, brave soul, read on..... :P

Here's the solution I had in mind, and the one both you and Rick_S were looking for -- (although yours accomplished your goal initially)-- Your images don't show a connection to AVCC, AVRef, or AV Ground-- check your data sheet. The internal oscillator is controlled from the ADMux circuit, and as such, it needs power to run. The power coming in from pins 9 & 10 don't power the ADMUX.

You did an end run, by giving it an external clock. You see, if the chip has no clock source from anywhere-- it has no heartbeat. It won't execute a single instruction.

Hope this answers all questions.

BM

January 14, 2010
by carlhako
carlhako's Avatar

I did try reading a few pages in the datasheet trying to find out if it had an internal oscillator and how to power it but got nowhere, altho it did say you must provide power on the avcc and ground even if your not using the avcc. I then looked on the usbasp website there is a design with built in sockets for programming I noticed in the schematic there are 2 oscillators so thought i would try and it worked.

I received anther blank chip today ill give that a go.

Thanks again

April 04, 2010
by ese
ese's Avatar

Hi,

I recently received a usbasp programmer by Protostack. It seems to work uploading a file to a NerdKits -168 where it did need the external clock. Thanks for the Thread.

Post a Reply

Please log in to post a reply.

Did you know that LEDs (light emitting diodes) only conduct current in one direction, like normal diodes? Learn more...