We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I need to use the external interrupts of the LPC932. The micro will be in sleeping mode and will be woke up only by these two events. It works fine the first time, but then it does not work any more for external interrupt 0. Why? Could it be my Port configuration on port 1, which is where these two interrupts are entered. These two pins have to be input only. IT0 = 1; //pulses will be edge triggered EX0 = 1; IT1 = 1; //pulses will be edge triggered EX1 = 1; EA = 1; //EBO = 1; //Brown Out interrupt (IEN0.5) PCONA = 0xEF; // turn off all peripherals that can be turned off PCON |= 0x12; // switch to Power Down mode while(1); Thank you!
it worked on the simulator but not in the application because the simulator simulates. an interupt INT1, INTO is generated it wakes up executes the ISR and goes back to P.D. mode. You need to get the power down out of the ISR. Power down in main and let the ISR wake the uC up. Erik
Erik this is what I have main() proc. { ... ... IT0 = 1; EX0 = 1; EA =1; ... ... } Power_Down() proc. { while(1) { PCON = 0x12; // switch to PDM } } ISR for INT0() { PCON = 0x10; //Normal mode .... ... ... } It works with the emulator, but not with out it. Why.
It works with the emulator, but not with out it. 1) first it was simulator, now it is emulator, what is it? ICE/Keil simul/fried apples? 2) how do you know it does not work in real mode? Erik
Erik I tested on both the simulator and emulator and the interrupt was detected when it occurred. It was executed and goes back to PDM. In real it is not doing it, because the pulses are not being counted. I know this because after a certain amount of pulses something is supposed to happen (about 7 seconds) and it does not happen at all. That is why I know it is not working. Makes sense to you?
Makes sense to you? not at all. You keep feeding me tidbits such as I know this because after a certain amount of pulses something is supposed to happen reduce your code to the VERY MINIMUM you need for this e.g. alternate a LED in the main, then go to sleep, wake up in isrEX0. Try it ICE and real, if it does not work post IT ALL. Erik
Erik I went back to read the user's manual and this is what I found. "In power down mode the power supply voltage may be reduced to the RAM keep-alive voltage VRAM. This retains the RAM contents at the point where PDM was entered. SFR contents are not guaranteed to after VDD has been lowered to VRAM." I think maybe since the contents of some registers are lost after entering PDM, the "pulse counter" is never counting because it is always losing its contents...don't you think? So the micro wakes up, but never accumulates the pulses, therefore not working properly. I may be wrong though.
I think maybe since the contents of some registers are lost after entering PDM, the "pulse counter" is never counting because it is always losing its contents...don't you think? how would I know, you never showed it. I have been communicating under the impression that you showed "the whole truth and nothing but the truth". It is annoying to get information in the 25th post, or whatever the number is, that might have cleared the problem in post 3. Erik
"the contents of some registers are lost after entering PDM" That's not what the manual says, is it? The manual says, as you've just quoted, that it's lowering VDD to VRAM that causes the SFR contents to become undefined - not going into powerdown per se. So, the question is: are you lowering VDD to VRAM? Or are you going to keep us guessing on that one for another dozen posts?
What do you suggest Erik. Because I do not know why it does not work?
extract from your program the very least amount of code in assembler (20 or so lines should do) to show the problem. Load that and nothing else and if the problem still exist, post the code. Erik
If you have the Keil LPC900 kit, it includes an example uVision Project for low-power modes. Why don't you give that a try?
Andy, that is where I got the intial sample program from. Then I modified it. Thanks
Erik. I will try what you suggest and let you know
Erik how can I get the assembly code of my program. It is written in C. The external interrupt and Power Down mode work fine when I use the simulator but not in my application.
"how can I get the assembly code of my program. It is written in C" Look on the 'Listings' tab in your Project Options.
Andrew I went to Lintings in project options... and selected assembly code. Now how do I see it on my screen.