Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 17:23 05 Dec 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : The ILI9341 display rotates the coordinates.

Author Message
v.lenzer
Regular Member

Joined: 04/05/2024
Location: Germany
Posts: 64
Posted: 10:29pm 04 Dec 2025
Copy link to clipboard 
Print this post

My new project, "Human Radar" (https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=18438), uses a 320x240 ILI9341 display.

With these options:

PicoMite MMBasic RP2040 Edition V6.00.03

OPTION SYSTEM SPI GP6, GP3, GP4

OPTION AUTORUN ON

OPTION COLOURCODE ON

OPTION CPUSPEED (KHz) 200000

OPTION LCDPANEL ILI9341, LANDSCAPE, GP7, GP2, GP5
everything works perfectly.





Now I've bought four more displays from AliExpress, which also use the ILI9341 display driver. They look like the display I'm currently using. However, it appears they're using portrait mode, even though landscape is selected. The small red dot on the left side of the display in the radar grid isn't red, as it should be, but blue.





I've tried all the available settings for the ILI9341 (L, P, RL, RP). The display rotates, but it's not using the full 320 x 240 pixels. It looks like it's using 0-240 for X and 0-320 for Y.

Does anyone have any suggestions on how I can use this display with a different setting?
Best wishes! Joachim
 
v.lenzer
Regular Member

Joined: 04/05/2024
Location: Germany
Posts: 64
Posted: 10:37pm 04 Dec 2025
Copy link to clipboard 
Print this post

Backside of the "good" ones.





Backside of the "bad" ones.



Edited 2025-12-05 08:41 by v.lenzer
Best wishes! Joachim
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1066
Posted: 11:01pm 04 Dec 2025
Copy link to clipboard 
Print this post

The Red/Blue reversal should be fixed by using the INVERT parameter when the display is setup.
OPTION LCDPANEL .................,INVERT

You can adjust the driver setting after it initiates using
POKE DISPLAY command [,data1]
command &H36 is the likely area you need to adjust. e.g.
POKE DISPLAY &H36,xx

This from the source might help help working out how to swap Landscape/Portrait after it is loaded.

#define ILI9341_MEMCONTROL 0x36
#define ILI9341_MADCTL_MY 0x80
#define ILI9341_MADCTL_MX 0x40
#define ILI9341_MADCTL_MV 0x20
#define ILI9341_MADCTL_ML 0x10
#define ILI9341_MADCTL_RGB 0x00
#define ILI9341_MADCTL_BGR 0x08
#define ILI9341_MADCTL_MH 0x04

// ILI9341 Orientation Modes
#define ILI9341_Portrait (ILI9341_MADCTL_MX | ILI9341_MADCTL_BGR)
#define ILI9341_Portrait180 (ILI9341_MADCTL_MY | ILI9341_MADCTL_BGR)
#define ILI9341_Landscape (ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR)
#define ILI9341_Landscape180 (ILI9341_MADCTL_MY | ILI9341_MADCTL_MX | ILI9341_MADCTL_MV | ILI9341_MADCTL_BGR)
F4 H7FotSF4xGT
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025