[SOLVED] software reset instruction

Status
Not open for further replies.

Raady Here

Full Member level 5
Joined
Jun 8, 2013
Messages
242
Helped
26
Reputation
52
Reaction score
26
Trophy points
28
Location
India
Visit site
Activity points
1,571
PIC30F5011,
MPLAB 8.8v
interfaces rtc, keypad, lcd.

Hi,

I want to know how to reset MC using the software instruction.
when I am pressing a button it just recognize the button prints the statement and does nothing after that. i am already displaying rtc on lcd and it doesnt get interrupted and no more buttons of the keypad work.

Code:
#include<reset.h>
...
...
main(){
....
while(1)
{
	if(PORTFbits.RF6)             // checking if button is pressed
        {
	    printf("soft reset ");  
	    TimerDelay_10ms(10);
	    __asm__ volatile ("reset") ;  // asm("reset");
	}		
}
}
 

its works

__asm__ ("RESET");

thanks for your time.

instruction is found in the header file of the particular processor.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…