Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hello,
I am having trouble with the RTC on the MSP432 with the GNU compiler. The RTC ticks normally, however I notice a weird behaivour where as soon as the minutes or seconds goes over 40, then it reverts back to 0. However after the numbers then reach 19, it will go back to 0 and count to 40 again. This means that my clock ticks as follows: 0,1,2...,38,39,0,1,2...,18,19,0 and so on. This means that it is counting to 60 seconds but rolling over in a weird place. Also if I set the hours to any number above 20, then it throws away the 2 and will only display the second decimal. Example would be setting the hours to 23, and when I call the MAP_RTC_C_getCalendarTime() it displays: hours = 3.
I previously thought I had fixed this by calling ROM_RTC_C_initCalendar(), instead of MAP_RTC_C_initCalendar(). This was a fix for a while, but now it no longer works (with no changes been made to the code).
A side note is that all of my ROM_XX functions are grayed out in the rom_map.h as the GNU compiler does not want to identify the flag (-DTARGET_IS_MSP432P4XX) set during compile time. Therefore none of the functions with #if defined(TARGET_IS_MSP432P4XX) run. So if I call a MAP_XX it will call the XX function instead of the ROM_XX function. Not sure if this is the cause of the issue with the RTC counting weirdly, but could be a cause. So to be clear if I call MAP_RTC_C_initCalendar(), the ROM_RTC_C_initCalendar() is grayed out and RTC_C_initCalendar() is called instead.
For extra help with this issue, if I run the following code:
RTC_C_Calendar currentTime = { 0x46, //46 seconds 0x43, //43 minutes 0x23, //23 hours 0x01, //1 day of the week 0x16, //16 day of the month 0x05, //5 months 0x1955 //1955 years }; MAP_RTC_C_initCalendar(¤tTime, RTC_C_FORMAT_BCD); RTC_C_Calendar currenttime; currenttime = ROM_RTC_C_getCalendarTime();
The value that is returned in currenttime is as follows: seconds = 0x06, minutes = 0x03, hours = 0x03, dayOfWeek = 0x01, dayOfmonth = 0x16, month = 0x05, year = 0x1955. Once the clock is set to run, after 14 seconds the seconds will display 0, and the minutes will display 4.