LPC844M201JHI33 CTimer issue?

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

LPC844M201JHI33 CTimer issue?

ソリューションへジャンプ
923件の閲覧回数
Felix_ar
Contributor III

Hi Everyone

Platform:LPC844M201JHI33

Software:LPC845-Example-Code-Bundle-MCUXpresso

Main clock:30MHz

We would like implement capture function of CTimer, but we are encountering some problems.

1. use a signal generator to generate a signal(20Hz, 20 high pulse per second)

2. setup PR(Prescale register)=1(15MHz), the TC(Timer Counter) only report 10 time per second.

3. setup PR(Prescale register)=0(30MHz), the TC(Timer Counter) report 20 time per second.

4. setup PR(Prescale register)=29(1MHz), the TC(Timer Counter) no any response.

input frequency is low, why must use a high frequency PR setting be used to calculate the correct number of pulses?

why use capture channel 0, the CR0 can't read any value? only TC(Timer Counter) have increase numbers, what function for CR0~3?

Thanks.

ラベル(1)
0 件の賞賛
返信
1 解決策
900件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Felix_ar 

Each capture register is associated with one capture channel and may be loaded with the
counter/timer value when a specified event occurs on the signal defined for that capture
channel.

Alice_Yang_1-1699002403284.png

 

 

BR

Alice

元の投稿で解決策を見る

0 件の賞賛
返信
7 返答(返信)
901件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Felix_ar 

Each capture register is associated with one capture channel and may be loaded with the
counter/timer value when a specified event occurs on the signal defined for that capture
channel.

Alice_Yang_1-1699002403284.png

 

 

BR

Alice

0 件の賞賛
返信
875件の閲覧回数
Felix_ar
Contributor III

Hi Alice

 

Thank for you reply.

could you help to reply first question?

 

0 件の賞賛
返信
861件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Felix_ar 

Do you mean this question "input frequency is low, why must use a high frequency PR setting be used to calculate the correct number of pulses?" ?

Why do you say "must"? You can config the clock refer to your own requirements.

 

BR

Alice

0 件の賞賛
返信
787件の閲覧回数
Felix_ar
Contributor III

Hi Alice

Maybe I had some misunderstand, I think the key point is PR setting, because CTimer function input clock can't change.

Thank you reply.

0 件の賞賛
返信
777件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Felix_ar 

Could you please describe this question more detail? You can take example to me, thanks.

 

BR

Alice

0 件の賞賛
返信
773件の閲覧回数
Felix_ar
Contributor III

Hi Alice

As explained on page 9 of the user manual, only one clock source input to CTimer function and that doesn't have any clock adjustment function, so CTimer sample rate clock frequency equal to input clock.

originally I wanted to adjustment PR setting to change sample rate, but this idea is wrong, PR setting only change counting method.

above is my understanding.

if I have any mistake, please correct me.

Thanks.

0 件の賞賛
返信
749件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Felix_ar 

"PR setting only change counting method."

->> Yes,When the Prescale Counter (PC) is equal to this value, the next clock increments the TC and clears the PC.

 

BR

Alice

0 件の賞賛
返信