What do i need to update my OS via USBtiny?

… or where can i read about it?

i’ve built a usbtiny programmer.

wow, i don’t even know what hardware configuration i have to assemble so i can plug in the chip to actually program it. but i guess it’s not that much, so i can DIM?
maybe someone could give me a hint where i can read how to do it?

nope, if someone should apologize then me… i’m completely new to avr and programming, and asking probably silly questions… like this:
when i have made the connections and plugged the chip in my protoboard “programmer” can i just send the “shruti1_0.57.hex” file with avrdude or avrstudio right away or will i have to compile something and/or upload bootloader first?

Hi,

The shruti-1 doesn’t have an ISP connector, so you have to “transplant” the chip out of the socket into a minimal hardware environment to program it. You’ll need a 16MHz crystal with its caps, maybe a bypass cap, and that’s pretty much it. You can power it from the +5V/GND rails from the Shruti. For example: http://art364.pbworks.com/Standalone+Arduino . Then you have to make your own connection from the CLK/MISO/MOSI pins of the programmer to the chip.

cool, thanks! i’ll try this!

I just use protoboard for programing my avrs and just fly some wires from the usbtiny header to the appropriate ISP pins. A bypass cap is a must also…

from ATmega328P datasheet:

from USBtiny

and the Standalone Arduino

i’m a bit confused which pins i actually have to connect to the programmer…
from the standalone arduino pic i had the impression i’d have to connect pins 2+3 (somehow) and 5V & GND…
now i wonder if it’s maybe PINS 14 (or rather 19 (SCK)),17 & 18 + the power supply…

btw can i also take the power from the USBtiny thing instead of messing with a 5V supply (although i have a good one) ?

or should i better wait a few days until i receive my programmer i’ve ordered and just stop confusing myself??

There’s a difference between the way that the arduino environment sends code to the microcontroller and how data is transmitted via the ICSP header.

ISP (in-system programming) uses the MOSI & MISO pins to receive & send data, the CLK pin to clock in the data (so it knows when the next bit is) and the RESET pin is held low to enter & stay in programming mode. The other two pins allow you to remotely power the device (you can program it without plugging the device in.) I’d reccommend doing it that way. Use the datasheet image above as a reference for which pins to use. Disregard the arduino RX/TX pins (that’s how the arduino bootloader sends & receives data, not ISP)

If you build your ‘standalone’ circuit as shown above you have to make one modification: Instead of connecting RESET to +5V, you’ve got to pull it up to 5v with a 10k resistor… The program has to be able to pull that pin to GND to enter programming mode.

If that wasn’t helpful enough i’m sure you’ll find whatever answers you need here:

http://www.atmel.com/dyn/resources/prod_documents/doc0943.pdf

Sorry for not being clear with the link I sent you. As said SMRL, using TX/RX would make sense if you used the “programming by sending STK500-formatted data to the UART” approach, but then, if you wanted to do so, you could simply leave the chip on the Shruti and use the TX/RX pins.

Since you have an ISP programmer, you have to connect SCK/MISO/MOSI/RST/5V/GND.

Note that the Shruthi has an ISP header (2x3 connector) so there won’t be this problem in the future. The “Arduino-style” programming is not supported anymore.

You can send shruti1_0.57.hex with avrdude. This will overwrite the existing firmware and the bootloader, but since MIDI update did not work for you, it’s OK if the bootloader is gone. Are you programming a blank chip or the one that came with the kit? If this is a blank chip, you’ll have to set the fuses too.

ok, so the bootloader is just needed for the midi update.

i think i’ll try the one i have- i guess i can try it over & over until it works without killing it :smiley:

well, let’s see how i messed it up:

C:\\>avrdude -c usbtiny -p m328p -U flash:w:shruti1_0.57.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "shruti1_0.57.hex"
avrdude: error opening shruti1_0.57.hex: No such file or directory
avrdude: input file shruti1_0.57.hex auto detected as invalid format
avrdude: can’t open input file shruti1_0.57.hex: No such file or directory
avrdude: write to file ‘shruti1_0.57.hex’ failed

avrdude: safemode: Fuses OK

avrdude done. Thank you.

C:\\>

and it doesn’t matter in which directory i have the hex file. i tried in C: , the winavr\\bin folder, the winavr folder with and without the whole path
any ideas?

at least the chip has really been erased
because it doesn’t boot the Shruti anymore :frowning:

so i hope it’s just a small issue.

flash:w:shruti1_0.57.hex:i to explicitly specify that the firmware is in intel hex format?

C:\\>avrdude -c usbtiny -p m328p -U flash:w:shruti1_.0.58.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.
avrdude: erasing chip

avrdude: reading input file “shruti1_.0.58.hex”

avrdude: can’t open input file shruti1_.0.58.hex: No such file or directory

avrdude: write to file ‘shruti1_.0.58.hex’ failed

avrdude: safemode: Fuses OK

avrdude done. Thank you.

C:\\>

i tried this, with the 0.57 and the 0.58 file. i have the files in the C:\\ main directory of the system harddisk.
but still the same… weird

Could it be because the file name is invalid? There’s no . after the _, it is shruti1_0.58.hex

yay! it worked! i also tried it without the typo, but still the same… then i saw in the downloads folder that it was actually a .TXT file:
and shruti1_0.58.hex.txt works indeed:

C:\\>avrdude -c usbtiny -p m328p -U flash:w:shruti1_0.58.hex.txt

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "shruti1_0.58.hex.txt"
avrdude: input file shruti1_0.58.hex.txt auto detected as Intel Hex
avrdude: writing flash (30686 bytes):

Writing | ################################################## | 100% 81.70s

avrdude: 30686 bytes of flash written
avrdude: verifying flash memory against shruti1_0.58.hex.txt:
avrdude: load data flash data from input file shruti1_0.58.hex.txt:
avrdude: input file shruti1_0.58.hex.txt auto detected as Intel Hex
avrdude: input file shruti1_0.58.hex.txt contains 30686 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 41.93s

avrdude: verifying …
avrdude: 30686 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.

C:\\>

cool thanks man, now i have to try the Synth!
that was the 1st time i programmed a chip!

works!
:smiley:

Congrats!