TI中文支持网
TI专业的中文技术问题搜集分享网站

AM2434: Problems with modifying the timer cycle

Part Number:AM2434

In the DC mode of Ethercat master station, we need to constantly modify the timer cycle.We find that changing the reloadVal value in the TIMER_TLDR register can change the timer cycle, but it will work in the next cycle.In order to change the current period of the timer, we operate on the TIMER_TCRR Register's countVal value. But we found that if we changed the value of countVal in the register, the timer would only work for a period of time and then it would stop for no reason.
 
We need your help to solve the following problems.
1.Can you give us a way to modify the current period of the timer, and need not stop the timer.
2.We want to know why the timer stopped after we change the countVal value of the TIMER_TCRR register frequently.

Gary Lu:

Hello,

1. To modify the current period of the timer without stopping it, you can use the following steps:

a. Read the current count value from the TIMER_TLDR register and store it in a variable.b. Calculate the new count value based on the desired timer period.c. Write the new count value to the TIMER_TCRR register.d. Write the original count value to the TIMER_TLDR register.

This will update the timer period without stopping it.

2. The reason why the timer stopped after changing the countVal value of the TIMER_TCRR register frequently could be due to the following reasons:

a. The timer is not being reset properly after each update. Make sure that you are resetting the timer by writing the original count value to the TIMER_TLDR register after changing the countVal value in the TIMER_TCRR register.

b. The timer is being updated too frequently, causing it to overflow or underflow. Make sure that you are updating the timer at a reasonable rate and that the new count value is within the valid range for the timer.

c. There could be a software or hardware issue causing the timer to stop. Check for any error messages or warnings in the system logs or debug output, and make sure that the hardware is functioning correctly.

Regards,

Gary

,

HE zunyi:

Thanks for your answer,I'll try this method

,

Gary Lu:

You're welcome. Look forward to your feedback

赞(0)
未经允许不得转载:TI中文支持网 » AM2434: Problems with modifying the timer cycle
分享到: 更多 (0)