s32k148 clock not getting valid

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

s32k148 clock not getting valid

ソリューションへジャンプ
2,166件の閲覧回数
microman1
Contributor II

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

タグ(2)
0 件の賞賛
返信
1 解決策
2,152件の閲覧回数
microman1
Contributor II

Hi Everyone,

It is working after modifying with the following code

SCG_SOSCDIV = 0x00000101;

SCG_SOSCCFG = 0x00000024;

Thanks

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,153件の閲覧回数
microman1
Contributor II

Hi Everyone,

It is working after modifying with the following code

SCG_SOSCDIV = 0x00000101;

SCG_SOSCCFG = 0x00000024;

Thanks

0 件の賞賛
返信
2,154件の閲覧回数
microman1
Contributor II

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

0 件の賞賛
返信