System reset status register

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

System reset status register

1,709 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Wed Jan 12 03:31:28 MST 2011
Hi All,

           I am using LPC1114 and trying to check the System reset status register at startup to find the cause of the reset.

The only thing that does not work is when I do a System reset by calling NVIC_SystemReset() it reports as a watchdog reset.

   Regards,
    Syed
0 项奖励
回复
7 回复数

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rompacz on Fri Jun 03 04:49:15 MST 2011
Hi guys,

I have a small (and maybe silly) question about reset.
LPC1768 has a pin called RSTOUT which indicates a reset state of the MCU.
Is it possible to drive this pin from the code? I would like to indicate a reset state for the rest of  the hardware always when the mcu is really in reset but sometimes I want to "imitate" a reset state. (hardware would see a low level on rstout but mcu is working normally).

Simon.
0 项奖励
回复

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Fri Jan 28 11:48:51 MST 2011
As said earlier the issue is not with clearing, system reset bit is not being set.

Regards,
Syed
0 项奖励
回复

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by curtvm on Fri Jan 28 11:45:10 MST 2011
How do you know what the reserved bits will be? If any of them are set, your comparison will fail.

To clear all the reset bits-
LPC_SYSCON->SYSRESSTAT = 0b11111; //0x1F
//or write a 1 to whichever bit (s) you want cleared
Before clearing, you could save them to a var for later if wanted.

I don't think you want to do any &=  |= since you need to write a one to clear a bit. If you are trying to clear specific bits this way, you will inadvertently clear others.
0 项奖励
回复

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Fri Jan 28 11:17:18 MST 2011
The problem is it does not go inside the if statement

if ((LPC_SYSCON->SYSRESSTAT & MHM_SYSRST)== MHM_SYSRST){

}

I am checking if the system reset bit is set.

       Regards,
       Syed
0 项奖励
回复

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Fri Jan 28 07:42:48 MST 2011
Hello Syed,

what happens if you use:
[SIZE=2]
[/SIZE][SIZE=2][B]LPC_SYSCON->SYSRESSTAT |= MHM_SYSRST;[/B][/SIZE]
[SIZE=2][/SIZE]
[SIZE=2][/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]
[/SIZE]
0 项奖励
回复

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Thu Jan 27 16:33:10 MST 2011
Hi,
     Thanks for your reply. Yes, I am using SYSRSTSTAT. Below is the code I am using to test the reset cause.

#define MHM_SYSRST                            0x10

if ((LPC_SYSCON->SYSRESSTAT & MHM_SYSRST)== MHM_SYSRST){
        /*
        ** The reset is caused by a Software System RESET.
        ** Clear reset bit.
        */
        LPC_SYSCON->SYSRESSTAT &= MHM_SYSRST;
    }

Regards,
Syed
0 项奖励
回复

1,521 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Tue Jan 25 06:57:01 MST 2011
Hello syed,

how did you get your info ... via reading SYSRSTSTAT?

See User Manual UM10398.
0 项奖励
回复