We're going to open Atmel Studio and add our device pack for ATtiny, then add our hardware programmer to the list of devices we can use to programme from within Atmel Studio (such as the Atmel ICE programmer). This should speed up our development iterations over using avrdude from the command line each time we want to upload code to the ATtiny.
Open up Atmel Studio and open Tools\Device Pack Manager:
On Windows you may be asked if you want Device Pack Manager to make changes to your system. I clicked Yes.
If you have a green icon and an "Install" button next to ATtiny DFP 1.3.229 click it and follow the instructions so it installs and you end up looking like this:
You can now close the Device Pack Manager and go back to the main Atmel Studio screen. Now we're going to add our jtag2updi Arduino as a hardware programmer that uses avrdude from within Atmel Studio. Click Tools\External Tools
And a window will pop up like this one, which you are going to copy the contents of into yours:
- Title. Give the tool a descriptive title - note that this tool is tied to the part you're programming because of how it commands avrdude. So you need to add external tools for each part you program, as far as I know.
- Command.
C:\avrdude\avrdude.exe
This, except make sure the file path is wherever you have saved avrdude.exe:
- Arguments. The key part to get here is the target part being programmed (look in avrdude.conf for nicknames of parts) and the COM port number (6 in my case)
avrdude -P com6 -c jtag2updi -p t402w -U flash:w:$(ProjectDir)Debug\$(TargetName).hex:i
- I followed a guide which didn't mention putting anything in Initial Directory and to tick Use Output window but leave unticked both Prompt for arguments and Treat output as Unicode.
- Then click OK.
You should be all set to programme your ATtiny402 from Atmel Studio now! I have written this guide a couple of weeks after I first went through the process so if I have missed a step, please shout in the comments.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hello. Now, Atmel studio is Microchip studio. I instralled the last version (7.0.2594.) I do not see any "Device pack manager" item in the tools menu... How to proceed ?
Two hours later : I re-installed µchip studio, and then I got the menu item. Going farther ...
Are you sure? yes | no
Sorry, I've avoided microchip studio / mplab. Hope you got it working.
Are you sure? yes | no
"Device pack manager" appears only in "advanced mode" user interface profile. Everything is ok, I can now download code to Attiyny814 target and UPDI interface.
Are you sure? yes | no
This was extremely helpful. Just a few tweaks:
In the "Arguments:" box, it worked for me *not* to put "avrdude" at the beginning. That's already taken care of in "Command:"
I had to include the -C <config-file> option. I was working from a previous setup in the Arduino IDE and the config file was in <user>\Documents\ArduinoData\packages\megaTinyCore\hardware\megaavr\2.2.6\avrdude.conf
I had to make the -U option:
flash:w:"$(ProjectDir)Debug\$(TargetName).hex":i
Note the quotes, because the generated path contained spaces.
Overall, though, extremely helpful!
Are you sure? yes | no
Thanks for the additional details. I'm sure it will be helpful.
Are you sure? yes | no