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.
已解决! 转到解答。
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.
BR
Alice
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.
BR
Alice
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
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.