How to reset a PIC18 in C?

Charles Faiga picture Charles Faiga · Oct 17, 2008 · Viewed 8.4k times · Source

What is the best way to reset a PIC18 using C code with the HiTech Pic18 C compiler?

Edit:

I am currenlty using

void reset()
{
#asm 
  reset
#endasm
}

but there must be a better way

Answer

MrZebra picture MrZebra · Oct 20, 2008

The compilers usually have their own reset() function built in, but it just does exactly what your function does, and the actual name may vary from compiler to compiler.

You are already doing it the best possible way.