Count milliseconds

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

cross mob
lock attach
Attachments are accessible only for community members.
Jaleh
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

Hi everyone

I am trying to count milliseconds in a project, but I don´t know how to adjust the parameters.  I attach the scheme of this part of my project.

uint32 counter_ms=0;

CY_ISR(TC_InterruptHandler){
//Clears the timer terminal count interrupt//
Timer_ClearInterrupt(Timer_INTR_MASK_TC);
counter_ms++;
}

int main(){

CyGlobalIntEnable;

Timer_Start();
TC_Interrupt_StartEx(TC_InterruptHandler);

}

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

How about using SysTick, so that you don't have to use a Timer for this purpose?

The following discussion could be a hint.

https://community.cypress.com/t5/PSoC-4-MCU/Usage-of-the-Systick-Timer-interrupt-in-PSoC4/m-p/159102

moto

View solution in original post

0 Likes
1 Reply
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

How about using SysTick, so that you don't have to use a Timer for this purpose?

The following discussion could be a hint.

https://community.cypress.com/t5/PSoC-4-MCU/Usage-of-the-Systick-Timer-interrupt-in-PSoC4/m-p/159102

moto

0 Likes