You are here: Home FORUM Support How to use Sleep

nqBASIC

  :: Support
Welcome Guest   [Register]  [Login]
 Subject :How to use Sleep.. 15-03-2010 15:33:02 
cjam
Joined: 15-03-2010 19:19:13
Posts: 3
Location

Hello, 

I am working on a project that uses the nanoCore12 (24 pin) for power managment purposes and I would like to put the processor to sleep for a certain ammount of time.  Is there a way to do this ?  I can't seem to figure out which interrupts will wake the MCU up, Does anyone know how to wake the MCU up after putting it to sleep?

 

Regards,

 

Colter

IP Logged
 Subject :Re:How to use Sleep.. 17-03-2010 09:42:03 
carl
Joined: 27-05-2009 10:51:54
Posts: 17
Location: Toronto
Check the System object called Sleep in the API: http://www.nqbasic.com/documentation/43-reference/114-nqbasic-api.html?start=9 It wakes up the MCU on external interrupts only (i.e. IRQ and XIRQ). Unfortunately, those signals are not available on the 24-pin version of NanoCore12.
IP Logged
 Subject :Re:How to use Sleep.. 17-03-2010 10:53:22 
cjam
Joined: 15-03-2010 19:19:13
Posts: 3
Location
Hello Carl, After reading the API, it sounded as if the mcu could wake up to both external and internal interrupts. However, is there any internal interrupt (maybe a system timer?) that will occur if the mcu is sleeping? Regards, Colter
IP Logged
 Subject :Re:How to use Sleep.. 17-03-2010 13:23:55 
carl
Joined: 27-05-2009 10:51:54
Posts: 17
Location: Toronto
Oops-- you're right! If you pass a parameter of 0, any interrupt will wake up the MCU. The interrupt source could be SCI, RTI, etc.
IP Logged
 Subject :Re:How to use Sleep.. 18-03-2010 07:55:43 
cjam
Joined: 15-03-2010 19:19:13
Posts: 3
Location
Hello Carl, Thank you for the useful information. I have tried using the RTI by using RTI.RTI_Start() just before I put the MCU to sleep, however it does not seem to wake up the MCU. Is there a certain way that I should be invoking the RTI.RTI_Start() method? I was thinking of trying to use the WDT object however I'm not sure if that will wake the MCU either. Regards, Colter
IP Logged
Page # 


Powered by ccBoard