- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to create a timer in multiples of 10ms. At the moment, I intend to configure using the TCPWM component to achieve this, but I am not able to get the settings correctly when configuring.
Any advice?
Thanks
Paul.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have attached a sample project that generates a timer interrupt every 10ms. Please do check it out and let us know if it satisfies your requirement.
1. Please make sure that the ISR is written correctly and that Timer_1_ClearInterrupt(Timer_1_INTR_MASK_TC); API is called so that the interrupt is cleared.
2. Timer and clock components have to be started by calling the Timer_Start() and Clock_Start() APIs. Make sure you call these inside main().
3. Interrupt service must be started by calling the isr_StartEx() API.
If the problem isn't resolved, please share your project so that we can debug it and provide a solution.
Thanks and regards
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are three (3) parameters controlling the TCPWM:
The input clock
The period value
The compare value
The output frequency is calculated by: Input clock[Hz] / Period value
The pulse width[seconds] by: 1 / (Input clock[Hz] / Compare value)
So (as an example only) selecting
Input Clock 1MHz, Period value 100, Compare value 10 will result in
pulses every 10 ms with a width of 1ms
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have attached a sample project that generates a timer interrupt every 10ms. Please do check it out and let us know if it satisfies your requirement.
1. Please make sure that the ISR is written correctly and that Timer_1_ClearInterrupt(Timer_1_INTR_MASK_TC); API is called so that the interrupt is cleared.
2. Timer and clock components have to be started by calling the Timer_Start() and Clock_Start() APIs. Make sure you call these inside main().
3. Interrupt service must be started by calling the isr_StartEx() API.
If the problem isn't resolved, please share your project so that we can debug it and provide a solution.
Thanks and regards
Hari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Hari