AnsweredAssumed Answered

KE04Z  how to set internal oscillator - help needed

Question asked by Marcin Goluch on Oct 27, 2016
Latest reply on Oct 28, 2016 by Kerry Zhou

Hi all, I'm newbee so please be patient reading my post :-). I have code as below (Which is working properly on FRD-KE04Z) but this development board is using external oscillatror. I have my own simple board based on KE04Z but I need to use internal oscillator. Please help me how to set it up KE04Z to use internal oscillator.

 

int main (void)
{
RTC_ConfigType sRTCConfig;
RTC_ConfigType *pRTCConfig = &sRTCConfig;
/* Perform processor initialization */
sysinit();
cpu_identify();

printf("\nLED exaple.\n");

/* configure RTC to 1Hz interrupt frequency */
pRTCConfig->u16ModuloValue = 9;
pRTCConfig->bInterruptEn = RTC_INTERRUPT_ENABLE; /* enable interrupt */
pRTCConfig->bClockSource = RTC_CLKSRC_1KHZ; /*clock source is 1khz*/
pRTCConfig->bClockPresaler = RTC_CLK_PRESCALER_100; /*prescaler is 100*/

RTC_SetCallback(RTC_Task);
RTC_Init(pRTCConfig);


GPIO_PinInit(GPIO_PTE7, GPIO_PinOutput);


while (1);

 

}

}

 

void RTC_Task(void)
{
GPIO_PinToggle(GPIO_PTE7);
printf("\nLED state changed.\n");


}

Outcomes