Hi NXP community,
i am using S32K148EVB-Q176(S32k148 micro) and while trying to work with the following code
void initClock(){
int val;
/* Configure ext. osc. */
SCG_SOSCCFG |= (0x3 << SCG_SOSCCFG_RANGE);
SCG_SOSCCFG |= (0x1 << SCG_SOSCCFG_EREFS);
SCG_SOSCCFG |= (0x1 << SCG_SOSCCFG_HGO);
SCG_SOSCCSR |= (0x1 << SCG_SOSCCSR_SOSCEN);
while(!(SCG_SOSCCSR & (0x1 << SCG_SOSCCSR_SOSCVLD)));
The control is not coming out of the while loop , can you please verify the initialization for clock is correct?
Thanks
Solved! Go to Solution.
Hi Everyone,
It is working after modifying with the following code
SCG_SOSCDIV = 0x00000101;
SCG_SOSCCFG = 0x00000024;
Thanks
Hi Everyone,
It is working after modifying with the following code
SCG_SOSCDIV = 0x00000101;
SCG_SOSCCFG = 0x00000024;
Thanks
Sorry i forgot to add #defines
#define SCG_SOSCCFG (*(unsigned volatile int*)0x40064108)
#define SCG_SOSCCFG_RANGE 4
#define SCG_SOSCCFG_EREFS 2
#define SCG_SOSCCFG_HGO 3