- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
How to configure SCR RTC to get Interrupt in every one second. Can you please check and provide the feedback.
Solved! Go to Solution.
- Labels:
-
AURIX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/* RTC ISR to blink a LED */
#if defined (__TASKING__)
void __interrupt(0x6B) rtc_interrupt(void)
#elif defined(__KEIL__)
void rtc_interrupt(void) interrupt 13
#endif
{
SCR_IO_PAGE = 0;
SCR_P00_OMTR = 0x10;
}
That's because of different compiler define as above sample.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank you for your feedback. I configured the SCR RTC registers to get interrupt.
SCR_SCU_PAGE=1,SCR_PMCON1= 0X2B, SCR_IEN1 = 0X80,SCR_IEN0 = 0X80,SCR_RTC_CNT3,CNT2,CNT1,CNT0=0,
SCR_RTC_RTCCR3= 0X00,RTCCR2=0X01,RTCCR1=0X17,RTCCR0=0X04( Get interrupt in one second), RTCON=0X15,
Call back function for RTC interrupt: void rtc_interrupt( void) interrupt 13. But still not able to get the RTC interrupt. Can you please check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's suggested to start from the example project.
void main(void)
{
/* SCU module configurations*/
SCR_SCU_PAGE = 1; //Switch to page 1
SCR_PMCON1 =0x3B; //OCDS, T2CCU and SSC enabled
SCR_SCU_PAGE = 0; //Switch to page 0
SCR_IRCON0 = 0x0; //Reset interrupts
SCR_IEN0 = 0x80; //Enable global interrupts
SCR_IEN1 = 0x80; //XINTR13 is enabled
/* RTC module configurations*/
SCR_RTC_RTCCR3 = 0x00;
SCR_RTC_RTCCR2 = 0xFF;
SCR_RTC_RTCCR1 = 0xFF;
SCR_RTC_RTCCR0 = 0x40;
SCR_RTC_RTCON = 0x17; // RTC Interrupt Enable, RTC start operation, RTC 100Mhy/DIV clock, 9-bit prescaler is bypassed
/* IO module configurations*/
SCR_IO_PAGE = 2; //Switch to page 2
SCR_P00_PDISC = 0x00;
SCR_IO_PAGE = 0; //Switch to page 0
SCR_P00_OUT = (1 << 4); //Initialize P00.4 out to 1. LED 0 on Triboard off
SCR_IO_PAGE = 1; //Switch to page 1
SCR_P00_IOCR4 = 0x80; //P00 pin 4 is output
SCR_IO_PAGE = 0; //Switch back to page 1
while(1)
{
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Thank you for your feedback. In sample program call back function is configured as void _interrupt(0x6B) rtc_interrupt(void) but getting compiler error. void Rtc_interrupt (void) interrupt 13 this call back is fine?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/* RTC ISR to blink a LED */
#if defined (__TASKING__)
void __interrupt(0x6B) rtc_interrupt(void)
#elif defined(__KEIL__)
void rtc_interrupt(void) interrupt 13
#endif
{
SCR_IO_PAGE = 0;
SCR_P00_OMTR = 0x10;
}
That's because of different compiler define as above sample.