Reset Pic18 with C

What is the best way to reset Pic18 using C code With HiTech Pic18 C Compiler

Edit:

I use

void reset()
{
#asm 
  reset
#endasm
}

but there must be a better way

+3
source share
5 answers

Here is the FAQ here .

Q: How to reset micro?

One way is to reset all variables to their default values, as indicated in the PIC manual. Then use assembly language to go to location 0x0000 in micro.

#asm ljmp 0x0000

#endasm

, . PIC 16x 8 . , , . , -7 , reset , , .

- , , CLRWDT() . , reset, reset 18 2 .

+1

reset(), , , .

.

+7

- . , , . , , , reset , - . , reset . , , .

+5

If there is no library function defined by the compiler runtime library (if such a library exists even in the microcontroller world ... but it should), then no. C itself, of course, will not help you, since "a reset" is too big a problem for the C platform to cover it.

0
source

I am using the ccsinfo.com compiler, which has a similar API call to reset the pic, but I would have thought that the solution for the compiler would go right.

0
source

Source: https://habr.com/ru/post/1698407/


All Articles