News:

Let's find out together what makes a PIC Tick!

Main Menu

Way to reset SFR from program?

Started by trastikata, May 09, 2021, 04:09 PM

Previous topic - Next topic

trastikata

Hi all,

I couldn't find a way to reset the SFR from inside the program, I was wondering if it is even possible?

Thanks

TimB


Hi

Which SFR's exactly. If they are used in the code by the compiler they are accessible just by using their name

wreg = 0


Tim

trastikata

That I am aware Tim.

But I was looking for a way to do an easy global SFR reset to their default POR values in conjunction with "Reset" and "Clear" directives.

TimB

#3
Unless you list all the SFR regs default values then clear them to those values you have to do a system reset and hope they all are reset back to the values you want.

You can insert asm with the single line @ or the block

asm


Endasm

Commands