-1

I use a Hyperpixel 4.0 touchscreen in combination with my custom ComputeModule4 board. I've seen on the CM4 that there is one more I2C-Bus on GPIO's 44&45 which could be used. Is there any possibility to use this I2C-Bus for my touchscreen-driver? With the implementation of the touchscreen, there will normally be generated a software-wise I2C-Bus on GPIO's 10 & 11 but because I now have one "real" i2c-bus left on the GPIO0s 44&45, I'm really interested in using this "real" I2C-Bus.

So my question: How or where do I change these settings? What do i have to take into consideration while making these changes.

Here is my current /boot/config.txt file before I made any changes at the i2c muxxing. Maybe it helps?

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=off
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Disable compensation for displays with overscan
disable_overscan=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]
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
[all]
dtoverlay=hyperpixel4
enable_dpi_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x7f216
dpi_timings=480 0 10 16 59 800 0 15 113 15 0 0 0 60 0 32000000 6
1
  • 1
    I note that you have asked 8 questions (most about related issues) but have not accepted any of the answers.
    – Milliways
    Commented Jan 14, 2023 at 22:13

2 Answers 2

2

You can change i2c0 in the usual manner using Device Tree overlay:-

dtoverlay -h i2c0
Name:   i2c0

Info:   Change i2c0 pin usage. Not all pin combinations are usable on all
        platforms - platforms other then Compute Modules can only use this
        to disable transaction combining.
        Do NOT use in conjunction with dtparam=i2c_vc=on. From the 5.4 kernel
        onwards the base DT includes the use of i2c_mux_pinctrl to expose two
        muxings of BSC0 - GPIOs 0&1, and whichever combination is used for the
        camera and display connectors. This overlay disables that mux and
        configures /dev/i2c0 to point at whichever set of pins is requested.
        dtparam=i2c_vc=on will try and enable the mux, so combining the two
        will cause conflicts.

Usage:  dtoverlay=i2c0,<param>=<val>

Params: pins_0_1                Use pins 0 and 1 (default)
        pins_28_29              Use pins 28 and 29
        pins_44_45              Use pins 44 and 45
        pins_46_47              Use pins 46 and 47
        combine                 Allow transactions to be combined (default
                                "yes")

It is possible to change baudrate.

NOTE the BCM2711 has multiple I²C devices, which are well documented in /boot/overlays/README

2
  • Thank you for your response. I think with these overlays I'm on the right path, but it doesn't seem to work at the moment. Before I changed any settings, in the "/dev" folder there appears only i2c-22. After creating your described overlay by typing "dtoverlay=i2c0,pins_44_45" into the config file, there has been created another file in the "/dev" folder calles i2c-22. Unfortunately my touchscreen only works if i wire the i2c on gpio's 10&11 (pins 19&23). What do I do wrong? Commented Jan 15, 2023 at 15:39
  • i2c-22 is the parent hardware block for i2c-0 and i2c-10, as they are just alternate pinmuxing options for the one block. This should be ignored as it has no defined GPIOs to expose it to the outside world, and will just use whichever of i2c-0 and i2c-10 that was last used.
    – Milliways
    Commented Jan 15, 2023 at 23:02
2

The I2C pins on the touch controller are wired to the software I2C pins (GPIO 10 & 11) on the display. Nothing you can do in software can move these PCB traces. The i2c_gpio driver that is loaded by the hyperpixel's dtbo is the only way to access that controller, unless you fancy duplicating those header pins on pins that do support hardware i2c. However, bitbang I2C is plenty fast for a touchscreen IC, so it really should not be an issue. You can use the I2C bus in bank 1 to drive other hardware that may be more timing-critical.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.