SPI - Software

Getting Started ›› Hardware ›› Protocol ››
Parent Previous Next

Software SPI Port


The Software SPI protocol (SW SPI), also known as Bit-banging, is slower than the HW SPI protocol but offers flexibility by allowing any available pins to be used, while still providing sufficient speed for most graphic applications.


Important Note! Although the TFT display can share SW SPI with other peripherals, using a shared setup will significantly reduce effective transfer rates compared to using dedicated SW SPI pins for the display. This is because there are two primary ways to transfer pixel data to display chips:


Mode 1: An area of X * Y pixels on the screen is designated to be filled, and all required pixels (totaling X * Y) are sent sequentially as RGB data, without any additional overhead. In this mode, data transfer cannot be interrupted; keeping Chip Select (CS) low continuously means that any communication on the shared port will be interpreted as graphic data by the display IC. Thus, this mode isn’t suitable for shared SW SPI pins.


Mode 2: Individual pixels are sent with both RGB data and coordinate information, which requires additional commands for each pixel. Because each pixel’s position is specified, graphic data transfer can be paused and resumed, allowing the SW SPI pins to be shared. However, this mode incurs significant data overhead and a speed penalty. One way to improve speed is by using a graphics buffer, which is on my To-Do List.


Common Connections for TFT Displays with SPI Interfaces (from the MCU perspective):


VCC: Power - Connect to a 3.7–5V source if the display has a built-in 3.3V LDO/regulator; otherwise, connect to 3.3V VCC. Some displays include a bypass resistor to allow direct connection to the PCB VCC. Due to potentially high current draw, use the built-in regulator if available.

GND: Power - Ground connection.

CS: Output - TFT Chip Select.

RESET: Output - Hardware reset pin for the display IC.

RS/DC: Output - Data/Command control, indicating the type of data being sent.

MISO: Input - SPI communication input for the Graphic IC/Touch IC.

MOSI: Output - SPI communication output for the Graphic IC/Touch IC.

CLK: Output - SPI clock for the Graphic IC/Touch IC.

LED: Power - Back-light LED power; add a current-limiting resistor if needed.

T_CS: Output - Chip Select for the Touch IC. Not all TFT displays have touch support.

PEN/T_IRQ: Input - Interrupt request pin for the Touch IC.


Optional Connections (not all TFT displays have built-in SD Card slots):


SD_CS: Output - Chip Select for SD Card SPI communication. For maximum speed, use an HW SPI port or Software SPI with separate pins from the Graphic IC.

SD_MISO: Input - SPI input for the SD Card IC. For maximum speed, use an HW SPI port or Software SPI with separate pins.

SD_MOSI: Output - SPI output for the SD Card IC. For maximum speed, use an HW SPI port or Software SPI with separate pins.

SD_CLK: Output - SPI clock for the SD Card. For maximum speed, use an HW SPI port or Software SPI with separate pins.



TYPICAL 8b or 16b CONNECTION (NO HW SPI USED)

BUILT-IN REGULATOR BYPASS RESISTOR






Created with the Personal Edition of HelpNDoc: Experience the power of a responsive website for your documentation