i am using stm8s cosmic c compiler and i am trying to config tim2 for 350uS(350uS should be the pulse width).
As per the reference manual tim4 is 16-bit with prescaler factor of 32768. I will be using internal 2mhz clock
my calculations are as follows:
1/2000000 = 0.0000005sec ~ 0.5uS
if we use 128 prescaler
128 * 0.5us = 64uS
I want each pulse to be of 350us, how do i calculate that! Please help maybe the calculations are wrong too, i am super confused.
I am trying to calculate it for 350us but i am not getting actual value, need guidence!