We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

aBUGSworstnightmare
Posts: 13432
Joined: Tue Jun 30, 2015 1:35 pm

Re: Small TFT based on ILI9341 ST7789 - how to use

Thu Oct 30, 2025 8:59 am

3.2.4. Graphic RAM (GRAM)
The GRAM is used to store the display pattern data with a maximum of 345,600 bytes for 320 (RGB) x 480 display
resolution.
come on dude ... where is your math? what does offset x or y result in?

One can try that on a 480x320pixels display for sure -> adding

Code: Select all

y-offset=20
to config.txt will result in a downward shift of the start position by 20 pixels, causing an overflow that will be shown on top
y-offset.jpg
y-offset=20 added -> shifted downwards
y-offset.jpg (229.87 KiB) Viewed 437 times
so, lets add

Code: Select all

x-offset=20
instead. What is the expected result? Right, an overflow to the right which will result in a skewed image because the 20pixels will be shifted from the end of line1 into the start of line2.
x-offset.jpg
x-offset=20 added -> skewed image as remaining pixels from each scan line will be shifted into the next scan line. Check the RAM addressing in the datasheet
x-offset.jpg (221.67 KiB) Viewed 437 times
Still having the changed start position (x-offset) in my config.txt I will leave it to you to figure out how to achieve a stable image anyway :idea:
x-offsetbutstable_whatsthetrick.jpg
x-offset=20 added to config.txt but stable anyway!
x-offsetbutstable_whatsthetrick.jpg (218 KiB) Viewed 437 times

robertojguerra
Posts: 114
Joined: Thu Dec 05, 2024 6:35 pm

Re: Small TFT based on ILI9341 ST7789 - how to use

Thu Oct 30, 2025 4:57 pm

Is the solution something related to the graphic ram access cmmands? (I just saw that the command opcodes are the same between st7796, ili9486 and ili9488)

command 0x2A 0x__ 0x__ 0x__ 0x__ #column address set
command 0x2B 0x__ 0x__ 0x__ 0x__ #page address set

Do you have your lines and columns in reverse order for 180 degree rotation?

command 0x36 0x20 #memory access control. 0x20 pins right. 0xE0 pins left

Is the solution involving the timing parameters in the DTS?
hback-porch = <0>;
vback-porch = <0>;
hfront-porch = <0>;
hsync-len = <0>;
vfront-porch = <0>;

aBUGSworstnightmare
Posts: 13432
Joined: Tue Jun 30, 2015 1:35 pm

Re: Small TFT based on ILI9341 ST7789 - how to use

Thu Oct 30, 2025 5:30 pm

robertojguerra wrote:
Thu Oct 30, 2025 4:57 pm
Is the solution something related to the graphic ram access cmmands? (I just saw that the command opcodes are the same between st7796, ili9486 and ili9488)

command 0x2A 0x__ 0x__ 0x__ 0x__ #column address set
command 0x2B 0x__ 0x__ 0x__ 0x__ #page address set

Do you have your lines and columns in reverse order for 180 degree rotation?

command 0x36 0x20 #memory access control. 0x20 pins right. 0xE0 pins left

Is the solution involving the timing parameters in the DTS?
hback-porch = <0>;
vback-porch = <0>;
hfront-porch = <0>;
hsync-len = <0>;
vfront-porch = <0>;
somehow, nope, nope and nope!

you are 2pixels off (x-offset=2) (with a CCC display) then i.e width=240 gets changed to width=238

robertojguerra
Posts: 114
Joined: Thu Dec 05, 2024 6:35 pm

Re: Small TFT based on ILI9341 ST7789 - how to use

Fri Oct 31, 2025 6:25 am

Ok, I figured it out... to have a 2 pixel offset to the right, we need in the config.txt:

dtoverlay=mipi-dbi-spi-format-parameter,spi0-0,speed=60000000
dtparam=compatible=4in0円panel-mipi-dbi-spi
dtparam=width=478,height=320,width-mm=35,height-mm=28
dtparam=reset-gpio=25,dc-gpio=24
dtparam=write-only,cpha,cpol
dtparam=format=b6x2g6x2r6x2
dtparam=x-offset=2
dtoverlay=ads7846,cs=1,penirq=23,speed=1000000,keep_vref_on=1,swapxy=1,xohms=60

Now all the console characters show 100%, and the cursor doesn't get shaved off in the GUI :D

aBUGSworstnightmare
Posts: 13432
Joined: Tue Jun 30, 2015 1:35 pm

Re: Small TFT based on ILI9341 ST7789 - how to use

Fri Oct 31, 2025 8:58 am

robertojguerra wrote:
Fri Oct 31, 2025 6:25 am
Ok, I figured it out... to have a 2 pixel offset to the right, we need in the config.txt:

dtoverlay=mipi-dbi-spi-format-parameter,spi0-0,speed=60000000
dtparam=compatible=4in0円panel-mipi-dbi-spi
dtparam=width=478,height=320,width-mm=35,height-mm=28
dtparam=reset-gpio=25,dc-gpio=24
dtparam=write-only,cpha,cpol
dtparam=format=b6x2g6x2r6x2
dtparam=x-offset=2
dtoverlay=ads7846,cs=1,penirq=23,speed=1000000,keep_vref_on=1,swapxy=1,xohms=60

Now all the console characters show 100%, and the cursor doesn't get shaved off in the GUI :D
you nailed it!

Return to "Interfacing (DSI, CSI, I2C, etc.)"

AltStyle によって変換されたページ (->オリジナル) /