KL03 SysTick Timer in IAR vs. KDS 2.0

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

KL03 SysTick Timer in IAR vs. KDS 2.0

ソリューションへジャンプ
1,026件の閲覧回数
michaelsteffenf
NXP Employee
NXP Employee

All,

Using a FRDM-KL03Z board, and
programming the attached code in IAR and KDS, I get different results.

 

In IAR, red led flashes at exactly 100ms.

In KDS, red led flashes at exactly 200ms.

 

I checked everywhere where I could find a clock divide/2 and nothing.  I’m using the HIRC (48MHz), and
I can’t find any divide/2 except in OUTDIV1.

  

The Systick timer uses the core clock, which is not being divided down from the OUTDIV1 register.  The
memory location 0x04D, that controls the value at reset, is at 0x3D in IAR and KDS.

 

 

What am I missing?

 

 

Michael Steffen

 

 

 

 

Original Attachment has been moved to: KL03_Systick.txt.zip

ラベル(2)
タグ(4)
0 件の賞賛
返信
1 解決策
640件の閲覧回数
michaelsteffenf
NXP Employee
NXP Employee

Ok, I found the answer.

In KDS startup code in system_MKL03Z4.h, line 154,155, the statement

/* SIM_CLKDIV1: OUTDIV1=1,OUTDIV4=1 */

#define SYSTEM_SIM_CLKDIV1_VALUE     0x10010000u         /* SIM_CLKDIV1 */

The OUTDIV1 is the core clock, which is divide/2.  So the core clock is actually at 24MHz instead of 48MHz.

Mike

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
641件の閲覧回数
michaelsteffenf
NXP Employee
NXP Employee

Ok, I found the answer.

In KDS startup code in system_MKL03Z4.h, line 154,155, the statement

/* SIM_CLKDIV1: OUTDIV1=1,OUTDIV4=1 */

#define SYSTEM_SIM_CLKDIV1_VALUE     0x10010000u         /* SIM_CLKDIV1 */

The OUTDIV1 is the core clock, which is divide/2.  So the core clock is actually at 24MHz instead of 48MHz.

Mike

0 件の賞賛
返信