Display - ILI9341 Hardware Configuratoin The debugging board incorporates a graphical display based on the ILI9341 controller. This display serves as the primary local interface for presenting system state, diagnostics, and user feedback. The ILI9341 is a widely used TFT LCD controller that integrates display driving logic, internal GRAM (Graphics RAM), and a command-based interface over serial or parallel buses. In this system, it is used in SPI mode , which aligns with the board’s pin constraints and simplifies integration with the MCU. Functional Role in the System Within the debugging board, the display is responsible for: Rendering system status (connectivity, subsystem health, etc.) Displaying structured debugging information Providing immediate visual feedback to user input (button interactions) Supporting simple UI constructs (menus, indicators, overlays) The display is not intended for high-throughput graphics or complex rendering. Its role is informational and interactive , not graphical-intensive. Features of the ILI9341 The ILI9341 controller provides a set of features well suited for embedded applications. Resolution and Color Depth Resolution: 240 × 320 pixels Color depth: 16-bit RGB (RGB565) This provides sufficient resolution for: text rendering simple UI layouts basic graphical elements (icons, shapes) Internal GRAM (Frame Buffer) The controller includes internal Graphics RAM (GRAM) , which stores pixel data. The MCU does not need to maintain a full framebuffer Pixel data is written directly to the display over SPI The display retains the image until overwritten This significantly reduces RAM requirements on the MCU, which is critical in embedded systems. Command-Based Interface The display is controlled through a command/data protocol: Commands configure behavior (e.g., orientation, pixel format) Data writes update pixel values in GRAM Typical operations include: setting an address window writing pixel data issuing initialization sequences Display Orientation and Addressing The controller supports: configurable screen rotation (portrait / landscape) programmable address windows This allows: flexible UI layout efficient partial updates (writing only specific regions) Hardware Reset and Initialization The display requires: a hardware reset sequence a series of configuration commands during initialization These typically configure: power control gamma curves pixel format memory access control ILI9341 is a relatively complex and if you want to do anything with the internal library of it you need more than what can be written here. Read the official documentation MCU Configuration The SPI peripheral must be configured with: Mode: Full-Duplex Master Data size: 8-bit First bit: MSB-first Clock polarity: Low Clock phase: 1st edge NSS: Software Baud rate prescaler: selected based on display stability These settings must match the display’s timing requirements. For the baud rate, you want it to be as high as possible without it being unstable. For debugging and testing, it's good practice to lower it first, get it working there (as it is a lot more stable) and then increase it again.