Hi, I've been struggling with an LCD screen to show simple characters with the STM32F103 [Blue Pill].
1. When i try to print some words (without a delay added), i get random characters instead of what im trying to display. An example is:
In the code, i have at the loop:
lcd.setCursor(0, 0);
lcd.print("misery");
lcd.setCursor(0, 1);
lcd.print("pain");
and what my lcd prints is:
2. And when i try to print the same words to the lcd display with a delay of 1500, i get the same problem with a different presentation. In the code i have:
lcd.setCursor(0, 0);
lcd.print("misery");
delay(1000);
lcd.setCursor(0, 1);
lcd.print("pain");
delay(1000);
and my lcd prints:
Regards,
losingmymind01
Problems with the blue pill and a LCD 16x2
-
- Posts: 3
- Joined: Sun Apr 11, 2021 11:59 pm
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
-
- Posts: 3
- Joined: Sun Apr 11, 2021 11:59 pm
Re: Problems with the blue pill and a LCD 16x2
I'm using a STM32F103C8 (20kRAM, 64kFlash) [Blue Pill] and the LiquidCrystal library working on the arduino IDEstevestrong wrote: Mon Apr 12, 2021 8:08 am viewtopic.php?f=2&t=301
Which core and which LCD library do yo use?
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Problems with the blue pill and a LCD 16x2
And which core?
If you don't know, then post a picture of the selected board in Arduino IDE.
Please also post a link to the library.
If you don't know, then post a picture of the selected board in Arduino IDE.
Please also post a link to the library.
-
- Posts: 3
- Joined: Sun Apr 11, 2021 11:59 pm
Re: Problems with the blue pill and a LCD 16x2
This is what i have in Arduino IDE: And the link to the library is: https://github.com/arduino-libraries/Li ... dCrystal.hstevestrong wrote: Tue Apr 13, 2021 11:33 am And which core?
If you don't know, then post a picture of the selected board in Arduino IDE.
Please also post a link to the library.
Re: Problems with the blue pill and a LCD 16x2
there is a chance that stm32 is too fast for the lcd. Hence, try to insert 'strategic' delay(1) in the code to see if that'd help.
of course 1ms delay is a 'long' time, but at least it'd help locate the problem.
stm32 is capable of toggling pins up to 50mhz
of course 1ms delay is a 'long' time, but at least it'd help locate the problem.
stm32 is capable of toggling pins up to 50mhz
Re: Problems with the blue pill and a LCD 16x2
That library seems to work ok without any changes on a blue pill board.
I used PB4-PB9 to connect to the LCD display.
See attached example. It alternates the text on line1 and line2 repeatedly every time the LED blinks.
I used PB4-PB9 to connect to the LCD display.
See attached example. It alternates the text on line1 and line2 repeatedly every time the LED blinks.
- Attachments
-
- 16x2_LCD_With_Library-210413a.zip
- (4.42 KiB) Downloaded 634 times
Re: Problems with the blue pill and a LCD 16x2
Hello,
I had the same problem, and I solved it by setting in tools of the Arduino IDE:
- CPU Speed(MHz): "48Mhz (slow - with USB)"
Best,
I had the same problem, and I solved it by setting in tools of the Arduino IDE:
- CPU Speed(MHz): "48Mhz (slow - with USB)"
Best,
-
- Posts: 633
- Joined: Thu Dec 19, 2019 1:23 am
Re: Problems with the blue pill and a LCD 16x2
IF you must use a 1602, the I2C backpack is highly recommended ... just be certain to run the I2C scanner as I had a few with an unusual address.

https://www.electroschematics.com/ardui ... -tutorial/

https://www.electroschematics.com/ardui ... -tutorial/