Electronic – Driving Nokia TFT LCD with STM32

armlcdstm32stm32f10xtft

How do I increase the refresh rate of a Nokia LCD that I'm driving using the STM32F103 microcontroller?

The LCD is 132*162 and takes a 9-bit instruction/DATA with RGB for each pixel in 565 format. Since SPI on STM32 can't do 9 bits, I'm using USART (running at maximum 4,000,000 bit/s max as I'm using HSPI) in 9-bits mode to drive the LCD.

This works just fine, but the refresh rate is not that great. Right now it takes me 230 ms approx to write the whole screen.

Doing rough calculations, (132*162*2*9)/4e6 = 97 ms. Mine is higher because of overheads + the fact that I need to mirror each byte before sending as USART does LSB first only.

I am looking for some suggestions as to how can I reduce the refresh rate.

  1. Use DMA? I am not sure how useful it would be in this case as my microcontroller is just driving the LCD. Nothing else.

  2. Buffer the LCD display in RAM and send it out to the LCD in one go. I can't do as the microcontroller has only 16 KB RAM.

  3. Bit bang GPIO to drive the LCD. I am not sure if this would achieve a rate more that 4 MHz of USART. Plus with this I lose the ability to use DMA in the future if required.

The LCD I'm using is used in the Nokia C100 series and use the controller SPFD54124B.

Best Answer

You want something that looks like SPI, so I'd try to make SPI work.

Assuming your LCD (which you might want to specify) doesn't need some specific timing in between words, you should just use the word modes that the STM32F1 has to offer (8 or 16 bits, iirc), and push out 8 words at once – that'd be 72 bits, and that can be broken into 9 SPI transfers.