Author Topic: ATMEGA32 , programming  (Read 2503 times)

0 Members and 1 Guest are viewing this topic.

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
ATMEGA32 , programming
« on: August 26, 2013, 01:27:22 pm »
Is it possible to read the chip for example by using this universal programmer,
http://www.ebay.com/itm/USB-MiniPro-TL866CS-Universal-BIOS-Programmer-EEPROM-FLASH-8051-AVR-GAL-PIC-SPI-/221092473435 and then reverse the HEX code to get the actual written program in C? Something like de-compile?
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: ATMEGA32 , programming
« Reply #1 on: August 26, 2013, 01:51:08 pm »
you wont ever get the exact C out of it, as the compiler to begin with would have discarded and modified parts,

however you can likely reconstruct roughly what it was doing if it wasn't doing any overly complex tasks,
 

Offline Legit-Design

  • Frequent Contributor
  • **
  • Posts: 562
Re: ATMEGA32 , programming
« Reply #2 on: August 26, 2013, 01:56:56 pm »
You can get the HEX out of micro with normal programmer meant for the part, no need for universal programmer. That's unless they burned the fuse, not even universal programmer is going to recover the hex when fuse is burned (to my current knowledge), unless the chip has a vulnerability in it. I think some people have used glitching to find such vulnerabilities in chips, sometimes successful, usually not.

Just to make sure you want to do two different things, first get the hex out of the chip, second decompile to something normal people can read/understand more easily.
« Last Edit: August 26, 2013, 01:58:58 pm by Legit-Design »
 

alm

  • Guest
Re: ATMEGA32 , programming
« Reply #3 on: August 26, 2013, 02:01:09 pm »
You should be able to convert the hex to assembly (without comments, labels and variable names), and if you're skilled at reading assembly, you should be able to figure out what the assembly means if it's not too large/complex.

I would typically recommend an Atmel AVRISP Mk. II or third-party USBasp over a universal programmer for AVR programming. Device support is usually better, and software support (eg. IDEs) is better. I typically reserve the universal programmers for EEPROMs or more obscure devices I don't have a dedicated programmer for.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9946
  • Country: nz
Re: ATMEGA32 , programming
« Reply #4 on: August 26, 2013, 02:02:11 pm »
If you can get the hex out you can convert that directly into ASM but it wont be nice ASM, like a person would write, it will be ASM generated by a compiler.

This is assuming that C was used to write the code in the first place. If the micro was coded in ASM from the start then the ASM you get from the Hex will be the same, just without nice labels and comments.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline IvoSTopic starter

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: us
Re: ATMEGA32 , programming
« Reply #5 on: August 26, 2013, 02:31:32 pm »
Thanks guys, I will probably get AVRISP USB interface like "alm" wrote and try to use Atmel Studio 6, or could I use Arduino UNO for this ISP programming purpose perhaps? which I already have.....
 

alm

  • Guest
Re: ATMEGA32 , programming
« Reply #6 on: August 26, 2013, 02:35:46 pm »
If it's for occasional use then using an ISP sketch for the Arduino should be fine. I would get a real ISP programmer if you're going to use it regularly, though. They're more robust, feature a nice cable and support a wide range of target voltages from 1.8 V to 5 V.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf