2026-02-24 9:57 PM
Hoping someone can assist.
I have a 2 x 8 segment numerical glass LCD that I want to drive from the MCU.
See two images below & uploaded files with this request.
This display is Static with total of 16 segments.
Is there a convention when connecting LCD segments to the MCU pins?
I cannot seem to find any guidance to show which physical pin on the glass segment LCD module needs to connect to which LCD_SEGxx pin on the MCU.
If anybody has trialed this, could they provide any related information please.
Thank you.
Solved! Go to Solution.
2026-02-26 1:14 AM - edited 2026-02-26 3:43 PM
I'm not expert of that LCD glass peripheral and I don't think there is an order to connect the segments since the segments values and characters mapping are specified in the application. It seems you need to build a look up table for the characters. Better to look at stm32u083c_discovery_glass_lcd.c to understand how segments values were assigned to the segments.
2026-02-25 12:02 AM
Hello,
Not sure how many COMx available in that LCD glass:
The table is not clear and how they are mapped internally to the LCD.
I'm referring to the STM32U083C-DK board:
2026-02-25 2:25 PM
I've marked up this version of the LCD glass to show only COM_0 used and how segments are mapped internally.
Display is Static, so segment lines are not multiplexed at all.
I would need a LCD PINxx to MCU SEG_xx layout like the one you uploaded from the STM32U083C-DK board.
Thanks.
2026-02-25 11:45 PM - edited 2026-02-25 11:49 PM
Hello,
Not sure but I think you have one COM (COM0) that needs to be connected to LCD_COM0. The rest needs to be connected to LCD_SEGx each (in Static mode).
2026-02-26 12:49 AM
Hello,
Yes, I had sort of worked that out already.
The problem ahead is -
Say I want to turn on segments to display a number (1 for example), is there a particular order for which segment on the glass LCD connects to LCD_SEG1 and which connects to LCD_SEG2 etc... on the MCU?
So that the MCU's LCD peripheral & HAL LCD driver API functions are going work together to display the number?
Does it have to be trial and error with the segments?
2026-02-26 1:14 AM - edited 2026-02-26 3:43 PM
I'm not expert of that LCD glass peripheral and I don't think there is an order to connect the segments since the segments values and characters mapping are specified in the application. It seems you need to build a look up table for the characters. Better to look at stm32u083c_discovery_glass_lcd.c to understand how segments values were assigned to the segments.
2026-02-26 2:49 PM
Yes, thank you, this looks to be the case.
I can review these bsp files and work with the content.
Thanks.
2026-03-02 11:58 AM
You have to implement the character set yourself. From a programmer's point of view, you just write to memory where each segment is represented by one bit. Wherever you write a one, that segment will be active. In HAL, I think this is done with the HAL_LCD_Write() function.
Look on register LCD_RAM(COM0) - bit S00 controls LCD_SEG0, bit S01 controls LCD_SEG1 etc.
As the author of the circuit diagram, you know which display segment is on which pin and therefore which bit in the LCD_RAM register controls which specific segment. Other RAM registers (COM1,2...) are not relevant in static drive.
If you connect the individual segments cleverly, you can make your work easier when creating the character set, because you won't have to code it separately for each digit.
For example:
1a - SEG0
1b - SEG1
...
DP1 - SEG7
2a - SEG8
2b - SEG9
...
DP2 - SEG15
2026-04-07 2:08 AM
Hi Michal,
thank you for the great response.
sorry for the delay in my reply.
what you have given me will help me greatly.
thanks.