cancel
Showing results for 
Search instead for 
Did you mean: 

unable to generate signal and capture external signal by one pulse mode?

M abouhasem
Associate II
Posted on October 22, 2017 at 00:41

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-mode
2 REPLIES 2
M abouhasem
Associate II
Posted on October 22, 2017 at 00:44

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6u0&d=%2Fa%2F0X0000000bxf%2FnKC_aCbCPZ4VlxRU.yCDzUM2inLQA4WQ0Ex13b0uWB8&asPdf=false
Posted on October 22, 2017 at 19:39

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