Interface LCD 1602 with STM32 || Parallel Connection || 4 bit mode || noI2C

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ค. 2024
  • Purchase the Products shown in this video from :: controllerstech.store
    ________________________________________________________________________________________
    To download the code goto controllerstech.com/interface...
    The files LCD1602.h, and LCD1602.c can be found inside the code itself.
    Check out more VIDEOS on MODULES/SENSORS with STM32 • STM32 and SENSORS/MODULES
    ________________________________________________________________________________________
    ****** SUPPORT US BY DONATING*****
    paypal.me/controllertech
    ******Join the Membership******
    / @controllerstech
    Join the Discord Server / discord
    Join the Telegram Group t.me/controllerstechdiscuss
    Follow me on Instagram / controllerstech
    For more info, visit www.controllerstech.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 94

  • @remontlive
    @remontlive 4 ปีที่แล้ว +3

    Absolutely works! Changed pins, and work at once without errors!

  • @onurolce
    @onurolce 4 ปีที่แล้ว +4

    Helpful video as always :)

  • @namvu2525
    @namvu2525 2 ปีที่แล้ว

    You saved my life, thank you very much online stranger.

  • @michaelzlprime
    @michaelzlprime 3 ปีที่แล้ว

    Thank you so much!!!
    I got my nucleo to run the arduino lcd shield

  • @richarddavidson3999
    @richarddavidson3999 4 ปีที่แล้ว

    Well Done! Nice and complete.

  • @ianlesnianski2027
    @ianlesnianski2027 4 ปีที่แล้ว

    Great video, thanks for the information

  • @parsafaraj8580
    @parsafaraj8580 2 ปีที่แล้ว +1

    Hello, would you tell me how can I download the library of the project I didn't find it on your website!

  • @eduardodelarosaferrer2205
    @eduardodelarosaferrer2205 4 ปีที่แล้ว

    YOU are perfect as usual

  • @rajgunaseelan44
    @rajgunaseelan44 3 ปีที่แล้ว

    Thank you for all your great tutorials.
    How do you control the LCD contrast? I don't see any potentiometer on your breadboard. Is there an other way?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      I didn't controlled the contrast in that. Just connected the pin to 3.3v. I don't use the lcd without i2c. This setup was just done for the video

    • @rajgunaseelan44
      @rajgunaseelan44 3 ปีที่แล้ว

      @@ControllersTech Thanks for the quick reply:)

  • @bahadrguven6268
    @bahadrguven6268 2 ปีที่แล้ว

    Hi
    I'am confused.Bit DB7 of DDRAM is HIGH.That is hex 0x80 but DDRAM adress is 0x00 to 0x4F. Is this possible?

  • @ferdinvivian9336
    @ferdinvivian9336 2 ปีที่แล้ว

    Can I use this for 16x4 lcd display,, plz reply

  • @ControllersTech
    @ControllersTech  3 ปีที่แล้ว +2

    The blank screen might be due to the delay issue. Here is what you can do
    Put the code below in the LCD.c file
    1. static uint32_t DWT_Delay_Init(void)
    {
    CoreDebug->DEMCR &= ~CoreDebug_DEMCR_TRCENA_Msk;
    CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
    DWT->CTRL &= ~DWT_CTRL_CYCCNTENA_Msk;
    DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
    DWT->CYCCNT = 0;
    __NOP();
    __NOP();
    __NOP();
    if(DWT->CYCCNT)
    {
    return 0;
    }
    else
    {
    return 1;
    }
    }
    void DWT_Delay_us(volatile uint32_t usec)
    {
    uint32_t clk_cycle_start = DWT->CYCCNT;
    usec *= (HAL_RCC_GetHCLKFreq() / 1000000);
    while ((DWT->CYCCNT - clk_cycle_start) < usec);
    }
    2. Initialise the DWT in the starting inside the LCD_Init function
    DWT_Delay_Init();
    3. Now use DWT_Delay_us (time) ads the delay instead of the timer delay

  • @piotrkuczek6831
    @piotrkuczek6831 ปีที่แล้ว

    Jan 2023 - it still works

  • @veoazul
    @veoazul 4 ปีที่แล้ว

    gracias desde colombia , greate job!!

  • @grossethomas2256
    @grossethomas2256 2 ปีที่แล้ว

    Hello,
    I want to realize a project with FreeRTOS and multi tasking. I guees there will be some adaptations to make it non-blocking (non-blocking delays). Any advices on how to do it (for example can I use it with I2C without any difficulties?).
    I'm a newbie with STM, thanks for your answer.

    • @ControllersTech
      @ControllersTech  2 ปีที่แล้ว

      Yes you can use i2c. Check another video for i2c and lcd

  • @tarsis6669
    @tarsis6669 4 ปีที่แล้ว

    My maximum HCLK is 48 MHz so i tried some differents prescalers in the timer 1, and i remove the delay from send_to_display function. I also connected the RW pin in the GND. But doens´t work, do you know what could be? I am using a SRM32f072B Discovery board. Thanks.

    • @ControllersTech
      @ControllersTech  4 ปีที่แล้ว +1

      Don't mess with prescalars. The purpose is to create delay in microsecond. First check what's the apb clock for the timer, that u are using.
      Let's say it 48, than use prescalar as 47.
      Also for 48 MHz hclk you don't need the delay. It will work without delay, although just introduce small delay in case of errors

    • @grossethomas2256
      @grossethomas2256 2 ปีที่แล้ว

      Hi man, i got the same issue as you here. I use the same board and still getting a blank screen but I don't find the solution. Did you managed to make it working ?
      Thanks

  • @vedattilgen1765
    @vedattilgen1765 ปีที่แล้ว

    you are king of stm on the toutube thank you and ı so like your site;
    thanks sir thanks

  • @empireearth2716
    @empireearth2716 2 ปีที่แล้ว

    Thanks You! One question, if I would like to print a variable, how can I do?

  • @tomasantoniovelasquez4281
    @tomasantoniovelasquez4281 4 ปีที่แล้ว

    Hello i am trying to follow your tutorial but i can´t get it to work. The screen turns on , but all that appears are black rectangles, as if all the lcd matrix was turned on at the same time.
    1st question: In the code there is no reference to RW at all, it gets defined but you never set a value to it, ¿Does this matter?
    2nd question: If the max clock speed of my microcontroller is 80Mhz and it runs at that speed in default, then there is no need to activate the ceramic clock, ¿Right?. I am just using the internal clock with a prescaler of 80-1.
    3rd question: My LCD is a GDM 1602K, and in the datasheet it seems all the commands work exactly the same, but there is no reference to the initialization procedure, ¿Should i use the same one as you do?
    If you have any clue about what my problem could be, i would be more than greatfull.

    • @ControllersTech
      @ControllersTech  4 ปีที่แล้ว +1

      1. The RW pin should be low for the write operations. So just connect it to the ground
      2. You might need the microsecond delay. But if you don't know how to work with it, you can reduce the HCLK to 50 or something, and than just use the code simply without delay
      3. All 1602 works with the same initialisation
      You might want to reduce the contrast if you are seeing the black boxes.

    • @tomasantoniovelasquez4281
      @tomasantoniovelasquez4281 4 ปีที่แล้ว

      @@ControllersTech I will connect RW to ground, I forgot to mention that between all the black boxes there was half a second where i could see half a number form on the screen, so i dont think it is the contrast

    • @ControllersTech
      @ControllersTech  4 ปีที่แล้ว +1

      Ok.. it must be the timing than.
      Either create that microsecond delay, and use it where I have commented it out.
      Or reduce the HCLK to 50 MHz or so

    • @tomasantoniovelasquez4281
      @tomasantoniovelasquez4281 4 ปีที่แล้ว

      @UCkdqtSMnhYuMsJkyHOxiPZQ I will try reducing the clock speed to 50mhz to see if timing is the problem

    • @shrijithmjain2137
      @shrijithmjain2137 3 ปีที่แล้ว

      @@ControllersTech I'm too facing the same problem, Rectangle boxes even after changing HCLK delay.......is there anything else I should do to make it work?

  • @GameZ911
    @GameZ911 7 หลายเดือนก่อน +1

    Hi, I have a question, how can i continue printing automatically in the 2nd row without call lcd_put_cur(), if the word's lenght is more than 16 characters?

    • @ControllersTech
      @ControllersTech  7 หลายเดือนก่อน

      You can write another function for it. Inside that function, check how many charatcters has been written. Once the number crosses 16, call the lcd_put_cur to put the curser in the second row.

  • @namrathasingh9502
    @namrathasingh9502 3 ปีที่แล้ว

    Can we use the same code in the keil software. Will it work like using STM32 Cube IDE for pin configuration and the code in the keil software that you explained here. Will it work?

  • @prashantwaiba2290
    @prashantwaiba2290 2 ปีที่แล้ว

    Thank you sir for the wonderful tutorial. Can you make a video on Devanagari display in same set up?

    • @ControllersTech
      @ControllersTech  2 ปีที่แล้ว +1

      You need to use the custom characters and design the entire script yourself.
      I will do a video on custom characters soon, but don't expect me to design the entire varnmala.

    • @rashmi6488
      @rashmi6488 ปีที่แล้ว

      @@ControllersTech 😅

  • @waqasahmad5733
    @waqasahmad5733 3 ปีที่แล้ว

    nice and great video

  • @devilmarshadow6916
    @devilmarshadow6916 3 ปีที่แล้ว

    I'm using a NUCLEO-F446RE but it doesn't work, the LCD lights up but it doesn't write. the Clock is 84MHz so i'm using a prescaler of 83, I also chaged the pins, i'm using PB8-PB9-PB10-PB12-PB13-PB14-PB15. Can you hel me?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      well i have 446RE and it works pretty well. SOMETHING WRONG FROM YOUR END

  • @shrijithmjain2137
    @shrijithmjain2137 3 ปีที่แล้ว +1

    hello, your videos are been a gem to us, I tried the same code but I'm just getting blank screen

  • @remontlive
    @remontlive 4 ปีที่แล้ว

    Thank you

  • @alifirdaus5565
    @alifirdaus5565 3 ปีที่แล้ว

    I have some warning in code row 44 to 58 "enumerated type mixed with another type", how fix it?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      need more info. What's in those lines ?

    • @alifirdaus5565
      @alifirdaus5565 3 ปีที่แล้ว

      @@ControllersTech sorry, that warning from my compiler (keil), what compiler do u use?

  • @soranfatah1033
    @soranfatah1033 3 ปีที่แล้ว

    Thanks for you great best..that very useful totuirial ..the LCD work on 3.3 volt or 5 volt power supply.??

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      5v

    • @soranfatah1033
      @soranfatah1033 3 ปีที่แล้ว

      @@ControllersTech this code can use with STML xxxx ?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Yeah why not..

    • @soranfatah1033
      @soranfatah1033 3 ปีที่แล้ว

      That good..because we use ATM32L ultra low power sreies....thanks so much for your reply..

  • @scottste7851
    @scottste7851 2 ปีที่แล้ว

    I am a beginner in stm32 and using F303RE. Do I change include to my specific board, referring to stm32f1xx_hal.h? keep getting "unresolved inculsion"

  • @andreaditya9620
    @andreaditya9620 3 ปีที่แล้ว

    Gan agar bisa berjalan text nya gimana (running text)

  • @odionsireboy8690
    @odionsireboy8690 6 หลายเดือนก่อน

    Grounding the rw pin means only write! Is this correct?

    • @ControllersTech
      @ControllersTech  6 หลายเดือนก่อน

      Yes

    • @odionsireboy8690
      @odionsireboy8690 6 หลายเดือนก่อน

      I’ve not been able to write on my 1602 lcd. I followed the tutorial but no luck.

  • @te1760
    @te1760 3 ปีที่แล้ว

    hi,i use stm32f4 discovery and just light up,no letters or numbers at screen etc. apb2 bus 168Mhz, so i made it "168-1" ,presecaler is "0xffff-1".Other things same. I increased microsecond value step step such as 0,,20,50,80,130.. what should i do,any offer for me? thanks in advance

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Try reducing your clock below 72 MHz and don't use any delay and check..

    • @te1760
      @te1760 3 ปีที่แล้ว

      you mean "void send_to_lcd (char data, int rs)" that function delays right? i made clock bus 42Mhz and close delays in this function
      but still just light on. no letters and numbers

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      read the pinned comment..
      or contact on discord

    • @te1760
      @te1760 3 ปีที่แล้ว

      @@ControllersTech i read but no solution. and i wrote stm32f4 channel on discord

  • @ratulkundu5788
    @ratulkundu5788 3 ปีที่แล้ว

    If i want to make a digital clock in lcd how can i do it?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      th-cam.com/video/LBD7noDBnlc/w-d-xo.html

  • @baovuquoc4449
    @baovuquoc4449 3 หลายเดือนก่อน

    hello . your video is great. but can you give me lirbary of lcd as video

  • @safiakhan2034
    @safiakhan2034 4 ปีที่แล้ว

    whare are lcd.h and lcd.c files ( libraries files )

    • @ControllersTech
      @ControllersTech  4 ปีที่แล้ว

      Download the code from the link in the description

  • @crb1crb239
    @crb1crb239 3 ปีที่แล้ว

    Thank you for this ...your videos are very helpful . i am having difficulty passing numeric values. Kindly advise. i tried sprintf to char array variable , but no success. kindly provide sample code to display integer variable e.g 1234. thank you.

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Char num_arr[4];
      Uint16_t num = 1234;
      Sprintf (num_arr, "%u", num);
      That's all. If it gives error with %u, try changing uint16_t to unsigned int..

  • @OKOK-em4gb
    @OKOK-em4gb 3 ปีที่แล้ว

    Hello
    In 100,000 units, less than 1 is displayed as zero, and how do I make zero invisible?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      I don't understand what you are asking..
      Plz explain

    • @OKOK-em4gb
      @OKOK-em4gb 3 ปีที่แล้ว

      @@ControllersTech Decimal Display 000100 > 100 , 000123 > 123

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      So you want to display 000100 as 100 ?
      Or as 000100?

    • @OKOK-em4gb
      @OKOK-em4gb 3 ปีที่แล้ว

      @@ControllersTech Yes, that's right.
      Please tell me how to mark 000100 as 100.

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +1

      You can use typecast to conver it to integer.. so it will convert to 100..
      Or use some do while loop to check until the first number, other than 0 arrives. Then save the rest of the data into the buffer

  • @anshbhatnagar557
    @anshbhatnagar557 3 ปีที่แล้ว

    Hello sir,
    I flash the same code in my lcd with stm32f103 the only difference that i have was pin use insist of PA4-PA7 i am using PA0-PA3 so i change configuration of lcd data and lcd cmd but that didn't work i use (cmd&0xf0)right shift 4 . please suggest what possible error i am doing

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      You can't use PA0 to PA3. In 4 bit mode, you have to use the pins 4 to 7.
      Please read the datasheet before experimenting..
      You can use 8 bit mode and use all the pins(0 to 7).

    • @anshbhatnagar557
      @anshbhatnagar557 3 ปีที่แล้ว

      Hi, i am not saying about the lcd pin i am talking about port pinof stm32f103

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Oh my bad.
      Don't change command.. just define new pins and leave everything as it is

    • @anshbhatnagar557
      @anshbhatnagar557 3 ปีที่แล้ว

      but you have taken pa4-pa7 data pin and i have pa0-pa3 as my data pins so does we need to changes for the nibbles in cmd and data

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      No. The code is written to take take of individual pins. Also that's the point of defining them in the beginning, so that we don't have to deal with them afterwards

  • @fugitive6549
    @fugitive6549 2 ปีที่แล้ว +1

    Where are all my fellow students from Stellenbosch university watching this for E-deign? 😂😂

    • @nicomartin5584
      @nicomartin5584 19 วันที่ผ่านมา +1

      Right here👋
      Got any tips? Send code😭😭

    • @fugitive6549
      @fugitive6549 16 วันที่ผ่านมา

      hey, I'm back at it again. @@nicomartin5584

  • @kefren1330
    @kefren1330 2 ปีที่แล้ว

    how to dark theme

    • @ControllersTech
      @ControllersTech  2 ปีที่แล้ว

      Get the darkest dark theme from eclipse marketplace

  • @Ray-ej3jb
    @Ray-ej3jb 7 หลายเดือนก่อน

    Noooooooo AI speak