Skip to main content
M abouhasem
Associate II
October 21, 2017
Question

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

  • October 21, 2017
  • 2 replies
  • 820 views
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
    This topic has been closed for replies.

    2 replies

    M abouhasem
    Associate II
    October 21, 2017
    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
    Vangelis Fortounas
    Associate II
    October 22, 2017
    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