1 of 1 people found this helpful
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
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
timer.cyprj.Archive01.zip 1.1 MB