Firc Clock Test Using LPTMR

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

Firc Clock Test Using LPTMR

1,881件の閲覧回数
sungjun
Contributor II

Hi. this is sung jun.

I am trying to test the clock precision through the LPTMR driver.
Here's how I planned it:

1. Set SIRC (8Mhz) to LPTMR.
Then, compare value is set for LPTMR operating at 8Mhz, and count and time are checked by checking LPTMR_CSR_TCF in a while loop.

2. Set FIRC (48Mhz) to LPTMR.

Perform the same test as in step 1.

Since the clock difference between SIRC and FIRC is 6 times, we want to check the expected count value and time difference.

However, it seems that the clock source expected to be 8MHz in my setup is not 8MHz.
Approximately ... 48Mhz and 4.8 to 5 times the difference.

To summarize the questions, I am curious about the following 3 things.

1. I think the clock source expected to be 8Mhz is BUS_CLK, is that correct?

2. In the SIRC 8MHz setting,
The PCS value is 0, which is marked with an x in the figure below.
At this time, does 0 mean BUS_CLK?

3. is there a way to determine which Source Clock goes into each Peripheral?

Please refer to the picture below.

SIRC 8MHz setting

sungjun_2-1686730292546.png

 

sungjun_0-1686730193671.png

sungjun_4-1686730367000.png

 

FIRC 48MHz Setting

sungjun_3-1686730314022.png

 

sungjun_1-1686730243708.png

 

 

 

0 件の賞賛
返信
3 返答(返信)

1,849件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @sungjun 

1. I think the clock source expected to be 8Mhz is BUS_CLK, is that correct?

No, BUS_CLK is the clock signal that limits the maximum frequency that the LPTMR can reach.

2. In the SIRC 8MHz setting, the PCS value is 0, which is marked with an x in the figure below. At this time, does 0 mean BUS_CLK?

No, at PCC_LPTMR0[PCS], if you select 000 you will not receive any clock signal.

3. is there a way to determine which Source Clock goes into each Peripheral?

Table 27-8 (Peripheral clock summary) and Table 27-9 (Peripheral module clocking) are the ones that show which clocks go to each peripheral.

 

B.R.

VaneB

0 件の賞賛
返信

1,785件の閲覧回数
sungjun
Contributor II

 

Hello. VaneB

Thanks for your help.

I checked my settings again, and they are set as shown in the picture below.
SIRC (8 MHz) is shown in Figure 1.
FIRC (48 MHz) is Figure 2.

<Figure 1>

sungjun_0-1687176510567.png

<Figure 2>

sungjun_1-1687176545060.png

 

I am trying to compare the deviation of SIRC and FIRC through LPTMR.
Compare value is 1200 and Compare value Units is Microseconds.

Test result is going to be received as LPTMR0->CNR.

I ran into a problem here.

In RM's deviation, SIRC is within 3% and FIRC is expressed within 1%, but when actually tested, it occurs from xx% to x% depending on the Compare value.

Did I test wrong?

sungjun_2-1687176610114.png

In addition, the error rate was compared by changing the Compare value.
The result is as below, can you tell me why?

sungjun_3-1687176911453.png

 

 

 

タグ(1)
0 件の賞賛
返信

1,773件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @sungjun 

Please correct me if I understand wrong. 

You are testing the accuracy of SIRC and SIRC using the LPTMR. My suggestion is with an oscilloscope to try to measure the period of the PIT (the same clock frequency on both clocks) by toggling a pin.

If this suggestion is not useful for you, let me know.

 

0 件の賞賛
返信