hi, I need to find out whether the LPC2148 is reset due to POR(power-on reset) or by the RESET pin becoming low. As per the user manual UM10139, I read about the RESET SOURCE IDENTIFICATION REGISTER (RSIR). They have mentioned the 4 possible sources of reset action i.e.: POR,RESET pin, Watchdog and Brownout detection. My application needs to check for the first two conditions only. But the problem is, every time when my code checks for the RSIR register at the very beginning of the execution, both the bits (Power-On reset and RESET pin) of the RSIR register are SET to 1 no matter in what way I reset the microcontroller. Either of the 2 bits should be set based upon the type of reset i provide. Please help in finding the solution to this problem.
Regards, Karan
hey, Atlast got it working.... As per your instructions, what I did now is: 1. after power-on, I checked for both the bits getting set. 2. once i got that, I simply cleared both the bits, declaring the Reset type as Power On reset. 3. After that every time I hit the reset pin low, I got only the EXTR bit set in the RSID register. 4. So i conclude that my reset is now an External reset.
The main thing was in clearing the bits. Thanks a lot.! Got it finally.!!!!!
Regards, karan
Nice!
The main thing lies in reading the relevant processor documentation two or three times and for every single sentence think: "Is this relevant to me?"
The documentation almost always contains the important hints - but they aren't always extremely visible.
Yes. Perfectly right. Thanks for the advice.!!