Issue using RTC Alarm on 11u68

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue using RTC Alarm on 11u68

778 Views
boykin
Contributor I

I have the LPC Xpresso 11U68 demo board and I'm trying to get the RTC alarm to work.  I can change the COUNT register and it is properly incrementing.  The RTC status is 0x90 and the MATCH register is 0xffffffff.  If I call Chip_RTC_SetAlarm(LPC_RTC, value) then read back the MATCH register it is unchanged from 0xffffffff.

Is there anything special I need to do in order to change the alarm?

Labels (1)
0 Kudos
4 Replies

500 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jsoeph Boykin,

   Please use our lpcopen code for lpcxpresso lpc11u68 board, you can download it from this link:

1.IAR and MDK project:

http://www.nxp.com/assets/downloads/data/en/software/lpcopen_2_12_Keil_iar_nxp_lpcxpresso_11u68.zip 

2. LPCXpresso project

http://www.nxp.com/assets/downloads/data/en/software/lpcopen_2_12_lpcxpresso_nxp_lpcxpresso_11u68.zi... 

I have debug the periph_rtc project, after set the MATCH data, then read it in the register, I can get the correct result:

You can find it from my debug result:

pastedImage_4.png


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

500 Views
boykin
Contributor I

Yes, I tried the periph_rtc example and it does indeed work.

What I forgot to say in the original post is that I am putting the MCU into Deep Power Down mode.  After I set up the RTC (using code analogous to that example) I can set the alarm once, but not a second time.  In the mean time I have found that if I reset the RTC after a wake from deep power down it all works.  The documentation does not imply this would be necessary.

0 Kudos

500 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Joseph Boykin,

   From the LPC11U68 user manual:

3. Deep power-down mode:
For maximal power savings, the entire system is shut down except for the general
purpose registers in the PMU, the RTC in the VBAT power domain, and the WAKEUP
pin if VDD is present. Only the general purpose registers in the PMU and the RTC
registers are powered and can maintain their internal states. The part can wake up on
a pulse on the WAKEUP pin or on an interrupt from the RTC. On wake-up, the part
boots.

If you want the RTC work in deep power down mode, you must make sure, the RTC is still powered.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

500 Views
boykin
Contributor I

The RTC is powered via VBAT.  The issue isn't that the RTC doesn't run when we go into Deep Power Down mode, the issue is that, after the processor is woken up I can't set a new alarm (writing to the MATCH register does not have any effect) without going through a full reset of the RTC first.

So, while I'm sure this has something to do with how the RTC behaves after DPD, I haven't had the chance to isolate it (yet).  Doing a full-reset of the RTC, while it works for test code, I don't think is a viable solution for production as I'm concerned that the clock will drift.

0 Kudos