Programming HEX file on ATmega16 using Arduino UNO - Page 1
Forum section: electronics / general

author: emilpreda
author_rank: Newbie
timestamp: April 14, 2016, 12:52:29 am
content: Hi ! I am trying to build a DDS Signal generator, according tohttp://www.scienceprog.com/avr-dds-signal-generator-v20/As the title suggests, I have the source code and hex for the ATmega16. After several hours of search I can't figure out if it can be programmed using an Arduino UNO or I should buy an universal programmer.Regards,Emil

author: sleemanj
author_rank: Super Contributor
timestamp: April 14, 2016, 01:37:35 am
content: Yes, put ArduinoISP on your Arduino, connect appropriately and use avrdude to burn it.With that said, a USBasp is a few dollars from the usual places, buy one, save yourself trouble.

author: Rick Law
author_rank: Super Contributor
timestamp: April 16, 2016, 05:10:38 am
content: I suggest taking a look at how one uses an Arduino to burn the boot loader on to a bare ATMEGA32. That will give you some idea how to use an Ardunio as ISP to flash another bare chip.https://www.arduino.cc/en/Tutorial/ArduinoToBreadboardAlong that line, perhaps you should consider using ATMEGA32 instead of ATMEGA16. Same chip, just more resources available. The ATMEGA32 is more easily available than the 16 due to the popularity of the Arduino. Hack, you can get an Arduino NANO for around $2.00 usd.Good luck, once you burn a few, it gets less intimidating.EDIT (adding below):Another good source of knowledge is to look at how people burning their own flashlight driver software. I learned a lot trying to program my own NANJG105c. The NANJG105c uses AMTEL ATTINY13A which is a baby brother of the ATMEGA line. A fun thing to do is to upgrade it to Attiny85 so more features can be programmed in.Look at post number 30 bydrdankein the link below, you can see howdrdankeconnect his ATTINY13A/ATTINY85 to burn the flashlight driver software using an Ardunio.http://budgetlightforum.com/node/29150Instead of a wood-mounted connection setup, I use an SOIC clip. But the photo of wood-mounted chip(s)/pin(s) connection gives a clear picture of how the ISP connections are made.I learned with the basic driver first, then upgraded to Attiny85 with my home grown driver software (in C with some C++) as a learning exercise. That was a very beneficial project. You may find reading up on what folks do and how they did it equally helpful.I learned with an Ardunio UNO but moved to an Arduino NANO and the NANO double duty (switch selected) to either run the ISP program or serve as an serial bridge. As the bridge, the NANO runs a second serial via bit-bang to the Attiny85's bit-bang serial. It listens to the bit-bang serial from the Attiny85 and pass it to the hardware USB to the PC; The NANO also listens to the hardware serial from the PC and pass it to the Attiny85. So my Attiny can print debug message via the PC, and get data from the PC.

author: retrolefty
author_rank: Super Contributor
timestamp: April 16, 2016, 06:35:48 pm
content: Keep in mind that HEX files don't include fuse configuration settings that the HEX firmware may be expecting or required.Nick Gammon's site has many Arduino utility program. The one linked below allows just about any kind of loading and reading or HEX files and FUSE settings. It's long so be sure to read it all to see the parts that may interest you the most.http://www.gammon.com.au/forum/?id=11638https://github.com/nickgammon/arduino_sketches

author: emilpreda
author_rank: Newbie
timestamp: April 24, 2016, 11:09:14 pm
content: Thank you very much for the amazing replies! Now I have more food for thoughtI went ahead and ordered 2 USBasp to make it a bit easier and now I think I know what to do.Best regards,Emil Preda