STM32 HAL with CubeMX: Tutorial 42 - I2C LCD16x2 driver

Поделиться
HTML-код
  • Опубликовано: 21 июл 2024
  • This tutorial shares a software driver for the I2C LCD16x2 display for STM32 MCUs using HAL Library.
    Library files:
    github.com/MYaqoobEmbedded/ST...
  • НаукаНаука

Комментарии • 104

  • @zepovinho8066
    @zepovinho8066 3 года назад +2

    Glad to say, this is one of the few channels were you actually get clear and fast learning content

  • @cargo501
    @cargo501 3 года назад +1

    thank you so much for this series! These videos are incredibely useful for learning about embedded programming using these MCUs - I have done the ADC, DAC, the LCD with I2C, and looking forward to doing the other ones.

  • @kanal1943
    @kanal1943 Год назад +1

    Wow its amazing how simply and clearly this library has been written. I hope tommorow its will work correctly in my project. Thans for sharing,i appryciate that, i there are a lot of work ahead me to by able do sommething simmilar by myself.

  • @arandomwho
    @arandomwho 3 года назад

    you cant guess how i appreciate you for this tutorial

  • @eduardodelarosaferrer2205
    @eduardodelarosaferrer2205 4 года назад +3

    Welcome back I miss you !

  • @idratherbemaking4270
    @idratherbemaking4270 4 года назад +1

    Nice to have you back Muhammad! And this was just the example I was looking for ;-)

  • @abdulwaiz2677
    @abdulwaiz2677 4 года назад +2

    Great job bro I always wait for your nice tutorial

  • @Engineer_Valat
    @Engineer_Valat 4 года назад +7

    Welcome back Akhi Muhammad Yaqoob, we miss you..
    Best Regards.

    • @mutexembedded2206
      @mutexembedded2206  4 года назад +3

      Hi! Thanks man.

    • @rgorazd
      @rgorazd 4 года назад

      That was the first thing I wanted to say. Wellcome back! You have been missed.

  • @pusatberk4193
    @pusatberk4193 4 года назад +4

    I missed you Muhammed. thanks.

    • @mutexembedded2206
      @mutexembedded2206  4 года назад +3

      Hey Pusat. I will try to be active more frequently. Thanks

  • @Steven_Bennett_YT
    @Steven_Bennett_YT 3 года назад

    Incredibly helpful, thank you.

  • @faustinhoka6507
    @faustinhoka6507 4 года назад +4

    Hi Yaqoob, great tutorials. However, I want to know if your library can also work with I2C LCD 20x4 display?

  • @dickesf8525
    @dickesf8525 2 года назад

    Weirdly enought I had to exclude the .c file from the build because all functions were declared twice, but except from those minor setup difficulties i really love the library!
    works like a charm!

  • @dineshsundarschannel5317
    @dineshsundarschannel5317 4 года назад

    Thank you soo much its working for me.

  • @walterhynson2898
    @walterhynson2898 2 года назад

    Thank you very much but my question is "where are all the libraries kept "?

  • @user-mh8uz1xf1j
    @user-mh8uz1xf1j 3 года назад

    i didn"t understand,need to turn on interrupt for i2c in Cube mx?

  • @spiralbrain
    @spiralbrain 4 года назад +4

    You can switch to the dark theme in Cube IDE, looks cooler and easier on the eyes.

  • @m4nuz
    @m4nuz 3 года назад

    Hello, can anyone help me how to move the cursor in steps? I miss that function in the great libary

  • @dhivyasreedharmohan3811
    @dhivyasreedharmohan3811 4 года назад

    Can you please tell me how to read the multiple channel of adc using timer....I have seen you videos but it is using dma or the polling function let me know is it possible to use a particular timer interrupt for 3 channel adc..and let me know how.

  • @etolocka
    @etolocka 3 года назад

    Thank you very much, but I think there are errors in the .h file, towards the end the .c is repeated

  • @codigoarduinocali1665
    @codigoarduinocali1665 3 года назад

    excelente tutorial. gracias

  • @aswahd
    @aswahd 4 года назад

    could you please make a video on stm32 usb without cubeMx?

  • @minhcanhnguyen2590
    @minhcanhnguyen2590 4 года назад

    can you guide to write about stm32f4 with fingerprint sensor R307? thank you

  • @KalyanChandraGurajapu
    @KalyanChandraGurajapu 3 года назад +1

    May I know how is it done in Keil uV5 ?

  • @carlosoliveira6867
    @carlosoliveira6867 3 года назад

    Hey, excellent video but i am working with a STM32f4 nucleo .. What do I have to change to make it work? I suspect that got something to do with the slave address, cause I tried to make all the steps and it not prints the hello.. can you help me please?

  • @srinivas-8339
    @srinivas-8339 4 года назад

    could you please make videos on stm32mp1 discovery (Yocto) projects

  • @arashhashemi7091
    @arashhashemi7091 4 года назад +1

    Good job 👏

  • @zepovinho8066
    @zepovinho8066 3 года назад

    can you please tell me what adress should i use on lc216x2_i2c.c as the slave address when i am using i2c2 and not i2c1?
    my i2c1 is busy with other stuff, can you please help me?

  • @mehmetinci1510
    @mehmetinci1510 4 года назад +1

    Thank you very much for your effort. Unfortunately, c and h files are mixed.

  • @user-ds5rk6mf5t
    @user-ds5rk6mf5t Год назад

    Is it same for the 20*04 I2C LCD?

  • @marianagomezsarmiento6709
    @marianagomezsarmiento6709 Год назад

    the code has a mistake in theheader file, it has a part of the .c file, and also qhen you remove that part, the .c file does not recognizes the functions of the library

  • @luxxxa1186
    @luxxxa1186 3 года назад

    OMG, this tutourial is amazing, I was able to set up my display in 15 minutes :0.
    One thing:
    In the "lcd16x2_i2c.h" file in line 307 is an unclosed command:
    ear
    */
    I don't know what it is supposed to do, I just closed the command and it works!
    /*
    ear
    */

  • @bruhmotti90
    @bruhmotti90 3 года назад +1

    can you share the whole project please?

  • @taylorsailing1122
    @taylorsailing1122 2 года назад +2

    Hi, I have a Nucleo-401RE using STM32CubeIDE version 1.8.0. Added the lcd16x2_i2c.c and /h files to the project (Core/Src and Core/Inc) and get 22 errors when I build. All errors are in the .lcd16x2_i2c.c file "redefinition of" starting on line 47. I assume it is a setup problem on my end. Any thoughts?

  • @KANUPOLAS
    @KANUPOLAS 2 года назад

    Trying to compile lcd16x2_i2c.c file, it fails to compile with multiple errors of redefinition. FOr example, error: redefinition of 'lcd16x2_i2c_printf'. Please any help? I'm using CUBE IDE 1.5

  • @adityanautiyal3081
    @adityanautiyal3081 2 месяца назад

    HI, can you help me in this code. I have tried it many time but it is not working with proteus, NEED halp.

  • @sekououmartraore7157
    @sekououmartraore7157 4 года назад

    Hi sir! Can these libraries files work with F401RE nucleo stm32 board ?

    • @pw3111
      @pw3111 2 года назад

      Once edited to remove errors, the library files work fine with a F401RE board. I’ve also modified them to work with a 20x4 i2c display.

  • @johnnywilfredobohorquezhue4363
    @johnnywilfredobohorquezhue4363 3 года назад

    Funcionó para la STM32F103C8! Pero hay errores en los archivos, se debe de corregir y listo!

  • @babotvoj
    @babotvoj 4 года назад +2

    the library does not work

  • @Pyrzrcp
    @Pyrzrcp Год назад

    HELLO THERE ;
    only two of the files that appear on the screen have been uploaded. Can you upload the rest of the files so that it doesn't give an error?

  • @simonpersson2383
    @simonpersson2383 3 года назад

    I get 16 error from your .C-file with something about "redefinition of ---" one the first line of all the functions. I don't understand why. Anyone ells with this problem?

  • @Alan96555
    @Alan96555 2 года назад

    The two files have several errors, it doesnt work :/

  • @stevescott55
    @stevescott55 3 года назад

    Hello All, just getting started with this and it looks great. I am having trouble with the files/code. 'lcd16x2_i2c_init' doesnt seem to be anywhere. Any help?

    • @stevescott55
      @stevescott55 3 года назад

      Found that error - was using the 4 and 8 bit files for the I2C project!
      Fixed that stupid mistake but I am getting a host of errors. I have tried deleting the section called out by Maris and still no luck. Are the libraries correct?

    • @stevescott55
      @stevescott55 3 года назад

      Got errors taken care of, LCD seems to come up but no message and no LED indication that I have talked to the LCD. Using a Nucleus-144 H723 and can't find a clear pinout of the board so I might be on the wrong pins. I am using PB6 for SCL and PB7 for SDA, have pullups enabled, Alternate function Open Drain, and High for max output speed.

  • @sinulokssinuloks7934
    @sinulokssinuloks7934 4 года назад +2

    Hi! Could you check line 307 of lcd16x2_i2c.h. What is it ear ?

    • @mutexembedded2206
      @mutexembedded2206  4 года назад

      Hello,
      There's no such line 307.

    • @sinulokssinuloks7934
      @sinulokssinuloks7934 4 года назад

      This's part of lcd16x2_i2c.h, line 300-310. What is it ear?
      vsprintf(stringArray, str, args);
      va_end(args);
      for(uint8_t i=0; i

    • @m4nuz
      @m4nuz 3 года назад +2

      @@mutexembedded2206 it's true, the libary is not working ... plz fix that!

    • @m4nuz
      @m4nuz 3 года назад +2

      the issue is that a c file is mixed in the h file... i deleted the c-file content, i guess now it works

    • @gokhankarakaya6665
      @gokhankarakaya6665 3 года назад

      @@m4nuz You're my hero

  • @stevescott55
    @stevescott55 3 года назад

    I appreciate this tutorial, however, I am having these errors:
    ../Core/Src/main.c:128:7: warning: implicit declaration of function 'lcd16x2_i2c_init' [-Wimplicit-function-declaration]
    128 | if (lcd16x2_i2c_init(&hi2c1))
    | ^~~~~~~~~~~~~~~~
    ../Core/Src/main.c:132:3: warning: implicit declaration of function 'lcd16x2_i2c_printf' [-Wimplicit-function-declaration]
    132 | lcd16x2_i2c_printf("Hello World");
    | ^~~~~~~~~~~~~~~~~~
    These are warnings and I have no errors, but it still does not seem to function.
    Any help in understanding would be greatly appreciated.

  • @sinulokssinuloks7934
    @sinulokssinuloks7934 4 года назад +1

    Hi! Files of library has different name in video and on github. Maybe it's problem.

    • @mutexembedded2206
      @mutexembedded2206  4 года назад

      Yeah. Ones on GitHub are correct. Not a problem anyway. Compiler accept such thing.

    • @sinulokssinuloks7934
      @sinulokssinuloks7934 4 года назад +1

      I'm sorry but i have one more question. Is it reight to define function in two files at the same time?
      For exaple:
      static void lcd16x2_i2c_sendCommand(uint8_t command) in lcd16x2_i2c.h and the same function
      static void lcd16x2_i2c_sendCommand(uint8_t command) in lcd16x2_i2c.c

    • @m4nuz
      @m4nuz 3 года назад

      @@sinulokssinuloks7934 in this case it's correct because the .h file is a headder file. headder file just take the name of the functions in the .c-file of the same name. In your code you just have to include the .h-file and the compiler knows from that which functions are used..

  • @pw3111
    @pw3111 2 года назад

    Multiple errors “redefinition ………” in .c file. Has anyone fixed this yet?

    • @pw3111
      @pw3111 2 года назад

      O/K. I edited the .h and .c files and it all works well.

  • @mustafasenturk6350
    @mustafasenturk6350 2 года назад +1

    Hello, Mohamed I am facing a problem so ı need to ask if ı am wondering you can answer me? When ı add -u_printf_float to the miscellaneous section and build the code, ı am having a building problem. `.text' will not fit in region `FLASH' and region `FLASH' overflowed by 8120 bytes. Can you help me ?

    • @mutexembedded2206
      @mutexembedded2206  2 года назад

      Yes,
      That’s your code data size exceeding MCU Ram memory.
      Either reduce your ram data size like reduce array max length or use an MCU with bigger Ram memory

    • @mustafasenturk6350
      @mustafasenturk6350 2 года назад +1

      @@mutexembedded2206 Thank You!

  • @stevescott55
    @stevescott55 3 года назад

    Hello- Don't know if anyone is listening out there but I have compiled many times (success); the LED turns on after I init the LCD, the backlight comes on, but no text is on the LCD.
    I have turned the contrast up to the point where I see the 1st and 3rd line of blocks (I am trying a 4 line LCD) but no text.
    Does anyone know if there is a difference in talking to a 2 line vs a 4 line LCD? Seems to be so does anyone know how to do it?

    • @mutexembedded2206
      @mutexembedded2206  3 года назад +1

      Hi Steve,
      Which STM microcontroller you're using?
      I will be happy to take a look at your project setup

    • @stevescott55
      @stevescott55 3 года назад

      @@mutexembedded2206 Hello! Good to finally hear from someone and it is YOU!
      I am using the Nucleo-H723ZG, STMCubeIDE, a SainSmart I2C 4x20 LCD display. I have made mods to your code to try to get the 4x20 display to work. The LCD backlight lights up and my feedback LED (very nice) does light up - just no printing.
      happy to forward my modified .H and .C files to you (somehow) in an effort to learn more from you.

    • @mutexembedded2206
      @mutexembedded2206  3 года назад +1

      @@stevescott55 Sure, just send me a sharing link.

    • @stevescott55
      @stevescott55 3 года назад

      @@mutexembedded2206 hello?

    • @mutexembedded2206
      @mutexembedded2206  3 года назад

      @@stevescott55 🕶

  • @prathameshbarik
    @prathameshbarik 4 месяца назад

    I spent last 10 hrs with the code with the same microcontroller and like all the others who commented, i got the same error because the author forgot to upload proper code.

  • @naasikhendricks1501
    @naasikhendricks1501 4 года назад +1

    FYI your audio is better. All the best with Shut down. Day 9 for me. Lol

  • @shivamchoudhary6280
    @shivamchoudhary6280 3 года назад +2

    I think the library in GitHub is different from what is used in the video. they have a lot of lines

    • @marisjankovskis3307
      @marisjankovskis3307 3 года назад +2

      there is a duplicate, find
      cl*/ and and then find ear*/
      and delete everything in between those two

  • @Gkvhkbt
    @Gkvhkbt 4 года назад +1

    Welcome back! I'm too writing and rewriting libraries from Arduino et al. to STM32 and place them all on my GitHub for free: github.com/DanielMartensson/stm32-libraries If you want, I can help you by writing a WiFi project. I think that WiFi is very important communication tool today. More important than other.

  • @user-me7vm6ns1f
    @user-me7vm6ns1f 4 года назад

    ..\Src\lcd16x2_i2c.c: 2 warnings, 17 errors

    • @user-me7vm6ns1f
      @user-me7vm6ns1f 4 года назад +1

      Created on: Mar 28, 2020

    • @mutexembedded2206
      @mutexembedded2206  4 года назад

      @@user-me7vm6ns1f What's that again

    • @osmankadayif
      @osmankadayif 2 года назад

      @@mutexembedded2206
      13:57:05 Build Failed. 16 errors, 2 warnings. (took 431ms)

    • @osmankadayif
      @osmankadayif 2 года назад

      Description Resource Path Location Type
      redefinition of 'lcd16x2_i2c_sendCommand' lcd16x2_i2c.c /LCD_I2C/Core/Src line 52 C/C++ Problem