How to jump to program 0x000

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,

I am using Atmea64 how to soft reset atmega64
in winavr

P.Ashok Kumar

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could use inline assembly. Keep in mind that jumping to 0 will not reset the registers to their default values. If you want that, you can force a watchdog reset.

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There was an extensive thread on this not too long ago. Try to search it out.

https://www.avrfreaks.net/index.p...

I think you could stay in C and "goto *nullptr;" as well.

Also https://www.avrfreaks.net/index.p...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This works fine in GCC.

void (*go_around)(void) = 0x0000;
  .
  .
  .
  goaround();

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is the way I and Atmel cause a reset with the megaxx9.

   WDTCR = (1<<WDCE) | (1<<WDE);     //Enable Watchdog Timer to give reset
   while(1);                         // wait for watchdog-reset, since the BOOTRST-fuse is
                                     // programmed, the Boot-section will be entered upon reset.