Programming AVR chips using .hex file without AVR programmer - Page 1
Forum section: electronics / general

author: VEGETA
author_rank: Super Contributor
timestamp: January 22, 2015, 08:55:52 pm
content: Hi...I have an issue where I have 2 identical boards containing ATMega644 (or ATMega644p) on them. One is working, the other have an issue with the ATMega644 software... Hence, the solution was to copy the program from the working and then burning it into the other.I don't own the boards but the one who does have succeeded in copying the software from the working one and didn't succeed in burning it on the other one for some reason.I read that Arduino boards can burn the software into other non-arduino chips... I can manage to get an arduino uno or mega from friends... will it do the job?Notice that most tutorials that i read online is using the arduino sketch as the program... however, this is not what I want. I want to burn a .hex file to ATMega644 using an Arduino board.I will gladly take your help xD______To solve this issue further on... I looked into using JTAG programmers to program any AVR chip. However, I have never used one before and not quite sure it will work or not. So, do you know a sure JTAG one to work on ATMega644? the price and shipping?well looks like avr dragon is the best right? who can ship it to me within a week or so?______Please give me a solution to this problem. I have never used an AVR or Arduino before (ehem... only PIC).Thanks for your awesome help!!

author: sleemanj
author_rank: Super Contributor
timestamp: January 22, 2015, 10:56:22 pm
content: Just get a USBasp (AVR ISP programmer) from ebay for a couple bucks.Or if you insist, grab an arduino and set it up as an ISP programmer.Then you can use avdude to upload your hex.

author: dannyf
author_rank: Super Contributor
timestamp: January 22, 2015, 11:35:27 pm
content: Quote"avdude", "upload" sound very porn, if you ask me.

author: VEGETA
author_rank: Super Contributor
timestamp: January 23, 2015, 10:59:13 am
content: Quote from: sleemanj on January 22, 2015, 10:56:22 pmyou sure this will work? or should I just buy AVR Dragon? the problem is that I need to do it quickly xD

author: Flenser
author_rank: Regular Contributor
timestamp: January 23, 2015, 02:17:09 pm
content: QuoteI've never done it, but I believe that an arduino will do the job, as described in this posthttp://forum.arduino.cc/index.php?topic=125248.msg942450#msg9424501) Upload ArduinoISP to the Arduino2) Connect the Arduino to the Target Board's ISP signals3) Generate the hex file to be loaded onto the Target Board4) Use avrdude to send the hex file to the Arduino, which will program the Target BoardYour Arduino running the ArduinoISP is your AVR ISP programmer. It is connected to your PC. You run avrdude on your PC to control this programmer. avrdude sends the hex file to the programmer over the virtual serial port and the programmer writes it to the target using the ISP protocol.

author: paulie
author_rank: Frequent Contributor
timestamp: January 24, 2015, 04:24:09 pm
content: Quote from: VEGETA on January 23, 2015, 10:59:13 amIf you are like 99% of the noobs on internet forums I'm sure you would prefer to ignore this excellent advice from sleemanj and choose a more complicated, more expensive, less reliable method. Or maybe you are the rare case that does like to take the lowest cost easiest path.Usually those $2 usbasp are by far the best solution in cases like this. Arduino as ISP or even just using a PC parallel port if available might be a faster but somewhat more involved solution. Anything else makes little sense.

author: rob77
author_rank: Super Contributor
timestamp: January 24, 2015, 04:39:56 pm
content: any arduino with the ISP sketch loaded will do the job - just use googlei'm using an Atmega8 loaded with it for programming other AVR chips with avrdude.

author: VEGETA
author_rank: Super Contributor
timestamp: January 25, 2015, 08:46:20 pm
content: Thanks for the replies. I will try ArduinoISP, I saw it online before posting but I wanted to make sure someone tried it.About that 2$ usbasp, I really clarified that I don't have time for some circumstances... so buying it from ebay will surely take more than a week to arrive.

author: paulie
author_rank: Frequent Contributor
timestamp: January 25, 2015, 09:31:04 pm
content: Not all Ebay is China. For example there are many usbasp sellers here in USA. Depending it only takes a day or two but cost is $4-$5. Still much quicker and cheaper than that dragon you targeted. But if you have an Arduino that is lowest cost and fastest solution.

author: VEGETA
author_rank: Super Contributor
timestamp: January 30, 2015, 07:16:14 pm
content: I will be buying USBasp. Now all I need is to know how to read the .hex file from the working chip... I guess avrdude or extreme burner does the job, right?in extreme burner, there is flash/eeprom/fuses tabs to be read or written... should I read/write all of them? when I program PIC ones I do config fuses and stuff within the software itself (.hex).

author: kolbep
author_rank: Frequent Contributor
timestamp: January 30, 2015, 07:41:44 pm
content: Maybe when the other person was reading the code out, it may have had Code Protection turned on (if that is an option in AVRs (I am a pic man,so don't shoot me).In that case he may have just been reading garbage out of the chip, and programming that garbage to the new chip, and that is why he was unable to get the destination chip to work.

author: theatrus
author_rank: Frequent Contributor
timestamp: February 01, 2015, 12:09:09 am
content: Quote from: VEGETA on January 30, 2015, 07:16:14 pmAVRs have programmable code protection support - if its enabled, you are not going to get valid code read out of the unit.

author: VEGETA
author_rank: Super Contributor
timestamp: February 02, 2015, 05:42:41 pm
content: Quote from: theatrus on February 01, 2015, 12:09:09 amwell, that is new to me... any good suggestions? what about the universal programmer here:can it read/write avr stuff?

author: Jeroen3
author_rank: Super Contributor
timestamp: February 02, 2015, 05:49:23 pm
content: Is your chip listed?http://autoelectric.cn/MiniPro/MiniProSupportList.txtThis programmer is not going to help you if the read protection fuses are enabled.

author: VEGETA
author_rank: Super Contributor
timestamp: February 02, 2015, 07:03:03 pm
content: Quote from: Jeroen3 on February 02, 2015, 05:49:23 pmwell, it is ATmega644 and it is listed. However, I don't know about those protection fuses... how to know about them?I have ordered the 2$ USBASP to use it with AVRDUDE for sucking out the .hex from this ATmega and then to program other similar chips with it. << is this useless here too? xDI wanted this programmer because it has a good range of supported stuff like EEPROMs.. I want to give it to my cousin for maintenance work.

author: Jeroen3
author_rank: Super Contributor
timestamp: February 03, 2015, 06:35:48 am
content: if I were you I would buy the 30$ AVR MKII ISP programmer.You know for sure it works and 30% is not expensive.I've got a few of those clone cheap dollar ones, they all need a fancy driver and are typically not as plug&play as the official one.

author: rob77
author_rank: Super Contributor
timestamp: February 03, 2015, 08:29:14 am
content: and what's wrong with the $6 arduino nano clone from china + isp sketch loaded ? it's far more versatile than any usbasp (you can use it for any micro-controller if you load the appropriate software into it)

author: VEGETA
author_rank: Super Contributor
timestamp: February 03, 2015, 05:02:51 pm
content: Hmmm... this one has the advantage of programming tons of other stuff, unlike MKII. Can someone verify for sure that it doesn't copy fuse protected AVRs? how to copy them anyway?

author: Jeroen3
author_rank: Super Contributor
timestamp: February 03, 2015, 08:52:05 pm
content: Quote from: VEGETA on February 03, 2015, 05:02:51 pmThe flash read protection fuses are designed to prevent ANY programmer from reading the flash.Since the programmer controls some internal logic inside the chip doing the programming and reading of the flash, using a programmer to read protected flash will not work.Unless you're going to explore glithing techniques to mess with the logic. You can try that until your retirement.The typical approach to reading locked chips is to decap them, and shoot out the flash bits holding the lockbits.

author: VEGETA
author_rank: Super Contributor
timestamp: February 04, 2015, 05:01:03 pm
content: Quote from: Jeroen3 on February 03, 2015, 08:52:05 pmThanks for your reply, it really helped.Hmmm and how can we do this thing xD?Now I hope the chip is not protected... &__&

author: Midphase
author_rank: Regular Contributor
timestamp: May 03, 2024, 09:34:15 pm
content: Sorry to revive an old topic, but I also need to program an ATMega644p. I was leaning toward purchasing the XGecu T48 [TL866-3G] Programmer. Ideally I would also want to use this both for the ATMega as well as to write EEPROM firmware for my various vintage synths.https://www.amazon.com/dp/B0B59959PR/?coliid=ILHR996DWG7WD&colid=6QC7U6MBJ09D&psc=1&ref_=list_c_wl_lv_ov_lig_dp_itDo you guys think that this would be a good option for me?I'm pretty much a noob at AVR stuff, so the easiest option for me is better even if it means investing a tad more cash into the right device.My main concern with the XGecu T48 is that the ATMega644p is not listed, however the ATMega644pa is listed and judging by the data sheet I found on Mouser, they appear to be quite similar.Many thanks!