Author Options:

how 2 program usbtiny firmware.i use dapa pogrammer and winavr 2009 how to write on cmd for programming usbtiny firmware Answered

how to program usbtinyisp firmware.i use dapa port lpt1 pogrammer and winavr 2009 how to write on cmd for programming usbtinyisp firmware.

please write the command (batch file) for programming the firmware. :)
im beginer on avr


The forums are retiring in 2021 and are now closed for new topics and comments.

11 years ago

Go to Ladyada's site and download the firmware ZIP file. The precompiled firmware is in the spi directory.

There's a Makefile,too, but it's configured for the usbtiny interface.

AVRDUDE is the utility that programs the AVR. You make it work, you must edit the Makefile--or run avrdude manually.

Here's the avrdude command in the Makefile:
avrdude -c usbtiny -B 1 -pt2313 -U flash:w:main.hex

To make it work with a DAPA interface:

avrdude -c dapa -pt2313 -e -U flash:w:main.hex

-- interface type to DAPA
-- No baudrate needed for DAPA (no -B)
-- erase the AVR (-e)

You can embed this in the Makefile, or just execute it directly from the shell / cmd line.

(There seems to be a lot of confusion here about make and the associated Makefile, and what they actually do...)

Of course, this will only work if:
-- "main.hex" is in the current directory
-- A working DAPA interface is connected to a working (powered) AVR
-- the AVR is an ATtiny2313


Answer 11 years ago

how to write the command for using external oscillator (12Mhz)?


Answer 11 years ago

No biggie. For the USBtinyisp hardware, I assume?

The schematic shows a 12MHz crystal, rather than an external oscillator (the two are different, and the fuse setting aren't the same.)

The fuse bit programming command (from the same Makefile) is:

avrdude -c usbtiny -pt2313 -U hfuse:w:0xdf:m -U lfuse:w:0xef:m

So if you're using the DAPA cable, it should be changed to:

avrdude -c dapa -pt2313 -U hfuse:w:0xdf:m -U lfuse:w:0xef:m

NOTE: I have not done this. Changing the fuse bits is always the most dodgy part of AVR programming. They fundamentally alter the way the device functions--altering the clock source and such.

Also, there's a second command for the fuses in the Makefile, which is commented out. I assume the line above is the correct one for the 12MHz crystal (since that's what's in both the schematics I saw.)

Be aware: (or beware!) after reprogramming for an external xtal, the AVR will no longer function without that clock source (of course, you could hookup a crystal and then reset the fuse bits for the internal oscillator.)

The only other recourse for resetting fuse bits is to use "high-voltage programming," but most simple ISP programmers (including USBtinyisp) can't do it...