2013-10-19 7:11 PM
Hi all,
I'm at my wit's end with this little project I'm working on. I'm new to MCUs and had a few ideas on small projects that I would like to make. I've been following a guide on the STM32 and modifying bits and pieces to get it working with my particular board (STM32F4Discovery). As part of every project I would like to utilize an LCD for status output so that's where I've started to learn all things MCU. I bought a tiny LCD screen... a ''Mini 1.8'' Serial SPI TFT LCD Module Display with PCB Adapter ST7735B IC'' to be exact but I can't for the life of me understand how to get it working. I started by first learning SPI with a simple loopback setup and watched the results on my Open Bench Logic Analyzer. It was straight forward and worked without too much pain. I then applied that knowledge to getting the LCD working and I've got myself in a tangle.Here's some observations I've made:2013-10-19 7:18 PM
GPIO_PinAFConfig(GPIOA, GPIO_Pin_SDA , GPIO_AF_SPI1);
Not a GPIO_Pin (mask) but GPIO_PinSource (index)2013-10-19 9:36 PM
2013-10-20 6:09 AM
ST7735 datasheet says it uses CSX, SCL and SDA(bi-directional) in 3-line serial interface mode.
In 4-line mode you have one more input: D/CX (data/command).2013-10-21 4:03 AM
Ye that's the confusing part. I understand it to mean setup SPI like normal but only configure 2 pins... SCL(SCLK) and SDA(MOSI). Then configure CSX and D/CX as normal pins that I control based on what the data sheet says. I assume that means I setup SPI to TX mode only.
2013-10-21 10:52 AM
You can configure SPI in TX mode to send data to the LCD and configure the pin as GPIO input to bit bang the input data.
Usually there is no need to get much data from the LCD so speed should be no problem.We’re moving the ST Community to a new platform to give you a better and more reliable community experience.