Тёмный

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

ControllersTech
Подписаться 39 тыс.
Просмотров 54 тыс.
50% 1

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

Наука

Опубликовано:

 

15 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 94   
@remontlive
@remontlive 4 года назад
Absolutely works! Changed pins, and work at once without errors!
@onurolce
@onurolce 4 года назад
Helpful video as always :)
@namvu2525
@namvu2525 2 года назад
You saved my life, thank you very much online stranger.
@richarddavidson3999
@richarddavidson3999 4 года назад
Well Done! Nice and complete.
@michaelzlprime
@michaelzlprime 4 года назад
Thank you so much!!! I got my nucleo to run the arduino lcd shield
@ianlesnianski2027
@ianlesnianski2027 4 года назад
Great video, thanks for the information
@eduardodelarosaferrer2205
@eduardodelarosaferrer2205 4 года назад
YOU are perfect as usual
@veoazul
@veoazul 4 года назад
gracias desde colombia , greate job!!
@vedattilgen1765
@vedattilgen1765 Год назад
you are king of stm on the toutube thank you and ı so like your site; thanks sir thanks
@waqasahmad5733
@waqasahmad5733 3 года назад
nice and great video
@piotrkuczek6831
@piotrkuczek6831 Год назад
Jan 2023 - it still works
@remontlive
@remontlive 4 года назад
Thank you
@parsafaraj8580
@parsafaraj8580 2 года назад
Hello, would you tell me how can I download the library of the project I didn't find it on your website!
@shrijithmjain2137
@shrijithmjain2137 3 года назад
hello, your videos are been a gem to us, I tried the same code but I'm just getting blank screen
@dzikrurrohmani7073
@dzikrurrohmani7073 3 года назад
yeah me too.
@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 года назад
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 😅
@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?
@rajgunaseelan44
@rajgunaseelan44 4 года назад
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 4 года назад
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 4 года назад
@@ControllersTech Thanks for the quick reply:)
@ferdinvivian9336
@ferdinvivian9336 3 года назад
Can I use this for 16x4 lcd display,, plz reply
@empireearth2716
@empireearth2716 3 года назад
Thanks You! One question, if I would like to print a variable, how can I do?
@ControllersTech
@ControllersTech 2 года назад
By converting it to character
@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
@GameZ911
@GameZ911 9 месяцев назад
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 9 месяцев назад
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.
@andreaditya9620
@andreaditya9620 3 года назад
Gan agar bisa berjalan text nya gimana (running text)
@ControllersTech
@ControllersTech 3 года назад
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
@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 года назад
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
@soranfatah1033
@soranfatah1033 4 года назад
Thanks for you great best..that very useful totuirial ..the LCD work on 3.3 volt or 5 volt power supply.??
@ControllersTech
@ControllersTech 4 года назад
5v
@soranfatah1033
@soranfatah1033 4 года назад
@@ControllersTech this code can use with STML xxxx ?
@ControllersTech
@ControllersTech 4 года назад
Yeah why not..
@soranfatah1033
@soranfatah1033 4 года назад
That good..because we use ATM32L ultra low power sreies....thanks so much for your reply..
@namrathasingh9502
@namrathasingh9502 4 года назад
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?
@ControllersTech
@ControllersTech 4 года назад
Yeah it can work with any ide..
@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
@alifirdaus5565
@alifirdaus5565 4 года назад
I have some warning in code row 44 to 58 "enumerated type mixed with another type", how fix it?
@ControllersTech
@ControllersTech 4 года назад
need more info. What's in those lines ?
@alifirdaus5565
@alifirdaus5565 4 года назад
@@ControllersTech sorry, that warning from my compiler (keil), what compiler do u use?
@baovuquoc4449
@baovuquoc4449 6 месяцев назад
hello . your video is great. but can you give me lirbary of lcd as video
@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..
@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. 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 года назад
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?
@ratulkundu5788
@ratulkundu5788 3 года назад
If i want to make a digital clock in lcd how can i do it?
@ControllersTech
@ControllersTech 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-LBD7noDBnlc.html
@fugitive6549
@fugitive6549 2 года назад
Where are all my fellow students from Stellenbosch university watching this for E-deign? 😂😂
@nicomartin5584
@nicomartin5584 2 месяца назад
Right here👋 Got any tips? Send code😭😭
@fugitive6549
@fugitive6549 2 месяца назад
hey, I'm back at it again. @@nicomartin5584
@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 года назад
read the pinned comment.. or contact on discord
@te1760
@te1760 3 года назад
@@ControllersTech i read but no solution. and i wrote stm32f4 channel on discord
@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
@odionsireboy8690
@odionsireboy8690 8 месяцев назад
Grounding the rw pin means only write! Is this correct?
@ControllersTech
@ControllersTech 8 месяцев назад
Yes
@odionsireboy8690
@odionsireboy8690 8 месяцев назад
I’ve not been able to write on my 1602 lcd. I followed the tutorial but no luck.
@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 года назад
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 года назад
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 года назад
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
@kefren1330
@kefren1330 2 года назад
how to dark theme
@ControllersTech
@ControllersTech 2 года назад
Get the darkest dark theme from eclipse marketplace
@Ray-ej3jb
@Ray-ej3jb 9 месяцев назад
Noooooooo AI speak
@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"
@ControllersTech
@ControllersTech 2 года назад
Yes change it to f3xx_hal.h
Далее
DS3231 RTC Module and STM32 || cubeide || I2C-LCD
18:17
Datasheets: 16x2 LCD By Hand (No microcontroller)
26:35
My Puzzle Robot is 200x Faster Than a Human
21:21
Просмотров 8 млн
STM32 ADC MULTI CHANNEL without DMA || HAL || Poll
9:22
LCD via I2C in STM32 || CUBEIDE || PCF8574
12:22
Просмотров 77 тыс.
SSD1306 OLED and STM32 || 128x64 || SW4STM || CubeMX
14:22
Interface LCD Display 16×2 with Stm32
19:54
Просмотров 15 тыс.
Colorful Vulcan w rtx 4070ti Super
13:30
Просмотров 54 тыс.
Choose a phone for your mom
0:20
Просмотров 7 млн