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.
Anonymous
Not applicable

Hello members.

I want to create a project shown in the attached file (H Pulse Count) and measure the H width of Input_Signal.

[Question]

1.How can I read the captured current count value?

2.Is there a register that saves the count value?

3.Is the component configure (Capture_Input = Falling Edge, Count Input = Rising Edge) correct?

Best Regards

0 Likes
1 Solution
NidhinM_71
Employee
Employee
25 solutions authored 10 solutions authored Welcome!

Hello,

1. You can use the Cy_TCPWM_Counter_GetCapture() API to read the captured count value.

2. Yes, TCPWMx_CNTy_CC register stores the captured count (x is the TCPWM group number - 0 or 1, and y is the counter number). Please use the API mentioned above instead of direct register reads since PSoC Creator may re-assign the Counter to a different TCPWM address when you make changes to the TopDesign schematic.

3. The logic looks ok to me. However, I'd recommend examining the following code example for component settings and API reference, which documents a similar technique used for frequency measurement:

CE220692 - PSoC 6 MCU: Frequency Measurement Using TCPWM

Please let me know if you have more questions.

Regards

Nidhin

View solution in original post

0 Likes
1 Reply
NidhinM_71
Employee
Employee
25 solutions authored 10 solutions authored Welcome!

Hello,

1. You can use the Cy_TCPWM_Counter_GetCapture() API to read the captured count value.

2. Yes, TCPWMx_CNTy_CC register stores the captured count (x is the TCPWM group number - 0 or 1, and y is the counter number). Please use the API mentioned above instead of direct register reads since PSoC Creator may re-assign the Counter to a different TCPWM address when you make changes to the TopDesign schematic.

3. The logic looks ok to me. However, I'd recommend examining the following code example for component settings and API reference, which documents a similar technique used for frequency measurement:

CE220692 - PSoC 6 MCU: Frequency Measurement Using TCPWM

Please let me know if you have more questions.

Regards

Nidhin

0 Likes