How to interface LCD20x4 with STM32 || I2C || HAL || CubeMx || TrueStudio

Поділитися
Вставка
  • Опубліковано 16 січ 2025

КОМЕНТАРІ • 65

  • @ucnamnguyen7549
    @ucnamnguyen7549 5 років тому +3

    it's very useful, hope you will make more videos like this

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

    where can i find lcd 2004a library for STM32 SPL ?

  • @thangnguyenduc6628
    @thangnguyenduc6628 3 роки тому

    It worked thank you so much sir

  • @ferdinvivian9336
    @ferdinvivian9336 3 роки тому

    Can I use this for 16x4 LCD display.
    Plz reply

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

    What will happen if i dont change the clock setting?

  • @noweare1
    @noweare1 4 роки тому +1

    I have been trying to port an avr library for this display to stm32f0 using LL drivers. I have not got it working. One difference I noted was the library I am porting writes a 0x00 to the display to set the direction of the expander chip but I do not see that in your code. Anyways I use CubeIDE also. Pretty much like Atollic, that worked good too.

    • @noweare1
      @noweare1 4 роки тому

      Couldn't get my code to work so I started a new project in CubeIDE, used Cube to set up the I2C, put your lcd files in source and include directories. Compiled, got an error changed from the f1 to f0 in your include file. Compiled fine, downloaded and it worked. Took me a total of 10 minutes. Now I still want to figure out why my code didn't work. Actually it worked about 1/2 the time, strange. Pretty sure it had to do with the configure part.

    • @ndidikenneth5135
      @ndidikenneth5135 9 місяців тому

      I also don't want hal .... I hal doesn't play nice with LL I will have to migrate my whole code to hal which I don't want . Pls how can this be done using LL LIBRARY. MY CODE IN LL doesn't work

  • @GamerOtakun
    @GamerOtakun 4 роки тому +1

    Thank you, but in this code, how can i send an data with 4 number to lcd ?

    • @ControllersTech
      @ControllersTech  4 роки тому +1

      Use sprintf to conver the number to characters and then send as a string

    • @GamerOtakun
      @GamerOtakun 4 роки тому

      @@ControllersTech thank you so much

    • @GamerOtakun
      @GamerOtakun 4 роки тому

      @@ControllersTech I have one more question, i want to use your cmd lcd_send_data for sending data with 4 numbers, so how to solve it

    • @ControllersTech
      @ControllersTech  4 роки тому

      U can't.. that function is used to send single character only.
      These displays only accept ascii and that's why qe need to convert the numbers to respective characters before sending them.

    • @anas.ghouila
      @anas.ghouila 3 роки тому

      @@ControllersTech I wanna display numbers what should i do? because i noticed that it displays always ascii

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

    Can we use keil IDE with cube mx

  • @MCircuits
    @MCircuits 5 років тому

    Why did u use TRUE STUDIO instead of KEIL Uvision 5 here? What is the difference?

    • @ControllersTech
      @ControllersTech  5 років тому

      There is no difference in the coding part. Truestudio is open source IDE. I no longer use keil or truestudio. From now on, only stm32cubeide, as it is officially supported by ST.

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

    The link to the lcd library is broken - it shows an encoding error in chrome and firefox - this is a great tutorial, just need the library link fixed!

  • @chungtran5000
    @chungtran5000 3 роки тому

    This video is verry good...Please tell me Which lcd did you use???
    Lcd 5v or lcd 3.3v thank you...

  • @OKOK-em4gb
    @OKOK-em4gb 4 роки тому

    Thank you for today.

  • @hussainkheti6096
    @hussainkheti6096 5 років тому

    Hello Controllers Tech Team,
    Your All Videos are very useful and knowledgeable means no time west in UA-cam.
    I Request to you can you make videos for IOT Protocol Link MQTT,COAP So its very much useful for us.
    And Ha Thank You For Making This Kind of Channel.

    • @ControllersTech
      @ControllersTech  5 років тому

      That's going to take some serious research. And right now i don't have time.

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

    If I want to use 8 bit mode, what will i need to change sir ?

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

      Do you know what's 8 bit mode ?

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

      @@ControllersTech Its 8 pin data so only need 1 pulse signal to display character , is it right sir ? However, i dont really know how to initialize character lcd in 8-bit mode. Could you teach me ?

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

      8 bit mode won't work with pcf8574 since it has only 4 data pins.
      If you want to do parallel connection, the initialization sequence is given in the lcd reference manual.

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

      @@ControllersTech Thank you for answering sir, really appreciated.

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

    It works fine but i have activated timer1,2,3,4,5 in input capture ch1 and output ch2,, when i connect the display it works but put me up on 3,3V all the timers output... how can i resolve?

  • @peterpanhelllojhon
    @peterpanhelllojhon 4 роки тому

    Do you have a pinout of the circuit?

    • @ControllersTech
      @ControllersTech  4 роки тому

      Pinout of what ?

    • @peterpanhelllojhon
      @peterpanhelllojhon 4 роки тому

      @@ControllersTech The connection of the circuit . Specifically the connection between the LCD and the STM.
      Also, I don't have a I2C device. Do you perhaps have a explanation of how to do this using 4 Bit mode?

    • @ControllersTech
      @ControllersTech  4 роки тому

      There is no direct connection between stm and lcd. It's connected via I2C.
      I don't have a video using 4 bit mode, but i have one for lcd 16x2. This also uses the same concept and almost the same code. You can compare the codes for both and make necessary changes for 20x4

  • @rabbitphluff
    @rabbitphluff 5 років тому

    Many thanks I get it now =)

  • @sagarvaghela5074
    @sagarvaghela5074 3 роки тому

    where is the link to download librery?

  • @nizarali3614
    @nizarali3614 4 роки тому

    I did every step as you did successful(build and debug) and I get empty LCD. I have tried address 0x4E and 0x27(it works for Arduino and pi), also I increased the delay before initialization and gitting the same result?

    • @ControllersTech
      @ControllersTech  4 роки тому +1

      Don't try with 0x27. Keep trying with 0x4E. Try connecting 4k7 pull up resistor to scl and sda lines

    • @nizarali3614
      @nizarali3614 4 роки тому

      @@ControllersTech no change sir

    • @ControllersTech
      @ControllersTech  4 роки тому +1

      How about contrast ? Try changing that.

    • @nizarali3614
      @nizarali3614 4 роки тому

      @@ControllersTech I do. Actually it works without i2c but i2c very important

    • @ControllersTech
      @ControllersTech  4 роки тому +1

      Try using address 0x7E..
      If doesn't work, telegram me @controllerstech

  • @babotvoj
    @babotvoj 4 роки тому

    for some reason I get this errors:
    LCD\LCD.axf: Error: L6218E: Undefined symbol lcd_init (referred from main.o).
    LCD\LCD.axf: Error: L6218E: Undefined symbol lcd_send_cmd (referred from main.o).
    LCD\LCD.axf: Error: L6218E: Undefined symbol lcd_send_string (referred from main.o).
    Do you know what it could be?

    • @ControllersTech
      @ControllersTech  4 роки тому

      Did u include the file in the main.c file..

    • @babotvoj
      @babotvoj 4 роки тому

      @@ControllersTech yes, but it did not appear on the side folder bar, I switched from Keil to CubeIDE and it worked, I don't know why

    • @ControllersTech
      @ControllersTech  4 роки тому

      In keil, you need to include the path of the library file also, somewhere in the settings.

    • @brendanrichart4804
      @brendanrichart4804 4 роки тому

      @@ControllersTech where did you get the i2c-lcd library? The one that I used from the LCD 2004a video you made doesn't include lcd_put_cur function. THanks!

    • @ControllersTech
      @ControllersTech  4 роки тому

      I wrote the library myself

  • @MayurJadhav-q5l
    @MayurJadhav-q5l Рік тому

    pls share i2c-lcd.c and i2c-lcd.h file link .

  • @mohdtanveer9552
    @mohdtanveer9552 5 років тому +2

    Hi Cotrollers Tech,
    Your videos are always amazing.
    Could you please make a video on how to interface SSD1963 LCD Controller with STM32F220-G EVAL Board (STM32F207/407 microcontroller)?
    Thank you

    • @ControllersTech
      @ControllersTech  5 років тому

      I don't have the lcd for ssd1963 yet but i am planning to buy it as I have the f407 supporting board. Right now i am working on ILI9341 though. Once it is complete maybe you can refer it for your device

    • @mohdtanveer9552
      @mohdtanveer9552 5 років тому

      Hi,
      Thank you for your valuable reply.
      I will wait for you to buy and make video on ssd1963 LCD controller.
      Again appreciate your efforts and keep sharing the vast knowledge you have with us.
      Thank you so much!!

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

      @@ControllersTech Hi Sir, your video are always very good. May you can the solution my issue: i am using a 2x16 LCD with STM32-F401RE board. On the arduino i have no issue to scann adress of LCD and to see some word but when i connect LCD to nucleo board i only see the ligth and nothing else. I tried to use scann program but nothing, i tried to use all the SCL and SDA pin on nucleo board but nothing. It is possible that this board is not support theìhis LCD? I see many tutorial on you tube and in all of them the lcd is working but on my system no. I am making crazy....

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

      If you are using I2C, the use the address 0x4E or 0x7E.
      The stm Controllers generally have more than one I2C, so If you are using I2C1 then use the corect pins.
      Also there is no such thing as board not supporting lcd. The lcd works with I2C and as long as board has it, it will work as well.

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

      @@ControllersTech i tried all I2C on my board with their pin, i tried both address 0x4E and 0x7E and i tried also all the SDA/SCL pin but nothing , nothing