- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an application needs to measure the pulse width. I used the demo code PWMexample as a start. I added a TCPWM counter component to try to measure the pulse width of the PWM signal. Hope that the counter will start at the rising edge and capture at the falling edge so by reading the capture register I can get the pulse width. But the problem here is: whenever I added start or reload input to the component, the capture won't trigger the interrupt.
Does anyone knows what I missed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why do you think that start reacts to a rising flank and capture to a falling flank? The component data sheet says a capture happens when "a capture event is active". This means the signal must go high for a capture.
In your schematic, a NOT gate should then help. Or even better: use an edge detector component.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reply! But the inputs can be configured as either 'rising edge', 'falling edge' or both?
On datasheet: The Input Configuration parameters select the visibility and mode for each of the five input signals (Reload, Start, Stop, Capture, and Count). These inputs are not visible on the symbol by default. Check the Present checkbox for each input that is needed in the design to make it present on the symbol for connection. Each of these signals can be configured to be triggered by a Rising edge, Falling edge, Either edge, or based on the signal Level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you share your project? The images show not everything...
How did you determine the interrupt is not triggered? By software? (Maybe the ISR was not started...) You can route the interrupt line a to a pin and then use a scope to check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it worked... something messed up in the software...
Much appreciated for your reply. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Janey,
Could you share what went wrong in the setup, so that it will be helpful for the community.
Best Regards,
VSRS