Тёмный

STM32F4 Discovery board - Keil 5 IDE with CubeMX: Tutorial 11 LCD16x2 - Updated Dec 2017 

Mutex Embedded
Подписаться 22 тыс.
Просмотров 52 тыс.
50% 1

This tutorial shows you how to use the LCD1602 with STM32 boards using HAL libraries.
Here is a link for the LCD library files (.h & .c files):
drive.google.com/open?id=1d1N...

Наука

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

 

3 дек 2017

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 254   
@boratsagdiyev3936
@boratsagdiyev3936 5 лет назад
Very good library. Managed to print text onto LCD with great success. Thanks Mohammed.
@bruno6613073
@bruno6613073 5 лет назад
Worked on my F303 from the first try. Thanks Mohamed for this awesome library!
@ashvajitprasad8300
@ashvajitprasad8300 4 года назад
Mine is not working with same board . Anything else you did other than renaming stm32f3xx_hal header ? working with lcd rg1602
@jenniferdsilva2161
@jenniferdsilva2161 4 года назад
Hi even it did not worked for me.
@SalarAzad
@SalarAzad 4 года назад
Perfect explanation, worked like a charm, thank you!
@jenniferdsilva2161
@jenniferdsilva2161 4 года назад
Hi ,can I get the project which worked?
@mikov36
@mikov36 4 года назад
Thank you, was a bit harder to do in microvision without HAL, so I had to initialize all the ports and do a lot of makros but this helped!!!
@chriskosik663
@chriskosik663 5 лет назад
Excellent tutorial. Learned a lot!
@mahdiheydari39
@mahdiheydari39 5 лет назад
hi,thank u sooooooooooooooooooooooooooo much .please continue these education.ur prespectives are admirable.thank u again.
@mutexembedded2206
@mutexembedded2206 5 лет назад
Thanks Mahdi
@bahadrahmetulas7129
@bahadrahmetulas7129 4 года назад
Thank you so much for this explain video. It has been so understandable.
@abdulkadiratik5168
@abdulkadiratik5168 3 года назад
Nasıl yaptın?
@abdulsamettutus1621
@abdulsamettutus1621 6 лет назад
perfect man :) hello in TURKEY :)
@oonnly
@oonnly 6 лет назад
Works with STM32F030R8, thanks for sharing.
@oonnly
@oonnly 6 лет назад
There is one problem, can't print float numbers. Print int works fine, any suggestions?
@maulanafalithurrahman8197
@maulanafalithurrahman8197 6 лет назад
hi, i'm using stm32f103c8t6 in HAL library. I generate the initialization with stm32cubemx and import your lcd library to my project. it built successfully without any error. when i upload the program it showed nothing, do you have any idea what could've been wrong? thanks before
@mertdogan5667
@mertdogan5667 5 лет назад
Thanks succesfully print text to LCD.
@mitharaj8654
@mitharaj8654 6 лет назад
Your video is very helpful sir. Can you upload a video on interfacing mysql database with stm32f4 so that we will get an idea on how to interface with databases. Thankyou in advance.
@hamidsaeedi2721
@hamidsaeedi2721 3 года назад
دمت گرم(In Persian) Thank you very very much
@mutexembedded2206
@mutexembedded2206 3 года назад
:)
@ElectricMilesLLC
@ElectricMilesLLC 4 года назад
Is there a reason you changed the clock from 16 to 168 MHzMine has a bunch of circles on the screen then when i press the black button on my Nucleo stm32 f466re. It turns into a bunch of strange characters / symbols on the screen.
@AbuSous2000PR
@AbuSous2000PR 6 лет назад
excellent videos Any plan to make a series and evalution of ESP32? I would love to hear your thoughts cheers
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hala Abo Al-Sous Not sure if I will make some on ESP32 :))
@LUGSK
@LUGSK 5 лет назад
Hello, thank you for the good tutorial! I have got nucleo f070rb and everything works fine except displaying float numbers. Any idea? Tks.
@mhand8560
@mhand8560 4 года назад
i am using Nucleo-l053r8 , i have changed the #include from the driver file linked on this video from stm32f0xxx to stm32l0xx , got rid of the error but the lcd does not work, can you help ?
@3836mert
@3836mert 6 лет назад
Mate you know what? I love you!!!
@mutexembedded2206
@mutexembedded2206 6 лет назад
Haha, thanks!
@Channel-bx2fk
@Channel-bx2fk 6 лет назад
Hi, thank you for the good video and explanation! Unfortunately I did all the same as you,but my lcd won't print anything. I use the same discovery board and lcd as you. Any suggestions would be appreciated, thank you in advance :)
@mattiasaccaggi8670
@mattiasaccaggi8670 6 лет назад
hello , I have done the same thing which is showed in the video and the connections , but I am not getting the data on lcd. i used 8bit operation and my board is 'STM32F401C DISCO'.
@ufukgenc8796
@ufukgenc8796 5 лет назад
What kind of changes do I need to make if I want to use Port E Pin
@thirdparty8732
@thirdparty8732 6 лет назад
Hello Sir I want to know that whether we can delay in STM32f407vg less than 1millisec i-e of 1microsec or of 1 nanosec using HAL_Delay not by for loop. As we know HAL_Delay(1) means 1millisec. But Sir I have to produce a delay with extreme accuracy of 1nanosec. I am using HAL_Delay for accuracy purposes. Sir if there is any other method, then kindly share your thoughts. I'll be very grateful for this.
@Graham1904
@Graham1904 4 года назад
Surely for 4-bit mode you can't simply delete D0-D3? Is there no Init4bit () command?
@mahdighassab9749
@mahdighassab9749 4 года назад
thank you,i have a problem,can i use this library for stm32f1xx ?
@mehmetkazakli956
@mehmetkazakli956 4 года назад
Hi, can i use this library for any other STM32 microcontroler series ? for example STM32F3 series. I changed #include "stm32f3xx_hall.h" but did not work. Any suggestion ?
@gerhardmalberg4966
@gerhardmalberg4966 4 года назад
What do I have to change to use this library with 20x4 LCD display? Or can I just set cursor in "extended address" and write there?
@salimbouhafs7753
@salimbouhafs7753 4 года назад
I have the same problem, did you find the solution ?
@blogit1000
@blogit1000 4 года назад
for some reason it works if i use the same pin shown at the video, but when i try change the pin (still gpio output) it display nothing. also sometime it display words that i cant understand (random character). please any explanation?
@atefbenattia913
@atefbenattia913 5 лет назад
Hello, I can't export the file .h how can I solve this? thank you
@youcefkhalilmoharem2343
@youcefkhalilmoharem2343 6 лет назад
Thanks a lot bro. Just a question : I want to use the same library for a 20x4 LCD module (2004A). To do so, I had the idea of modifying the function "LCD1602_setCursor" in the file "STM_MY_LCD_16x2.c", but I didn't know what values the variable "maskData" should have in the if/else conditions. Any Idea ? Thanks in advance.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi Youcef, According to some LCD 20x4 from Github, the Set cursor offsets should be as follows: #define LCD_OFFSET_LINE0 0x0 #define LCD_OFFSET_LINE1 0x40 #define LCD_OFFSET_LINE2 0x14 #define LCD_OFFSET_LINE3 0x54 void lcd_move_cursor(const uint8_t line, const uint8_t position) { uint8_t command = LCD_SET_DDADR + position; switch(line) { case 0: command += LCD_OFFSET_LINE0; break; case 1: command += LCD_OFFSET_LINE1; break; case 2: command += LCD_OFFSET_LINE2; break; case 3: command += LCD_OFFSET_LINE3; break; default: // Wrong line return; } I will consider expanding this library to include larger LCD sizes. Good luck
@wajdisanchou
@wajdisanchou 5 лет назад
@@mutexembedded2206 but "LCD_SET_DDADR" is signed as : undeclared identifier
@cprscalper
@cprscalper 4 года назад
Where can I find the lcd driver. Files stm_my_lcd.c and .h file.could u please share me the link
@manofmesopotamia7602
@manofmesopotamia7602 4 года назад
could we modify the library to work on stm32f103c8? thankx
@mohammadreza9531
@mohammadreza9531 6 лет назад
Dose your Library support custom character?
@mutexembedded2206
@mutexembedded2206 6 лет назад
M.R.F Iran Nope
@TA1FMY
@TA1FMY 4 года назад
i have tried change to 20x4 lcd screen, but I can not do that. can u help me?
@swathip1461
@swathip1461 3 года назад
Sir, could you tell me how to create a millis() function in stm32 like in arduino?
@maco11100
@maco11100 5 лет назад
Hi, ] How would I do this with a 4 line LCD?
@wajdisanchou
@wajdisanchou 5 лет назад
same prob
@abhijeet6989
@abhijeet6989 4 года назад
how to used the stm32 cryptographic library or PBC cryptographic library in STM32F4DISCOVERY?
@maticursic9431
@maticursic9431 4 года назад
Hello, I have the error in c. file, line 111: RCC->APB1ENR |= RCC_APB1ENR_TIM3EN; I am using STM32L476RG and don't know what to do. Thanks in advance!
@mpumelelokhoza581
@mpumelelokhoza581 4 года назад
hi I am using stm32cubeide, when I added this two I am getting an error on "#include " file Print.h: No such file or directory can you please help to resolve it
@mdhebling
@mdhebling 4 года назад
Hello Mohamed, your video is very helpful, thanks for share your know-how. Would I to know how to write more than one character in the same line using your library for LCD 16x2? I'm waiting your answer, thanks.
@mhand8560
@mhand8560 4 года назад
hi, i am trying to use your tutorial on the Nucleo-l053r8 BOARD, does it work ?
@MrHause13
@MrHause13 4 года назад
It should work on the all stm32 boards. It's not up of the stm32 microcontroler but it's up to the type of LCD controller. But i think with other controller like HD44780 should it also work.
@sureshp632
@sureshp632 4 года назад
can use this code for stm32401re nucleo boards
@manofmesopotamia7602
@manofmesopotamia7602 4 года назад
could you make a video on lcd2004 display using i2c?
@excalibur1716
@excalibur1716 5 лет назад
ty man this is very nice but i have changed the pins and this hasnt worked well what is going on? and; if somebody encounter that "error: L6236E: No section matches selector - no section to be FIRST/LAST." just close program and run again it will work
@kionmahuermicio9860
@kionmahuermicio9860 4 года назад
Very Well, but i would like you to explain how to use the LCD without your libraries, how to create our own code. Cheers!!
@komalpatil7004
@komalpatil7004 6 лет назад
hello sir, I have done the same thing which is showed in the video and the connections are Vss-> GND, Vdd-> 5v, V0-> 10K potentiometer , RS->PE0, RW-> GND, E-> PE1, D0-D3 -> no connection, D4-D7 -> PD8-PD11, A->5v, k->GND. But I am not getting the data on lcd.
@karimouaghlani1264
@karimouaghlani1264 6 лет назад
the same for me if you find the solution please answer me
@furkanayas9007
@furkanayas9007 3 года назад
It didn't work on F051R8 discovery. Just a screen and brightness works, they directly belongs voltage. I tried only 4 bits way, i check everything, couldn't find a solution
@Lecram066
@Lecram066 6 лет назад
MohamedYaqoobSTM, i like your chanel!!! Can you make a video about OLED displays (128x64 with I2C). Are you working on hardware too, or just on software?
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi Marcel, You've got to do both in Embedded systems, so yeah Hardware and Software. Cheers
@faikkemalylmaz7894
@faikkemalylmaz7894 5 лет назад
Camila Obando It shows: Programming Done. Verify OK. But nothing is shown on my LCD after programming, everything is connected as supposed, what could be wrong? HELP, please!
@deatharmy3684
@deatharmy3684 5 лет назад
Same issue. Did you solved your problem?
@scart07
@scart07 6 лет назад
muchas gracias! muito obrigado!! Thanks!! working in my blue pill! stm32f103c8, must to be careful in change in the STM_MY_LCD16X2.h file the line #include "stm32f4xx_hal.h" to #include "stm32f1xx_hal.h"
@alaeddinebakkay7556
@alaeddinebakkay7556 5 лет назад
Hi Mohamed how are u ?, i wish that u make a video about how to program the LTDC of the stm32f429i-disco
@chaitanyakalyani6341
@chaitanyakalyani6341 5 лет назад
Hello Sir I am using Proteus for simulation and STM32F103R6 IC. I have connected everything but not getting any output on LCD. Is it any problem with timer or what. Thanks in advance.
@mutexembedded2206
@mutexembedded2206 5 лет назад
Sure, i will give you a quick fix soon
@colinthomas805
@colinthomas805 4 года назад
This may be naive but is there a reason you initialized a new timer (TIM3) instead of just using HAL_Delay? Thanks
@mutexembedded2206
@mutexembedded2206 4 года назад
That was to follow datasheet guidelines strictly of Microsecond delay. But you're right in some sense that we can do a Microsecond delay with a different much easier way. I will update this driver shortly to fix this
@colinthomas805
@colinthomas805 4 года назад
@@mutexembedded2206 The way you did it was probably more professional. I'm glad I got to see an example of creating a custom timer anyway. Thanks!
@camilaalejandraobando5585
@camilaalejandraobando5585 5 лет назад
It shows: Programming Done. Verify OK. But nothing is shown on my LCD after programming, everything is connected as supposed, what could be wrong? HELP, please!
@borakilerci1299
@borakilerci1299 5 лет назад
The same problem is in my project also. What can we do for solution Muhammed? Is 5V LCD's capable to work with 3.3V logic level controllers? Did you use special display or regular display?
@mutexembedded2206
@mutexembedded2206 5 лет назад
I will re-do this tutorial with an I2C LCD 16x2 display.
@jenniferdsilva2161
@jenniferdsilva2161 4 года назад
Hi Sir, Can i get the source code for this project? LCD is not displaying the text. Kindly help
@mutexembedded2206
@mutexembedded2206 4 года назад
Hi, I don't think I have the project files anymore. I am planning on updating this project for a much better version that works on more boards
@mohammadreza9531
@mohammadreza9531 6 лет назад
I used lot's of lib including yours. Your lib was the best . But I have a problem Lcd's first line in completely on and second line is completely off(and it dont show anything). Might I connect lcd in a wrong way or the problem is sth else.?
@mutexembedded2206
@mutexembedded2206 6 лет назад
M.R.F Iran Hi M.R.F, Do you still have the issue?
@mohammadreza9531
@mohammadreza9531 6 лет назад
MYaqoobEmbedded yes . I still have this problem
@mutexembedded2206
@mutexembedded2206 6 лет назад
Try using enable Two lines function: LCD1602_TwoLines();
@mohammadreza9531
@mohammadreza9531 6 лет назад
MYaqoobEmbedded thank you . I forgot to set tim3 . I set tim3 and now it's working . Thanks
@mutexembedded2206
@mutexembedded2206 6 лет назад
Nice!
@andit5727
@andit5727 5 лет назад
Hello, i have a STM32F4 and the LCD DEM16216. The code works fine but there is nothing printed on the LCD. I have no idea what is wrong. Maybe i could send u my code and u have a look?
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, Do you still have the issue?
@andit5727
@andit5727 5 лет назад
@@mutexembedded2206 Hello, i have found the problem. Thanks for your response
@mutexembedded2206
@mutexembedded2206 5 лет назад
Great! What was it? will be cool if you can share it here too.
@cbharshitha1590
@cbharshitha1590 6 лет назад
hello sir, I have done the same thing which is showed in the video and the connections are Vss-> GND, Vdd-> 5v, V0-> no connection, RS->PE0, RW-> GND, E-> PE1, D0-D3 -> no connection, D4-D7 -> PD8-PD11, A->5v, k->GND. But I am not getting the data on lcd. May I know the reason. Is it because of potentiometer?
@mutexembedded2206
@mutexembedded2206 6 лет назад
C B Harshitha Yes, you need a potentiometer.
@cbharshitha1590
@cbharshitha1590 6 лет назад
Actually potentiometer is to change the brightness of the LCD right?
@cbharshitha1590
@cbharshitha1590 6 лет назад
And also can you tell me the potentiometer connections to STM board
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi, Just need power 3v and GND, then common to VO. Very straight forward
@cbharshitha1590
@cbharshitha1590 6 лет назад
Ok sir, Thanks for the information :)
@ashvajitprasad8300
@ashvajitprasad8300 4 года назад
Hello, I am using STM32F3 dISCOVERY board with 16x2 RG1602 LCD. when I build code with 8 bit mode command LCD works and display is cleared but when I try to print anything rectangle block shows up in first row. I have only changed the header file name to stm32f3xx instead of f4.
@mutexembedded2206
@mutexembedded2206 4 года назад
Hi, I will update this driver and fix this issue.
@ashvajitprasad8300
@ashvajitprasad8300 4 года назад
@@mutexembedded2206 Thanks
@ashvajitprasad8300
@ashvajitprasad8300 4 года назад
@@mutexembedded2206 Is the issue resolved ?
@rwbazillion
@rwbazillion 6 лет назад
This was a good one, I just got it working but had to use another video that helped. I had to change the header file on your driver to match my board. I will post the link next: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hZRL8luuPb8.html I had to setup the LCD without the STM micro first. The URL you mentioned showed the device with the pullup resistors and that can work but to match your code using only hardware, I had to make the resistors as pulldown ensuring that the ground voltage was in the milliamps, so I ended up using not 4.7K but 2.7K ohm resistors. I also used 10K potentionmeters for the contrast (VO) and brightness (VEE). The respective voltages I got were for (VO) 1.061 Volts and for (VEE) 3.178 Volts. But if anybody is looking at my post check the URL's Mohammed (MYaqoobEmbedded) gave but also look at the one I gave as well.
@tungphamvan9781
@tungphamvan9781 5 лет назад
please help me! i used your library for stm32f103 board.but the text is not displayed on the lcd
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, Changed the header to stm32f1xx.h ?
@tungphamvan9781
@tungphamvan9781 5 лет назад
@@mutexembedded2206 i changed to stm32f1xx_hal.h but still the same
@mutexembedded2206
@mutexembedded2206 5 лет назад
Adjust brightness potentiometer.
@saurabhjain3437
@saurabhjain3437 6 лет назад
Hello Mohamed sir,I have watched all videos but I am not being able to connect STM board with Arduino over I2C protocol
@mutexembedded2206
@mutexembedded2206 6 лет назад
Saurabh Jain Hi Saurabh, I replied to you on the I2C video :)
@saurabhjain3437
@saurabhjain3437 6 лет назад
MohamedYaqoobSTM Sir can you suggest how to find the I2C address of Arduino
@ukl2901
@ukl2901 6 лет назад
hello sir! can i use it for stm32f103c8t6 for my LCD... Btw great tutorial searched so many videos but yours was very clear and to the point
@mutexembedded2206
@mutexembedded2206 6 лет назад
Thanks!
@ukl2901
@ukl2901 6 лет назад
but can i use it for my microcontroller?
@mutexembedded2206
@mutexembedded2206 6 лет назад
Utsav Lal Yes.. but you would need to change the include in the .h file from #include "stm32f4xx_hal.h" to #include "stm32f1xx_hal.h"
@ukl2901
@ukl2901 6 лет назад
Ok thank you very much....
@arashaa6616
@arashaa6616 5 лет назад
@@mutexembedded2206 Hi sir,Tnx for your brilliant channel, I used our library for the stm32f334 and as you said changed the #include stm32f3xx_hal.h but still there is an error which says "cannot open source input file stm32f4xx_hal.h as if the keil uvision searches for it. Could you please help me?
@mrigankabandyopadhyay153
@mrigankabandyopadhyay153 4 года назад
will it work on STM32F103C8 ALSO
@mutexembedded2206
@mutexembedded2206 4 года назад
Should do. But might require slight modification.
@maco11100
@maco11100 5 лет назад
I cannot open the .h and .c files. can you help?
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, Link is working. You need to download the Zip folder from my Gdrive. GL
@researchonelectronic8262
@researchonelectronic8262 5 лет назад
I adapted your library for stm32f0 but it doesent working.I think I am failing somewhere without realizing.Can you help me for the problem? and I'm also using 4bit mode
@mutexembedded2206
@mutexembedded2206 5 лет назад
Research OnElectronic Hi, You need to change the library .h file include from "stm32f4xx.h" to "stm32f0xx.h" GL
@researchonelectronic8262
@researchonelectronic8262 5 лет назад
I did it bro.I also tried on 8bit mode.Im trying on stm32f0discovery board but still have some problem.Your code using TIM3(timer3) and I didnt define as be TIM3 on stm32cubemx.I wonder about my lcd driver is ST7066U .I compared ST7066U and HD44780.They have same register.There is noting on screen.Is there any suggestion to solve this problem?.Can you send me your board connection setup between lcd please?.Are you supporting LCD 3v or 5v?
@mutexembedded2206
@mutexembedded2206 5 лет назад
Research OnElectronic Hi mate, It is something to do with TIM3. STM32F0 do not utilize TIM3, use TIM2 instead. Replace all TIM3 instances with TIM2.
@researchonelectronic8262
@researchonelectronic8262 5 лет назад
Ok bro I fixed it.Now its working well.The problem was contrast of LCD.Thanks for answers bro GL.
@mutexembedded2206
@mutexembedded2206 5 лет назад
Research OnElectronic Right, that was so simple! Nice one.
@pabloq3411
@pabloq3411 5 лет назад
Does anyone knows why 0x80 and 0xc0 are chosen in the function void LCD1602_setCursor(uint8_t row, uint8_t col)? I'm trying to understand the Hitachi manual but I cannot find what I'm doing wrong. Thanks
@pabloq3411
@pabloq3411 5 лет назад
Ok, I solved. You just have to change the if conditions by a switch(row) case 1: maskData = 0x80 case 2: maskData = 0xC0 case 3: maskData = 0x94 case 4: maskData = 0xD4
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, haha, I don't know
@rahulg6563
@rahulg6563 4 года назад
Hi myaqoob, I wondering what would be the changes I need to do if I'm going to use this driver for stm32f103c8(blue pill).
@mutexembedded2206
@mutexembedded2206 4 года назад
Hi.. why not use the i2c version. This library is slightly outdated. I might update it if many need it.
@rahulg6563
@rahulg6563 4 года назад
@@mutexembedded2206 Thank you for such a quick reply, I'll check the latest i2c driver, I was curious here to know what I might have missed for it not to work.
@mutexembedded2206
@mutexembedded2206 4 года назад
@@rahulg6563 Hi Rahul, there few things you need to change, like header include to #include "stm32f103xx.h"
@rahulg6563
@rahulg6563 4 года назад
@@mutexembedded2206 I have done that , is that it, is there gonna be a problem with timer, I believe same would work for microsecond delay function as timer 3 is present the device i have mentioned.Thank you.
@mutexembedded2206
@mutexembedded2206 4 года назад
@@rahulg6563 yes you're right. It's something to do with Microsecond timer. I suggest you replace all Microsecond delay with HAL_Delay(1)
@jaydeepshah2026
@jaydeepshah2026 3 года назад
Hi Dear; I have checked library with my nucleo and its working fine. But I want to know what is the solution if I want to use 20*4 LCD size, is there any global/universal solution ? Or which type of changes in current lib will make usable for 20*4 ? My another question iss why you fix port numbers in this case ???? Thanks for your video..........
@mutexembedded2206
@mutexembedded2206 3 года назад
For 20*4, you need to modify configuration part I believe, I will can do that and put a video for everyone next
@jaydeepshah2026
@jaydeepshah2026 3 года назад
@@mutexembedded2206 Thanks Dear for quick reply, I have tried yesterday there are two changes in Set cursor position function, Now I am able to write down in 3rd row but still unable to display character on 17th column (looks like library considering it like 16*4 LCD DISPLAY)
@mutexembedded2206
@mutexembedded2206 3 года назад
@@jaydeepshah2026 Hi, nice job, check out the range protection that this library does and unrestrict to 20 cols
@mhassanbashir
@mhassanbashir Год назад
@@jaydeepshah2026 Could you please help me regarding 20x4 LCD interfacing with STM32F407
@anishpandey6147
@anishpandey6147 6 лет назад
hello sir,I am using stm32f072rb,and im not able to add the (.h)file providing by your link.what should suitable format for (.c &.h) file.and how to addHAL libraries. PLZ provide me both file.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi Anish, Sorry for late reply, just saw yours now. Do you still need help?
@anishpandey6147
@anishpandey6147 6 лет назад
yes sir ,i really need your help
@anishpandey6147
@anishpandey6147 6 лет назад
please provide me .c and .h file for lcd interfacing
@anishpandey6147
@anishpandey6147 6 лет назад
Im using stm32f072rb
@anishpandey6147
@anishpandey6147 6 лет назад
this is my email id- anee049@gmail.com
@syedbilalhussaingilani405
@syedbilalhussaingilani405 6 лет назад
i appreciate your work it really help alot. I want to make semester project based on STM32F407VG the working of the project is to get temperature from DHT11 and live display it on LCd(16×2) if the Temperature increases from 30°, the fan will start and when temperature become 30°, fan stops. But i didn't find any help for this project i need circuit diagram. will you help me on this ?
@mutexembedded2206
@mutexembedded2206 6 лет назад
Syed Bilal Hi Syed, What sort of help do you need for your project, a code for DHT11, for example ?
@syedbilalhussaingilani405
@syedbilalhussaingilani405 6 лет назад
MYaqoobEmbedded Hello . Actually i want to know how can i implement this project on hardware because i don't have any circuit diagram.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi Syed, In brief, you need to do the following with Hardware: 1. Connect the LCD16x2 to specific pins on STM32. 2. Connect the DHT22 or DHT11 to VCC, GND and Data on STM32. 3. For the Fan control, you might use Relay or Mosfet switching. Just look at how to connect each with your STM32 individually, you will quickly figure out how to connect them all together with your STM32,, it is not hard, I am sure you will figure it out. Good Luck
@syedbilalhussaingilani405
@syedbilalhussaingilani405 6 лет назад
MYaqoobEmbedded Thank you very much sir. :)
@ElectronicsHUB1
@ElectronicsHUB1 4 года назад
NOT WORKING STUCK IN SysTick_Handler HELP ME PLZ..
@MrHause13
@MrHause13 4 года назад
Important information, this library use TIM3 ! To avoid any issues don't use it.
@musicalbite7271
@musicalbite7271 6 лет назад
Hello sir Can you tell me why my discovery access from external power supply? When I connect it to my laptop then it works but when I connect external power then no response by my stm32f4 discovery board Plz give me solution sir
@mutexembedded2206
@mutexembedded2206 6 лет назад
surinder bansal Hi, It's the ST Link keeping the MCU at reset when communication to pc is lost.. You can solve this by upgrading your ST Link Firmware.
@mutexembedded2206
@mutexembedded2206 6 лет назад
surinder bansal ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Tt-eyglKpIs.html
@musicalbite7271
@musicalbite7271 6 лет назад
Thanks sir my problem is solve now
@sovchem1275
@sovchem1275 4 года назад
I really like your function *LCD1602_TIM_MicorSecDelay(uint32_t uSecDelay)* :)) Your have setting for *TIM3* for CubeMX ? *( LCD1602_TIM_Config )* Or write your setting of *TIM3* as text please! I can read code on CMSIS & registers in *LCD1602_TIM_Config* , but I'm not sure that I will read the code correctly
@danielrodriguezruiz2786
@danielrodriguezruiz2786 5 лет назад
Can you explain the configuration of Timer3 (TIM3)? Please. ASAP
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hey If you go through the library part of the code for TIM3, you will see it is just a normal timer counter till period elapsed.
@danielrodriguezruiz2786
@danielrodriguezruiz2786 5 лет назад
MYaqoobEmbedded So... In channel 1 of TIM3 what I should choose?
@jenniferdsilva2161
@jenniferdsilva2161 4 года назад
Hi Sir, Waiting for project..
@pabloq3411
@pabloq3411 5 лет назад
Hello, sir. I have a 4x20 LCD display. What should I modify in your libraries? The instruction " LCD1602_setCursor(3,1); " doesn't work. Thanks :)
@wajdisanchou
@wajdisanchou 5 лет назад
I have the same problem I work with LCD 20*2, I didn't find the library.
@pabloq3411
@pabloq3411 5 лет назад
@@wajdisanchou In your case it is pretty straightforward. You just have to change: a) STM_MY_LCD16X2.c file >> void LCD1602_print(char string[]) >> i> void LCD1602_PrintInt(int number) >> char numStr[20]; b) STM_MY_LCD16X2.c file >> void LCD1602_PrintFloat(float number, int decimalPoints) >> char numStr[20]; And it works fine. My problem is still adding new rows because I don't really understand the variable maskData
@wajdisanchou
@wajdisanchou 5 лет назад
@@pabloq3411 sorry I'm wrong I work also LCD 20*4 .. do u get any solution
@pabloq3411
@pabloq3411 5 лет назад
@@wajdisanchou besides changing the aforementioned things, you need to modify the if conditions by a switch(row) case 1: maskData = 0x80 case 2: maskData = 0xC0 case 3: maskData = 0x94 case 4: maskData = 0xD4
@wajdisanchou
@wajdisanchou 5 лет назад
@@pabloq3411 dosen't work, it work with you !! here is my mail would u contact me plz I'm student engineer just need some help wajdi.sansa@enis.tn
@ckhapekar87
@ckhapekar87 4 года назад
I followed procedure as per video but getting error in function LCD1602_Begin8BIT() . The error is "expected a type specifier" . Please anyone can help me to rectify the issue. I think something is related with parameters passing with the function.
@mutexembedded2206
@mutexembedded2206 4 года назад
What's your line of code looks like
@ckhapekar87
@ckhapekar87 4 года назад
@@mutexembedded2206 void LCD1602_Begin8BIT(RS_GPIO_Port, RS_Pin, EN_Pin, D0_GPIO_Port, D0_Pin, D1_Pin, D2_Pin, D3_Pin, D4_GPIO_Port, D4_Pin, D5_Pin, D6_Pin, D7_Pin); getting error in this function.
@ckhapekar87
@ckhapekar87 4 года назад
@@mutexembedded2206 Total 13-errors as expected a type specifier.
@hoangphamtranminh
@hoangphamtranminh 5 лет назад
Hi sir! Can you teach me how to choose multiple GPIO output in one time? Hope you rep soon! Thank you!
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, Sorry for late reply. can use register directly GPIOD-> BSRR = (1UL
@musicalbite7271
@musicalbite7271 6 лет назад
Sir how can I shift cursor from left to right? I can't understand
@mutexembedded2206
@mutexembedded2206 6 лет назад
You can shift Cursor with Set Cursor functions
@musicalbite7271
@musicalbite7271 6 лет назад
I'm using but can't access
@mutexembedded2206
@mutexembedded2206 6 лет назад
surinder bansal What exactly you're to do and how it is not giving you what you want?
@musicalbite7271
@musicalbite7271 6 лет назад
I'm directly using the shift cursor function I think I'm wrong here can u tell me how to use this function?
@mutexembedded2206
@mutexembedded2206 6 лет назад
surinder bansal This function sets cursor at X Row and Y Col. X from 1 to 2. Y from 1 to 16.
@rickjr3662
@rickjr3662 6 лет назад
I use the STM32L432KCU card could you help me to use an LCD
@mutexembedded2206
@mutexembedded2206 6 лет назад
Rick JR Hi Rick, You would need to do a little change in the .h file of the lcd driver: Change the #include "stm32f4xx_hal.h" To #include "stm32l4...h" (your device specific)
@rickjr3662
@rickjr3662 6 лет назад
Thank you very much already try that but it generates some mistakes in STM_MY_LCD16X2.c in the section Enable clock for TIM2 timer on line number 110 from RCC-> APB1ENR and all lines of TIM3. I do not know if you could help me one more time JL
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi Rick, The library uses TIM3 for LCD timing,,, but the STM32L432 series does not contain a TIM3,, you can use TIM2, TIM15 & TIM16 as General purpose timer. So, you just need to replace all TIM3 by TIM2 and to use TIM2 instead ,, in 2 functions: LCD1602_TIM_Config() & LCD1602_TIM_MicorSecDelay() And you will get a working LCD! GL
@rickjr3662
@rickjr3662 6 лет назад
ok it works, I only have a mistake in STM_MY_LCD16X2.c in the line RCC-> APB1ENR | = RCC_APB1ENR_TIM2 EN; it's only that, please would you give me a solution
@mutexembedded2206
@mutexembedded2206 6 лет назад
Hi Just use the HAL library Macro: __HAL_RCC_TIM2_CLK_ENABLE();
@anishpandey6147
@anishpandey6147 6 лет назад
plz provide me all connection as soon as possible......
@borakilerci1299
@borakilerci1299 5 лет назад
Muhammed Can you please help me? I can't use lcd with your library i did everything like yours. Can you get contact with me?
@borakilerci1299
@borakilerci1299 5 лет назад
I fixed my problem. ( Still i can't write float.) If you use different Ports, you can't use this library. For example D0-D7 must be in GPIOF or GPIOB etc. If you seperate the pins to different ports, library crashes.
@rohitpatil4785
@rohitpatil4785 6 лет назад
hello sir, Thanks for LCD tutorial.Last week we have discussed about frequency generation. I have one question about frequency reading.i am working on STM32F429Zi Discovery board. can I use edge count/timer interrupt and CCP for frequency reading? do you have any solution for this please help me? otherwise give me any reference of your tutorial? Thanks and Regards, Rohit R Patil
@mutexembedded2206
@mutexembedded2206 6 лет назад
rOHIT PATIL Hi Patil, Are you trying to measure a square wave's frequency ?
@rohitpatil4785
@rohitpatil4785 6 лет назад
no sir,just i watching your i/o capture tutorial.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Ok Sir!
@rohitpatil4785
@rohitpatil4785 6 лет назад
is this possible using Input capture?
@mutexembedded2206
@mutexembedded2206 6 лет назад
rOHIT PATIL You can use input capture to measure pulse width, and with this you can calculate the frequency.
@jericotaleon
@jericotaleon 5 лет назад
Hi Mohamed, been following all your tutorials and I learned a lot! thanks! I have a problem though, i am getting an "error #79: expected a type specifier" on my declaration of LCD begin. hope you can help :)
@ramychokry4335
@ramychokry4335 4 года назад
guys please how to configurate TIM3 ?
@mutexembedded2206
@mutexembedded2206 4 года назад
Hi, What STM32 Board you're using?
@ramychokry4335
@ramychokry4335 4 года назад
@@mutexembedded2206 STM32F4 DISCOVERY
@mutexembedded2206
@mutexembedded2206 4 года назад
@@ramychokry4335Right,, did you have a problem with TIM3?
@ramychokry4335
@ramychokry4335 4 года назад
I fixed it its working now by the way thank you very much you have the best stm32 videos on youtube
@mutexembedded2206
@mutexembedded2206 4 года назад
@@ramychokry4335 Great, enjoy :)
@bhekumuzinkosiyabobukwele5929
@bhekumuzinkosiyabobukwele5929 5 лет назад
How do I write my own LCD functions?
@mutexembedded2206
@mutexembedded2206 5 лет назад
Need to add couple more functions to the library. described in the datasheet if you are to try.
@rwbazillion
@rwbazillion 5 лет назад
I made the circuit and put the diagram into an image for people to download. (LINK BELOW) I made the circuit to have a manual option to test the circuit without the MCU. This way you can ensure the circuit works before testing the code on the MCU. You may have to play around with the pot values I got 2.8 volts on vee and .65 start to put 1.3 volts by V0. My circuit diagram uses pull down resistors which worked for me. Check the datasheet to manually put in the letters. rbaz.tripod.com/code/16x2_Circuit_Diagram.jpeg
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi rwbazillion, Amazing mate, good work. I wish I have some freetime to make some videos for this and the update you made to the LCD library., it is very busy period for me. Keep up the good work though :)
@CamiloACamacho
@CamiloACamacho 6 лет назад
Your code uses TIM3. Please notice this.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Camilo A. Camacho Yeah, that's right.. Forgot to mention that.
@dantemonge2060
@dantemonge2060 5 лет назад
could you tell me what configuration should i do with tim3? thanks in advance
@shaivalnagarsheth7229
@shaivalnagarsheth7229 3 года назад
you are speaking 'A YEAR AGO'? Then where is the original video? please add the older video link in the description of every carryforward video.
@haldunturan
@haldunturan 6 лет назад
Hello Mohamed, I reviewed your LCD Library and i want to work with 4x16 LCD. I want to change this functions for 3. and 4. rows. void LCD1602_TwoLines(void) { FunctionSet |= (0x08); LCD1602_writeCommand(FunctionSet); } void LCD1602_OneLine(void) { FunctionSet &= ~(0x08); LCD1602_writeCommand(FunctionSet); } // void LCD1602_setCursor(uint8_t row, uint8_t col) { uint8_t maskData; maskData = (col-1)&0x0F; if(row==1) { maskData |= (0x80); LCD1602_writeCommand(maskData); } else { maskData |= (0xc0); LCD1602_writeCommand(maskData); } } What kind of changes should i do? For example: 1. row = > maskData |= (0x80); 2. row = > maskData |= (0xc0); 3. row = > maskData |= (0x??); 4. row = > maskData |= (0x??);
@mutexembedded2206
@mutexembedded2206 6 лет назад
HI Haldun, i am not if it will be a simple change in the library... I have not worked with LCD 16x4 before,, I would say, just look at an Arduino library for 16x4 LCD and compare it with this,, and see how you can adapt it to 16x4. I might update the library to do that if that turned out to be simple enough, if I had time over the next month. Good luck
@haldunturan
@haldunturan 6 лет назад
Hello again Mohamed, I solved my problem. I changed a few functıons in STM_MY_LCD16X2.c 1. changing function__________________________________ void LCD1602_setCursor(uint8_t row, uint8_t col) { uint8_t maskData; maskData = (col-1)&0x0F; if(row == 1) // 1. row { maskData |= (0x80); LCD1602_writeCommand(maskData); } else if (row == 2) // 2. row { maskData |= (0xc0); LCD1602_writeCommand(maskData); } else if (row == 3) // 3. row { maskData |= (0x90); LCD1602_writeCommand(maskData); } else if (row == 4) // 4. row { maskData |= (0xd0); LCD1602_writeCommand(maskData); } else // default 1. row { maskData |= (0x80); LCD1602_writeCommand(maskData); } } 2. two adding function__________________________________ void LCD1602_1stLine(void) // 1. row { LCD1602_setCursor(1,1); } void LCD1602_2ndLine(void) // 2. row { LCD1602_setCursor(2,1); } void LCD1602_3ndLine(void) // 3. row { LCD1602_setCursor(3,1); } void LCD1602_4ndLine(void) // 4. row { LCD1602_setCursor(4,1); } you can add this to your library if you would like. p.s : I will add custom characters functions and i will let you know.
@mutexembedded2206
@mutexembedded2206 6 лет назад
Haldun Turan That's Awesome!,, thanks Haldun :) Please do let me know if you managed to get the custom character function.. Good work mate!
@haldunturan
@haldunturan 6 лет назад
Hello again Mohamed, I solved custom characters fuctions problem but only for 8 custom characters . I added a few functions in your library and changed library name :) . Now the library name is "AlphaNumericLCD", because the library supports 1x16 to 4x16 alphanumeric LCD... as well as I worked and tested STM32F1XX and STM32F4XX. it's working!. if you would like to download library and example drive.google.com/open?id=1ToDRtBM0RKWhPkXMmJD1ZkUxtlUm54dg drive.google.com/open?id=1iaho-Z4AtwO_ZMELWl_jX8yQgDnYQV9o I will wait for the updated video on the subject, and hope you will not forget to thank me on the update video :D
@mutexembedded2206
@mutexembedded2206 6 лет назад
Haldun Turan Hi Haldun, Good job! I will make another video for this extended library.. Will mention you in the header as the editor and the list of functions you've written/contributed. Thanks again mate :)
@xx-mz2eg
@xx-mz2eg 5 лет назад
Will it work on STM32L053?
@mertdogan5667
@mertdogan5667 5 лет назад
I used timer3 on my project when i try use your liblary its broke my project.I think your project use tim3 so changed my timer to 2.But still got problem unable word do you have a idea about this problem? I use uart spi adc on the same project
@mutexembedded2206
@mutexembedded2206 5 лет назад
Hi, You can avoid using TIM3 in your project, it should solve the problem, assuming there is no more conflict with your current project.
@leonardoreyes6653
@leonardoreyes6653 5 лет назад
oh yeah !!!
@anishpandey6147
@anishpandey6147 6 лет назад
sir can you send the connection diagram
@anishpandey6147
@anishpandey6147 6 лет назад
plz provide additional connection with lcd like potentiometer ......
@photosapientt
@photosapientt 6 лет назад
Can i use this library for stm32f0?
@mutexembedded2206
@mutexembedded2206 6 лет назад
dalpus Yes.. As long as you're using HAL libraries .. Good luck
Далее
Мама хитрая😂​⁠​⁠@ladymilanapap4610
00:16
Как выходим с тройняшками 🙃
00:17
STM32 + OLED = Display Anything
18:01
Просмотров 16 тыс.
LCD via I2C in STM32 || CUBEIDE || PCF8574
12:22
Просмотров 77 тыс.
OZON РАЗБИЛИ 3 КОМПЬЮТЕРА
0:57
Просмотров 27 тыс.
Кто производит iPhone?
0:59
Просмотров 470 тыс.