2017-11-29 12:01 AM
Hello,
I'm working on a custom board : stm32l073 + LCD screen ( matrix 4 x 25 ).
I can't understand how to use HAL_LCD_Write function.
As far as I understand I just need 3 parameters in order to write LCD :
COM: 0-3
SEG : 0 - 24
DATA : 0 - 1 ( yes/no )
Or can someone explain the function note :
* @note For LCD glass COM*SEG as 8*40 for example, the LCD common terminals COM[0,7]
* are mapped on 32bits LCD_RAM_REGISTER[0,14] according to rules: COM(n) spread* on LCD_RAM_REGISTER(2*n) and LCD_RAM_REGISTER(2*n+1).The segment terminals * SEG[0,39] of COM(n) correspond to LSB bits of related LCD_RAM_REGISTER(2*n)[0,31]* and LCD_RAM_REGISTER(2*n+1)[0,7]Please advise
Moran.
#lcd #stm32l073 #hal2017-11-29 12:59 AM
Hello,
HAL_LCD_Write function writes to the LCD RAM memory:
HAL_StatusTypeDef HAL_LCD_Write (LCD_HandleTypeDef * hlcd, uint32_t RAMRegisterIndex, uint32_t RAMRegisterMask, uint32_t Data)
You can have a look to the
User Manual Description of STM32L0 HAL and Low Layer driversBest Regards
Imen
2017-11-29 04:17 AM
Hi Imen,
I've already looked at the HAL user manual, but it doesn't help.
I don't know if it's only me or not but I can't understand what should I write to each parameter of this function.
Thanks in advance.
2019-03-05 03:16 PM
Hi Moranf I have the same problem.
did you have some solution?
2020-03-12 09:40 AM
I am facing the same problem, I am not sure what to write for the LCD Handle. Would be great if someone could answer this question.
2020-03-15 02:42 PM
As Imen pointed out above, HAL_LCD_Write() does not perform any seg/com decoding, it simply writes to one of the LCD module's RAM positions, refer to the LCD chapter in RM.
But the mapping is pretty straighforward: pixels (segments) corresponding to COM0 are in RAM[0] and RAM[1] (i.e. COM0SEG0 is bit 0 in RAM[0], COM0SEG1 is bit 1 in RAM[0] etc.), COM1->RAM2 and RAM3, etc.
JW