AnsweredAssumed Answered

input capture help or other suggest

Question asked by abdelmagid.amr.001 on May 20, 2014
Latest reply on May 25, 2014 by abdelmagid.amr.001

I am using STM32f100C8 on this controller implemented :
  • Tim4 that work as global clock for all the functions (generating ticks and counter with  flags compare to seconds )
  • Tim3 work as PWM but it implemented manually using the timer4 ticks as I put the port high and low manually after checking the timer and the port status (all these steps of PWM done in ISR with pirotry less that the ISR of TIM4)
  • this PWM is connected to current booster (using transistor and coil and store the charges in a capacitor).
  • I change the PWM duty cycle according to the voltage on Capacitor (get this value using ADC)
the problem that while the code running the signal of the PWM hang to be high that make the current in the coil increase until I hear the coil sound and I didn't stop the coil get burned 
this problem happen completely random and I haven't notice any condition to initiate it 

the hardware design don't allow me to connect the debugger while the current booster working to get in which part this problem happen and why it stuck with high out of the PWM

any idea to troubleshoot this bug is highly appreciated 

I think I can use input capture as I hardware connected this PWM port with PB15 wired and try to configure the timer to capture any high pulse with width over than 14us

so if input capture can  solve this problem to get where this bug generated plz show me the code to configure the timer and remap this timer as this is my first time to deal with input capture  

thanks in advance