LCD via I2C in STM32 || CUBEIDE || PCF8574

preview_player
Показать описание
________________________________________________________________________________________

Do not use the address 0x27. This is not arduino. STM32 uses 8 bits for the address (7 address + 1 read/write bit), while Arduino uses 7.
Check the datasheet to check the proper address along with the write/read bit.

________________________________________________________________________________________

******* SUPPORT US BY DONATING******

*******Join the Membership*******

Рекомендации по теме
Комментарии
Автор

I just tried the this and followed your instructions precisely. It worked flawlessly! You taught me something new as I am new to this. Thank you.

dalevanderzee
Автор

Such an amazing tutorial.
I followed it and it worked on the first attempt.
Thank you!

Ngigi
Автор

For a quick tip, always consider pull ups with I2C, sometimes you struggle hours long with an empty LCD, but it turns out that the problem is open drain STM32 pins with no pull ups... Besides some modules have the address 0x27 not 0x4E, by the way thanks for the video...

DERKONIG
Автор

I do enjoy all your tutorals I am still learning and want to get better at understanding C+ and how to rad programs and write them

robertjohnson
Автор

These demonstrations are just excellent. Thanks for your good work and Happy New Year.

sampoteste
Автор

Great Video! Thanks a lot from Germany :D DANKESCHÖN!

florianthomashanisch
Автор

Very good, clear and complete explanation. Thanks a lot!

robertopascazi
Автор

The code that I downloaded from your link had 0x20 instead of 0x28 for the initialization of the screen. This then initializes only the top row of the screen and not both rows. So if anyone else is having the problem where just the first line of the screen is working, just change the 0x20 to 0x28 in the initialization of the display.

andrelabuschagne
Автор

For those having problem writing on the screen you might have to adjust the potentiometer on the PCF8574 IC board. That was the solution for me.

ihsanc
Автор

From Cambodia... Thank you very much for good demonstration

voeunkhoem
Автор

Default bus addresses for popular i2c LCD modules (if A0 A1 A2 pads unsoldered):

(0x27<<1) for PCF874
(0x3F<<1) for PCF8574A

TomaszSynoradzki
Автор

Hi, thanks for the tutorial. I am using the Nucleo-F303RE and had to change the void lcd_init (void) delays on the LCD that I am using. Then everything works well.
void lcd_init (void)
{
// 4 bit initialisation
HAL_Delay(50); // wait for >40ms
lcd_send_cmd (0x30);
HAL_Delay(15); // wait for >4.1ms
lcd_send_cmd (0x30);
HAL_Delay(15); // wait for >100us
lcd_send_cmd (0x30);
HAL_Delay(15);
lcd_send_cmd (0x20); // 4bit mode
HAL_Delay(15);

taylorsailing
Автор

Thanks bro! It was very useful for me!
Tienes un nuevo un suscriptor desde Ecuador, gracias (You have a new suscriptor from Ecuador, Thanks)!!

pablomoviespower
Автор

Please SHOW where to get the Library Flies from. Surely it is very important to know this.

gautombose
Автор

Your code is awesome! many thanks. Sadly I encounter a problem is that when I pass a variable to the function "lcd_send_string", cubeIDE says
"passing argument 1 of 'lcd_send_string' makes pointer from integer without a cast [-Wint-conversion]"

I search for int to char conversion using suprintf(), but more problems appears. how can I fix it? Thanks

LatevisTech
Автор

I have one problem following this code. When I attempted to run it up to the lcd_clear() calls, the display still has a bunch of jibberish characters on it. The for loop does have a continuous character print (though not quite what I expected) so I believe that, in principle, this code does work to an extent. I found it strange since based on what understanding I could glean from the HD44780U LCD datasheet so far, the code is consistent with the datasheet.

justanotherpoweraddict
Автор

I do appreciate all the work that goes into your tutorials, both the coding effort and the video editing. The one problem I ran into, which took more than a day to sort out, was the lcd_init function, which indicates using 0x30 and 0x20 as commands. According to the specs, and my experience, those commands should be 0x3 and 0x2. For a noob such as myself, simple typos can be quite the challenge.
A second discovery, not directly related to your tutorial: When I wanted to port the code to a Nucleo-103R8, I was mis-led by the Arduino pinouts and notations on the motheboard for SCL and SDA. It again took more than a few hours to discover those pins ONLY WORK when coding with the Arduino IDE wire library. To work directly with the STM32 mcu, the outer set of pins must be used. The code for the display will not work with the Arduino headers. It seems that that aspect of the Arduino shield vs the mcu pinout is not well documented, or at least I couldn't easily find such documentation.
Again, thank you for your efforts, they are much appreciated and I have learned a lot from your tutorials.

Bob-Is-A-PotterNow
Автор

Hola, tengo un STM32F411E, hice el programa con el display lcd-i2c usé la librería esta y todo bien, pero al darle Debug, no me presenta nada en la pantalla. que puede ser?.. se que el video es de 3 años, pero me está sirviendo y soy otro nuevo seguidor

dioadadosite
Автор

can you provide the proteus file? or show me how proteus simulation works?

priyankakundu
Автор

The connection is correct. I also checked the device address using for loop. Its 0x4E. But when I send some string it just displays blank screen. LCD glows but nothing is displayed. Do I need to adjust the contrast ? Or the problem is something else ?

shubhampatil