hello all,
I am trying to start RTC with RTC example, but it has stoped at CS_startLFXT(false);
When I remove this code, it work.
CS_startLFXT , is it important??
Thank all!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hello all,
I am trying to start RTC with RTC example, but it has stoped at CS_startLFXT(false);
When I remove this code, it work.
CS_startLFXT , is it important??
Thank all!
Phuong,
The RTC example that I have calls CS_startLFXT() with a parameter for the drive strength, as shown below, rather than simply passing it a null.
If you use an appropriate drive strength and the API call still hangs, then that indicates that you may have a problem with the LFXT oscillator. Removing that call as you have done causes the device to fall back to the internal Reference oscillator, which, Like the LFXT on the LaunchPad, is also centered on 32kHz, so the example would still operate since you're not likely to notice the variation in frequency between the internal oscillator vs. an external crystal from a simple example run over a short time.
/* Starting LFXT in non-bypass mode without a timeout. */
CS_startLFXT(CS_LFXT_DRIVE3);
The example I'm referencing is the rtc_c_calendar_alarm_interrupt example from the MSP432P4 SDK. in the TI Resource Explorer.
The API description for the CS_startLFXT() API call can be found in the Driverlib User's Guide, section 6.6.2.29, which is excerpted below:
6.6.2.29 bool CS_startLFXT ( uint32_t xtDrive )
Initializes the LFXT crystal oscillator, which supports crystal frequencies up to 50kHz, depending on the selected drive strength. Loops until all oscillator fault flags are cleared, with no timeout. See the device-specific data sheet for appropriate drive settings. NOTE: User must call CS_setExternalClockSourceFrequency to set frequency of external clocks before calling this function. Parameters
xtDrive is the target drive strength for the LFXT crystal oscillator. Valid values are: CS_LFXT_DRIVE0,
Note
When CS_LFXT_BYPASS is passed as a parameter the oscillator will start in bypass mode and the signal can be generated by a digital square wave.
Returns
true if started correctly, false otherwise
References CS_startLFXTWithTimeout().
Hope that helps.
Regards,
Bob L.
Bob L,
Thank for your answer, now I think I know my problem.
I have another problem, would you tell me about additional questions?
/* Specify an interrupt to assert every minute */ MAP_RTC_C_setCalendarEvent(RTC_C_CALENDAREVENT_MINUTECHANGE); /* Enable interrupt for RTC Ready Status, which asserts when the RTC * Calendar registers are ready to read. * Also, enable interrupts for the Calendar alarm and Calendar event. */ MAP_RTC_C_clearInterruptFlag(RTC_C_TIME_EVENT_INTERRUPT); MAP_RTC_C_enableInterrupt(RTC_C_TIME_EVENT_INTERRUPT);
void RTC_C_IRQHandler(void)
{
uint32_t status;
status = MAP_RTC_C_getEnabledInterruptStatus();
MAP_RTC_C_clearInterruptFlag(status);
if(status & RTC_C_TIME_EVENT_INTERRUPT)
{
/* Interrupts every minute - Set breakpoint here */
/* my code*/
}
}
After about 30 minutes, Interrupts every minute does not work anymore.
Please give me a solution, thank you so much!
**Attention** This is a public forum