Hi Jeremy,
Thanks for your reply and you help on this topic.
I already tried this but it cannot make appearing 32kHz frequency to RTCO pin.
I only want to use 32kHz IRC as an external signal to drive external components...
I modified the initial code as shown below.
In that case, I observed ~19.73kHz on RTCO pin which it supposed to be the 39,0625kHz divided by 2 (?), as if PTC5 output FTM signal (ICSFFCLK/2) instead of ICSIRCLK... However, RTC0 pin is well assigned to PTC5 in SIM_PINSEL as RTCS = 1...
Thanks and best regards,
Have a nice day!
Jacques.
int main (void)
{
uint8_t u8Ch;
ICS_ConfigType sICSConfig;
RTC_ConfigType sRTCConfig;
RTC_ConfigType *pRTCConfig = &sRTCConfig;
UART_ConfigType sConfig;
ICS_Trim(ICS_TRIM_VALUE);
LED0_Init();
LED2_Init();
/* configure RTC to 1Hz interrupt frequency */
pRTCConfig->u16ModuloValue = 0;
pRTCConfig->bRTCOut=RTC_OUTPUT_ENABLE;
pRTCConfig->bInterruptEn = RTC_INTERRUPT_ENABLE; /* enable interrupt */
pRTCConfig->bClockSource = RTC_CLKSRC_IREF; /*clock source is 1khz*/
pRTCConfig->bClockPresaler = RTC_CLK_PRESCALER_128; /*prescaler is 100*/
SIM->PINSEL |=SIM_PINSEL_RTCPS_MASK;
RTC_SetCallback(RTC_Task);
RTC_Init(pRTCConfig);
/* Enable IRCLK */
ICS->C1 |= 0x02;
/* switch clock mode from FEE to FEI */
sICSConfig.u32ClkFreq = 32; /* NOTE: use value 32 for 31.25KHz to 39.0625KHz of internal IRC */
ICS_SwitchMode(FEE,FEI, &sICSConfig);
while(1)
{
}
}