Read timer value

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BaM_4291296
Level 1
Level 1

Hello,

I am doing project on the time, it should detect the on time and off time and that time should be displayed on monitor via UART. I have made use of the cyble- 01-201100 and i have made use of the timer module as a timer/counter and i tried to fetch the time using Timer_ReadCapture(), but it always shows the 65535(period/compare max values) constant but i need to find the on time and off time. Please help me to solve the problem.

Thanks,

Basavaraj

0 Likes
4 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Basavaraj,

Can you please elaborate more? Please tell us what is exactly the On time and OFF time you want to measure?

Some hints:

1. If you are using DeepSleep in your application, you can use WatchDogTimer to measure the times.

2. If you are not using Deep Sleep, you can use any of the timers TCPWM Timer/WatchDog timer/Systick timer to measure the times.

If you are using TCPWM timer, you can run the Timer in continuous mode and set the interrupt for terminal count and increment the variable inside Timer component isr.

Please refer code examples for Timer interrupt CE220169 TCPWM periodic interrupt in PSoC Creator.

Thanks and regards

Ganesh

0 Likes

Hello Ganesh,

I want to measure the capacitance charging and dis-charging time so that's why i need to detect the on time and off time in my timer

0 Likes

Hi,

Can you please give more details of your implementation(if possible, kindly share the block diagram)?

Also, Can you please let us know when is Timer_ReadCapture being called?

This will help us to have a clearer view of the issue you are facing.

Thanks and Regards,

Aashita

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

Here is the complete program please do check it.

0 Likes