Forum: µC & Digital Electronics Reading program from ATMEGA128

Author: Melvin G. (mgleep)
Posted on:

Rate this post
0 useful
not useful

First, about me. I am quite a beginner regarding microcontrollers.  My 
profession is SAP application developer. As a hobby, I am learning 
embedded linux on a few project boards (gnublin), thereby learning linux 
and C.  I also own an Arduino Duemilanove (ATMEGA328) for educational 
purposes, an ATMEL "Butterfly" (ATMEGA169), also for educational 
I have ordered the new raspberry pi, but am still waiting for delivery.
I have installed Atmel Studio 6 on my Win7 Laptop and am currently using 
it with the built-in device simulator to run assembler test code from a 
text book on programming tactics for AVR-microcontrollers.  My first 
embedded linux project is completed (home automation low cost web server 
- turning household appliances on and off via WWW).  My second embedded 
linux project is currently in progress (measure power generated by my 6 
KW-peak photovoltaic array and upload the data to my laptop Excel 
spreadsheet automatically at regular intervals via wlan).

My problem: the company which produced my photovoltaic array has gone 
bankrupt.  A feature of the array includes a datalogger which measures 
the generated power and reports it via cell-phone to a web site.  Since 
the company is bankrupt, the datalogger has become useless.  It consists 
primarily of a board with an ATMEGA128 16AU 0820 chip from Atmel, a 
cell-phone chip card, and a GE864-QUAD GPRS Module from Telit, and has a 
6-pin ISP connector.

My intention: I remember, years ago while learning x86 assembler I could 
reverse engineer Windows binaries with tools like WinICE and W32dasm. I 
would like to download the binary from the ATMEGA128, then reverse 
engineer it, then rewrite/modify it for my own use. Since I have not 
found any binary extraction facitity in Atmel Studio 6, I have installed 
WinAVR/AVRDUDE/AVRDUDE-Gui on my WinXP desktop, mounted the datalogger 
to a breadboard and wired up an RS-232 interface ( 
http://elm-chan.org/works/avrx/avrx_com.png , but TDX0/RDX0 instead of 
MISO/MOSI)to the ISP connector. When trying to download flash or EEPROM 
binaries from the ATMEGA128, I get errors like "avrdude: 
stk500_getsync(): not in sync: resp=0x00" "avrdude: stk500_disable(): 
protocol error, expect=0x14, resp=0x51" when I connect with programmer 
type "avrisp" and much less usefully errors when connecting with other 
programmer types.

My question:

Is my intention reasonably feasible, or am I just wasting my time? In 
other words, is it worth bothering to find out what I am doing wrong 
while connecting to the ATMEGA128, or is it simply not reasonably 
possible to reverse engineer as intended ( I have no CIA resources to 
help me)?

I have not yet tried flashing the chip, since I don't want to destroy 
the current programming which still appears to work, because I recognize 
the LED sequences which flash when board powers up ( I had watched the 
service guy when he originally installed the unit and set it up for 
hourly transmisstions).

Thanks in advance for expert advice.

Kind regards,

Author: Melvin G. (mgleep)
Posted on:

Rate this post
0 useful
not useful
Hey, thanks for the overwhelming number of constructive and helpfull 

In the meantime, I have built the Aquaticus AVR JTAG interface onto the 
breadboard where I already had the target board connected, identified 
the JTAG pins of the ATMega128 in the target board, and have connected 
them to the AVR JTAG interface.

Using the JTAG interface, I have been able to successfully connect to 
the target board and have downloaded the FLASH and EEPROM data. I am 
currently working on decompiling the hex data.

Great help! Thanks.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.