2017-10-21 03:41 PM
Hello every body
I working on stm32f103RCTB with
HC-SR04 Rang finder this ultrasonic module need 10us trigger pulse to get echo from object ad converted it to pulse signal .
I figure that the suitable way to make it on is used one pulse mode function with interrupt
To trigger pulse as pwm channel 1 and received echo from channel two I make the Prescaler
Free =0 system clock with external oscillator HSE 8 Mhz that multiple with PLL to get 72 MHZ
So I make ARR(counter) t0 0xffff slave mode reset with trigger source TI2FP2 for channel 2 as i input capture mode and channel 1 as pwm with 720 pulse to get (72000000/720) to get 10us and measuring signal received by invoking interrupt HAL_TIM_IC_CaptureCallback ad reading the CCR2(Capture compare register) .
But didn't get anything what is wrong
#one-pulse-mode2017-10-21 03:44 PM
2017-10-22 10:39 AM
hello!
To have an IC callback , call HAL_TIM_IC_Star_IT(&htim4, TIM_CHANNEL_2); in main function , before start one pulse mode.
regards
vf