2020-11-24 07:45 AM
I am trying to setup this LCD controller to drive a custom segment display, 22 segments, two backplanes.
I have the code running, I can see the COM signals and can drive segments.
I don't understand how the HAL LCD library works.
from the HAL manual:
HAL_LCD_Write
Function Name Function Description
void HAL_LCD_MspDeInit (LCD_HandleTypeDef * hlcd)
DeInitialize the LCD MSP.
• hlcd: LCD handle • None:
void HAL_LCD_MspInit (LCD_HandleTypeDef * hlcd)
Initialize the LCD MSP.
• hlcd: LCD handle • None:
HAL_StatusTypeDef HAL_LCD_Write (LCD_HandleTypeDef * hlcd, uint32_t RAMRegisterIndex, uint32_t RAMRegisterMask, uint32_t Data)
Write a word in the specific LCD RAM.
DOCID027704 Rev 4 439/1817
440/1817
• When the display is disabled, the update is performed for all LCD_DISPLAY locations. When the display is enabled, the update is performed only for locations for which commons are active (depending on DUTY). For example if DUTY = 1/2, only the LCD_DISPLAY of COM0 and COM1 will be updated.
DOCID027704 Rev 4
Parameters
UM1884
• hlcd: LCD handle
• RAMRegisterIndex: specifies the LCD RAM Register. This
parameter can be one of the following values: LCD_RAM_REGISTER0: LCD RAM Register 0LCD_RAM_REGISTER1: LCD RAM Register 1LCD_RAM_REGISTER2: LCD RAM Register 2LCD_RAM_REGISTER3: LCD RAM Register 3LCD_RAM_REGISTER4: LCD RAM Register 4LCD_RAM_REGISTER5: LCD RAM Register 5LCD_RAM_REGISTER6: LCD RAM Register 6LCD_RAM_REGISTER7: LCD RAM Register 7LCD_RAM_REGISTER8: LCD RAM Register 8LCD_RAM_REGISTER9: LCD RAM Register 9LCD_RAM_REGISTER10: LCD RAM Register 10LCD_RAM_REGISTER11: LCD RAM Register 11LCD_RAM_REGISTER12: LCD RAM Register 12LCD_RAM_REGISTER13: LCD RAM Register 13LCD_RAM_REGISTER14: LCD RAM Register 14LCD_RAM_REGISTER15: LCD RAM Register 15
• RAMRegisterMask: specifies the LCD RAM Register Data Mask.
• Data: specifies LCD Data Value to be written.
Should I be writing to the RAM registers 0 and 2, for 22 segments on two coms? What is the Mask parameter for? Is it correct to assume that RAM register 0 would be for COM1 and RAM register 2 would be for COM2?
Thanks for the help
Rich