go_away

Author Topic: clearing atmega168 flash  (Read 5148 times)

0 Members and 1 Guest are viewing this topic.

Offline rezabotTopic starter

  • Beginner
  • *
  • Posts: 5
  • Helpful? 0
clearing atmega168 flash
« on: July 01, 2008, 03:27:59 PM »
Hello!
is there a way to clear out all the programs that I have loaded onto my atmega168?  Let me explain the situation.  I loaded up some code onto the chip using my AVRISP mkII programmer.  Everything was working fine and I was happy  :)  Then, I modified the code a bit,  compiled and reloaded the hex file onto the chip. It did not work right and I was sad  :(  So, I modified the code back to the way I originally had it, compiled and reloaded the hex file onto the chip.  However to my surprise  :o the original code did not work correctly the second time it was loaded onto the microcontroller.  This makes me mad  >:(  So I am wondering if there is a way to clear out the internal flash memory of the chip so I can start back from scratch???  Any help would be greatly appreciated   :D 

Offline krich

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: clearing atmega168 flash
« Reply #1 on: July 01, 2008, 10:10:08 PM »
Typically, the AVR Studio erases the chip before programming it, unless you changed that behavior.  Make sure you are loading the correct .hex file.  This has bitten me a number of times when I change projects, it doesn't change the .hex file to match.

Offline silent069

  • Full Member
  • ***
  • Posts: 49
  • Helpful? 0
Re: clearing atmega168 flash
« Reply #2 on: July 01, 2008, 10:30:58 PM »
Just to add to what krich had posted. Even though it shows the same .hex file in the window. Make sure you browse for the .hex file and click it again. I've run into this problem as well. Being a noobie at robotics myself. I too thought I had locked up the chip or something. Lets us know if you get your chip reprogrammed.
BTW check out my page on the SOR members tutorial pages. I have links on the bottom for troubleshooting ect. and adding new things daily as I have time.

  http://www.societyofrobots.com/member_tutorials/node/151

 


Get Your Ad Here