cancel
Showing results for 
Search instead for 
Did you mean: 

LCD with stm8

Abhishek Kulkarni
Associate II
Posted on June 28, 2017 at 07:09

I'm trying to interface a lcd with the stm8. My code is as follows:

(I'm using the 16 MHz internal clock)

# include 'stm8l.h'

# include 'stm8s.h'

void lcdinit(void)

{

     LCD_CR1 = 0x06;

     LCD_CR2 = 0xEE;

     LCD_FRQ = 0X30;

     LCD_PM0 = 0x92;

     LCD_PM1 = 0x00;

     LCD_PM2 = 0xB0;

     LCD_PM3 = 0x04;

     LCD_RAM0 = 0xFF;

     LCD_RAM1 = 0xFF;

     LCD_RAM2 = 0xFF;

     LCD_RAM3 = 0xFF;

     LCD_RAM4 = 0xFF;

     LCD_RAM5 = 0xFF;  

     LCD_RAM6 = 0xFF;

     LCD_RAM7 = 0xFF;

     LCD_RAM8 = 0xFF;

     LCD_RAM9 = 0xFF;

     LCD_RAM10 = 0xFF;

     LCD_RAM11 = 0xFF;

     PB_DDR = 0xff;

     PB_CR1 = 0xff;

}

Now that the initialization is done , I'm not understanding how should I send data to the lcd to get the output. Up till now the lcd shows nothing . Where should I write the data that I want as the output? Please help.

1 REPLY 1
Simon V.
ST Employee
Posted on July 07, 2017 at 16:56

Hello,

I would advise you to read the AN3114 and download the associated project :

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm8-embedded-software/stsw-stm8056.html

Embedded SoftwareMCUs Embedded Software

STM8L15x/162x LCD controller firmware (AN3114)

Kind regards,

Simon

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.