- aBUGSworstnightmare
- Posts: 13432
- Joined: Tue Jun 30, 2015 1:35 pm
Re: Small TFT based on ILI9341 ST7789 - how to use
come on dude ... where is your math? what does offset x or y result in?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.
One can try that on a 480x320pixels display for sure -> adding
Code: Select all
y-offset=20- y-offset.jpg
- y-offset=20 added -> shifted downwards
- y-offset.jpg (229.87 KiB) Viewed 437 times
Code: Select all
x-offset=20- 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
- 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
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>;
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
somehow, nope, nope and nope!robertojguerra wrote: ↑Thu Oct 30, 2025 4:57 pmIs 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>;
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
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
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
you nailed it!robertojguerra wrote: ↑Fri Oct 31, 2025 6:25 amOk, 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
Return to "Interfacing (DSI, CSI, I2C, etc.)"
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion