43. STM32CubeIDE Ultrasonic Distance Sensor. HC-SR04 / OLED with STM32F103C8T6

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • STM32 Blue Pill for beginners
    Code and diagram are at www.micropeta....

КОМЕНТАРІ • 20

  • @NizarMohideen
    @NizarMohideen  3 роки тому +2

    In this video I set Clock Configuration tab → HCLK (MHz) to 72
    You can set the speed of STM32 to any value you want up-to maximum of 72 for STM32F103C8T6. Most of the time 72 is better.
    I set prescaler to 71
    The reason is
    I needed to measure micro-seconds for the sensor
    Time = 1 / Frequency
    1 us = 1 / 1MHz
    To have micro-second, timer frequency needs to be 1MHz.
    Because I already set clock to 72MHz, I need to divide it by 72 for timer frequency.
    You can divide it using prescalor
    Prescalor is always one less so it is 71
    Another example: If you set clock to 64MHz, you need to divide it by 64 for timer frequency.
    Prescalor is 63

  • @vinodkinoni4863
    @vinodkinoni4863 3 роки тому +1

    nice work thanks so lot for your hard work

  • @sanjeewaalahakone4324
    @sanjeewaalahakone4324 2 роки тому +1

    Thank you, Nizar

  • @Jjeico
    @Jjeico Рік тому

    Thank you so much, it worked for the STM32-L476RG, I just had to change #include "stm32f1xx_hal.h" to #include "stm32l4xx_hal.h" on the libraries.

  • @sardarwaqas458
    @sardarwaqas458 3 місяці тому

    Es Koo run krtaa ha aur stm board par transfer krta ha too nehe hota kata ha stm link is not recognize kindly help

  • @harisbinnadeem480
    @harisbinnadeem480 Рік тому

    I am doing this project on STM32F401RE.the code runs fine but when i debug it shows me the error. Error message from debugger back end:
    Error erasing flash with vFlashErase packet.

  • @ISABELAMARYSASAKIESILVA
    @ISABELAMARYSASAKIESILVA 5 місяців тому

    i love you

  • @khoinguyenes3423
    @khoinguyenes3423 2 роки тому

    how to debug on keil C, power supply from ST link is 3.3V so when plugging in 5V pin on stm32 the voltage is only 3.3V, so hcsr04 module not working, please help me

    • @NizarMohideen
      @NizarMohideen  2 роки тому +2

      Before connecting st-link, supply 5v via usb.
      Or, you can connect 5v (vcc) and gnd to +/- of separate 5v source

    • @khoinguyenes3423
      @khoinguyenes3423 2 роки тому +1

      @@NizarMohideen I power separately for Hc Sr04 module, power stm32 via STlink and then connect to common ground, will my computer be damaged when supplying 2 sources at the same time? I'm a newbie

    • @NizarMohideen
      @NizarMohideen  2 роки тому +2

      The computer will be fine as long as you supply 5V or less to any sensors.
      For more information about safety, please watch video no 51 or 52 in my UA-cam channel
      ua-cam.com/video/Ga2lfBq9zaE/v-deo.html
      ua-cam.com/video/TeAa6UPIb-c/v-deo.html

  • @aravindkumars4021
    @aravindkumars4021 2 роки тому

    Sir one request can you plz interface ultrasonic sensor with smt32 to control the brushless motor, if you have code plz send me

  • @bbsvampire3079
    @bbsvampire3079 4 місяці тому

    Can i get hex file of this Project?plz

    • @NizarMohideen
      @NizarMohideen  4 місяці тому +1

      I am sorry. I don't have the hex file with me
      You can make one using STM32CubeIDE

    • @bbsvampire3079
      @bbsvampire3079 3 місяці тому

      @@NizarMohideen Errors occuring in this code on my device

  • @traoantan7404
    @traoantan7404 8 місяців тому

    demoxe\demoxe.axf: Error: L6218E: Undefined symbol SSD1306_Init (referred from main.o). help me please