- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi every one
I wish to read a pwm signal by using only an input pin + timer, so I make an interruption relied to my pin and then I make a delay of 1ms but when I send the data to my application to read it, its send to me 0 value, I think my interruption doesn't work correctly, any suggestion please thank you ^^
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your interrupts are not associated with a signal or a component, you just call the handlers from software. This might not be what you want.
A component is connected to an interrupt handler by using the Component_StartEx() API.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file. Please be a bit more clear what you want to perform, delay the signal by 1 ms?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your interrupts are not associated with a signal or a component, you just call the handlers from software. This might not be what you want.
A component is connected to an interrupt handler by using the Component_StartEx() API.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi bob, thank you for your answear 🙂
i want to read a pwm signal, thats why i use the bloc of TCPWM juste only for test, and then i send it to --->read_PWM_MOT, and the interrupt nam isr_1, sow i make my interruption on a rising edge like this :
CY_ISR(isr_speed)
{
cont++;
}
and then i call it : " isr_1_StartEx(isr_speed);"
and when i send the value of the counter in my buffer is send to me 000
TransmittData[0]=cont;
thank you for your answear ^^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To "read" a PWM signal you probably mean to measure pulse width. This is done best using a Timer Counter component. Configure that for capture on falling edge and a count input. Set interrupts on capture and on terminal count.
Connect your signal to measure to both capture and count inputs, select the clock frequency as desired.
Write an interrupt handler that reads the captured value, stops the counter, set counter to zero and starts counter again.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Connect your CounterISR to the interrupt signal on Counter_Spd.
Configure Counter_Spd to reload at tc and cc
In CY_ISR(cont_handler) you need to read the isr cause (see datasheet) to clear the interrupt and decide if it was a tc (no input signal) or a cc.
Bob