Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4825

Interfacing (DSI, CSI, I2C, etc.) • Re: How to use round GC9A01 display with ILI9340 from M5Stack M5Dial

$
0
0
THANKS SO MUCH GUYS!

I finally got it to work! :)

For anyone else looking around: Here is the config I used.

m5dial.txt (which will be processed using Notro's python script):
(note the 2 commented commands where rotation and color format can be set)

Code:

# m5dial 1.28 inch 240*240px display# m5dial.txtcommand 0xEFcommand 0xEB 0x14command 0xFEcommand 0xEFcommand 0xEB 0x14command 0x84 0x40command 0x85 0xFFcommand 0x86 0xFFcommand 0x87 0xFFcommand 0x88 0x0Acommand 0x89 0x21command 0x8A 0x00command 0x8B 0x80command 0x8C 0x01command 0x8D 0x01command 0x8E 0xFFcommand 0x8F 0xFFcommand 0xB6 0x00 0x00# Display Orientation. Can be 0x18, 0x28, 0x48 or 0x88command 0x36 0x18# Color mode. Can be 0x03 (12bit), 0x05 (16bit) or 0x06 (18bit)command 0x3A 0x05command 0x90 0x08 0x08 0x08 0x08command 0xBD 0x06command 0xBC 0x00command 0xFF 0x60 0x01 0x04command 0xC3 0x13command 0xC4 0x13command 0xC9 0x22command 0xBE 0x11command 0xE1 0x10 0x0Ecommand 0xDF 0x21 0x0c 0x02command 0xF0 0x45 0x09 0x08 0x08 0x26 0x2Acommand 0xF1 0x43 0x70 0x72 0x36 0x37 0x6Fcommand 0xF2 0x45 0x09 0x08 0x08 0x26 0x2Acommand 0xF3 0x43 0x70 0x72 0x36 0x37 0x6Fcommand 0xED 0x1B 0x0Bcommand 0xAE 0x77command 0xCD 0x63command 0x70 0x07 0x07 0x04 0x0E 0x0F 0x09 0x07 0x08 0x03command 0xE8 0x34command 0x62 0x18 0x0D 0x71 0xED 0x70 0x70 0x18 0x0F 0x71 0xEF 0x70 0x70 command 0x63 0x18 0x11 0x71 0xF1 0x70 0x70 0x18 0x13 0x71 0xF3 0x70 0x70command 0x64 0x28 0x29 0xF1 0x01 0xF1 0x00 0x07command 0x66 0x3C 0x00 0xCD 0x67 0x45 0x45 0x10 0x00 0x00 0x00command 0x67 0x00 0x3C 0x00 0x00 0x00 0x01 0x54 0x10 0x32 0x98command 0x74 0x10 0x85 0x80 0x00 0x00 0x4E 0x00command 0x98 0x3e 0x07command 0x35 # "Tearing Effect Line ON"command 0x21 # "Display inversion ON"command 0x11 # "Sleep OUT"delay 120command 0x29 # "Display ON"delay 20
This uses the commands from the Arduino project (https://github.com/carlfriess/GC9A01_de ... n/GC9A01.c) -- NOT the ones from the M5Stack GitHub Repo which I added to one of my previous posts. Interesting.
--> convert to m5dial.bin and move to /lib/firmware/

Edit /boot/firmware/config.txt. The relevant part is only the last 5 lines, but for completeness, here's my whole config:

Code:

# For more options and information see# http://rptl.io/configtxt# Some settings may impact device functionality. See link above for details# Uncomment some or all of these to enable the optional hardware interfaces#dtparam=i2c_arm=on#dtparam=i2s=on#dtparam=spi=on# Enable audio (loads snd_bcm2835)dtparam=audio=on# Additional overlays and parameters are documented# /boot/firmware/overlays/README# Automatically load overlays for detected cameras#camera_auto_detect=1# Automatically load overlays for detected DSI displays#display_auto_detect=1# Automatically load initramfs files, if foundauto_initramfs=1# Enable DRM VC4 V3D driverdtoverlay=vc4-kms-v3dmax_framebuffers=2# Don't have the firmware create an initial video= setting in cmdline.txt.# Use the kernel's default instead.disable_fw_kms_setup=1# Run in 64-bit modearm_64bit=1# Disable compensation for displays with overscandisable_overscan=1# Run as fast as firmware / board allowsarm_boost=1[cm4]# Enable host mode on the 2711 built-in XHCI USB controller.# This line should be removed if the legacy DWC2 controller is required# (e.g. for USB device mode) or if USB support is not required.otg_mode=1[all]dtoverlay=mipi-dbi-spi,speed=40000000dtparam=compatible=m5dial\0panel-mipi-dbi-spidtparam=write-onlydtparam=width=240,height=240,width-mm=33,height-mm=33dtparam=reset-gpio=27,dc-gpio=25,backlight-gpio=18
As you can see, I also set "write-only" but omitted the "cpha" and "cpol" attributes. Since that worked fine, I didn't try using them.

Pin wiring for the display has not changed (see above), but now the M5Dial is also powered via the Raspberry Pi using two additional Pins:
  • 3V3 pin on the M5Dial connected to 3V3 pin on the Raspberry Pi
  • GND pin on the M5Dial connected to GND pin on the Raspberry Pi (I used the pin between G10 and G11 on the M5Dial and Pin #6 on the Raspberry Pi, haven't tested with the other GND pins)
Marking this thread as "solved". Now it's on to the M5Dial's rotary knob, push button and touch screen... wish me luck :D
Congrats!

a picture would be nice!

You can ZIP the m5dial.bin and attach the ZIP here for others. There is a big chance that these round displays will run with the same setup commands (as they may come from the same source).

Touch is FT3267 - a data sheet is here https://www.crystalfontz.com/controller ... T3267/513/ - which is communicating via I2C.

Statistics: Posted by aBUGSworstnightmare — Wed Feb 07, 2024 3:23 pm



Viewing all articles
Browse latest Browse all 4825

Trending Articles