I am currently playing with L152C Discovery board and trying to make simple clock that would use the RTC build into the STM32 and onboard Glass LCD with LCD HAL library configured via CubeMX.
But I am currently facing a problem I can't get my head around:
CubeMX does not have an option to enable segment mux in the LCD_CR
register. I would like to enable it, because it would make the segment mapping easier.
So I thought, fine, I will make an direct register manipulation, enabling the mux (bit 7 in the LCD_CR
).
I used the command LCD->CR |= LCD_CR_MUX_SEG;
But even after executing the command, the MUX_SEG
bit is still zero. (I checked in the debug session with command stepping and SFRs memory map)
Is there something that I am doing wrong? Or is there another way to change init parameters that CubeMX configured but does not have graphical implementation of this settings option?
The application is using FreeRTOS and I executed LCD->CR |= LCD_CR_MUX_SEG;
after HAL_LCD_Init(&hlcd);
so I sappose that the LCD peripheral clock is running (and segments are updating).
I recorded a short video showing this problem: https://youtu.be/0X6Zu5EPudU To be honest, I am not skilled at direct register manipulation, so I am probably doing something wrong.
Any help would be appreciated!
As @KIIV said:
The LCD must be disabled when making changes to the above registers.