5
\$\begingroup\$

I have just assembled a new USBasp which is a USB programmer for Atmel AVR microcontrollers. Is there any way under Linux to check its health without any other microcontrollers connected to it?

\$\endgroup\$
1
  • \$\begingroup\$ Any comment about the answer below, I find it more convenient to read a uC to check programmer. \$\endgroup\$
    – user.dz
    May 30 '15 at 17:44
6
\$\begingroup\$

You can only check if the PC can communicate to the programmer. You can't check if the programmer can interface with an (unconnected) microcontroller.

I don't have such a programmer to verify the exact workings, but the concept should be a bit like this:

Recipe

Execute this command:

avrdude -p attiny13 -c usbasp -P usb -v -U flash:r:/dev/null:i

It will try to read the flash memory from the connected microcontroller.

PC cannot connect to programmer

If it throws a:

avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

then your programmer does not respond to the PC, for whatever reason.

PC can connect to programmer but not communicate to AVR

If it throws (similar to):

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

then the PC can interface with the programmer.

Without connecting to a microcontroller, you cannot be sure that the programmer. If you have access to an oscilloscope, you can check if the RESET line toggles, but you won't be able to fake the handshake without a smart piece of electronics.

Fully functional

If you connect an AVR to the controller, make sure you have the correct device set up in the commandline (attiny13 in my example). If all is set up correctly, avrdude will show a 100% progress bar.

Reading | ################################## | 100%

In this case the programmer proven is fully functional

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.