Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hello,
I am working with CCS 7.1.0 and RTOS 2.20.00.06 for the mentioned launchpad.
I have defined a Hwi (graphically) as follows:
As shows my cmd file the interrupt number associated with the RTC is: RTC_C : { * ( .int31 ) } > INT31 type = VECT_INIT
And this is my main file:
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Log.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/drivers/GPIO.h>
#include <driverlib.h>
#include "Board.h"
volatile int16_t i16ToggleCount = 0;
volatile int16_t i16ToggleCount1 = 0;
volatile Calendar newTime;
void led1Toggle(void);
void led2Toggle(void);
int main(void)
{
Calendar currentTime;
Board_initGeneral();
Board_initGPIO();
GPIO_write(Board_LED0, Board_LED_ON);
GPIO_write(Board_LED1, Board_LED_ON);
currentTime.Seconds = 0x00;
currentTime.Minutes = 0x30;
currentTime.Hours = 0x17;
currentTime.DayOfWeek = 0x02;
currentTime.DayOfMonth = 0x30;
currentTime.Month = 0x04;
currentTime.Year = 0x2017;
RTC_C_initCalendar(RTC_C_BASE, ¤tTime, RTC_C_FORMAT_BCD);
RTC_C_configureCalendarAlarmParam param = {0};
param.minutesAlarm = 0x35;
param.hoursAlarm = RTC_C_ALARMCONDITION_OFF;
param.dayOfWeekAlarm = RTC_C_ALARMCONDITION_OFF;
param.dayOfMonthAlarm = RTC_C_ALARMCONDITION_OFF;
RTC_C_configureCalendarAlarm(RTC_C_BASE, ¶m);
RTC_C_setCalendarEvent(RTC_C_BASE, RTC_C_CALENDAREVENT_MINUTECHANGE);
RTC_C_enableInterrupt(RTC_C_BASE, RTCRDYIE + RTCTEVIE + RTCAIE);
RTC_C_enableInterrupt(RTC_C_BASE, RTCRDYIFG + RTCTEVIFG + RTCAIFG);
RTC_C_startClock(RTC_C_BASE);
BIOS_start();
return (0);
}
void led1Toggle(void)
{
GPIO_toggle(Board_LED0);
i16ToggleCount += 1;
Log_info1("LED TOGGLED [%u] times", i16ToggleCount);
}
void led2Toggle(void)
{
GPIO_toggle(Board_LED1);
i16ToggleCount1 += 1;
Log_info1("LED TOGGLED [%u] times", i16ToggleCount1);
}
void RTC_ISR(uintptr_t arg)
{
led1Toggle();
}
I have configured several interrupts for the RTC and the LEDs are always on.
I also attach the CCS project.
Thanks and regards,
Juan Antonioblink_msp430_hwi_RTC.zip