A tiny bridge board that does not require a driver to work on FreeBSD........... - Page 1
Forum section: electronics / general

author: ziomario
author_rank: Contributor
timestamp: June 08, 2025, 09:59:19 am
content: Hello.I'm looking for a small touchpad to add to the FreeBSD based phone that I'm trying to build,that will use the radxa zero 3W.I found one nice touchpad that has a size of 1.6 x 1.6 cm :https://www.cirque.com/news-and-events-blog/2023/11/13/cirque-creates-the-worlds-smallest-trackpadThe problem iis that currently it supports only I2C. So,what I need is an adapter or a tiny bridge board that converts I2C lines (on the Cirque touchpad) into an USB-HID adapter because I don't want to solder the wires to the board,but I want to connect the touchpad to the radxa board via USB. The electronic layout that I have in mind is the one attached with the name of "sample.png".I'm looking one adapter and a driver that works on FreeBSD. Better if it is already exists for sure than that I should ask to someone to write it from scratch. Even better is if no driver is required.I tried to look for the right combination between adapter and driver and I found this thread :https://forums.freebsd.org/threads/an-adapter-or-a-tiny-bridge-board-with-a-driver-that-works-on-freebsd-that-can-convert-the-i2c-lines-of-the-cirque-touchpad-into-an-usb-hid-adapter.98068He talked about the adapter below,that can be bought even today :https://www.adafruit.com/product/2264He says :Quoteok. its encouraging. But later the situation becomes more complicated,when he says :Looking at the actual DTB is a good way to troubleshoot problems. Like seeing what bus is where.QuoteBecause I don't have the skills to play with the dtb. So. Can you tell me why the touchpad that I've chosen until now for the phone,this one :https://www.ergonomictouchpad.com/mini_touchpad.phpworks out of the box even on FreeBSD without the needing to install a driver ? I've just attached it via USB on my FreeBSD 14.2 system now and sbam,it worked.What technology it uses to don't requires a driver ? and most of all,its technology can be "translated / added" toi the cirque touchpad for making it work out of the box,on FreeBSD,without requiring any driver like it happens when I use the Ergonomic Touchpad ?Thanks.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 08, 2025, 05:02:13 pm
content: Quote from: ziomario on June 08, 2025, 09:59:19 amThe USB HID device class, which it uses to describe itself as a pointer device with the appropriate properties so the host can treat it as such without a specialized driver.Quote from: ziomario on June 08, 2025, 09:59:19 amYou'd probably want to implement a HID pointer device in a microcontroller instead of using a generic bridge interface like the FT232H.

author: ziomario
author_rank: Contributor
timestamp: June 08, 2025, 05:44:01 pm
content: QuoteI think yes. Does already exists a board or a circuit that does it ? I can't ask to an engineer to develop it from a scratch,it will cost a lot of money.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 08, 2025, 07:30:44 pm
content: Quote from: ziomario on June 08, 2025, 05:44:01 pmThe hardware for it can be most anything... there's a huge selection of microcontrollers that have USB & I2C, and that's really all you need there. I don't think there's any single standard protocol for pointer devices over I2C though, so you'll need to figure out what yours uses. I'd start from the docs & any sample code they provide. The easiest approach would be if they already have a sample for usb and you can select hardware based on what it supports.

author: ziomario
author_rank: Contributor
timestamp: June 08, 2025, 09:48:22 pm
content: What about to add the "Adafruit Mini I2C Gamepad with seesaw - STEMMA QT / Qwiic" instead of the cirque touchpad ?I don't have totally clear in mind how it works and what products should I buy and embed together,but I guess these ones :a) Adafruit Mini I2C Gamepad with seesaw - STEMMA QT / Qwiicb) STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable - 150mm Longc) Adafruit Qwiic / Stemma QT 5 Port HubI will try to embed everything inside the enclosure of my DIY FreeBSD based phone.They don't talk about an USB connection. It does not seem to be necessary. The driver should be here :https://github.com/adafruit/Adafruit_CircuitPython_seesawSince it has been written in Python,should work easily on FreeBSD ?

author: abeyer
author_rank: Frequent Contributor
timestamp: June 08, 2025, 11:51:28 pm
content: Quote from: ziomario on June 08, 2025, 09:48:22 pmNo, that'sCircuitPython, which is different from the traditional desktop cpython interpreter. It normally expects to run bare metal without an OS on embedded hardware. There is an SBC compatibility layer for it called blinka, but I've only ever seen it on linux, dunno if there's any BSD support. Even if it does work under FreeBSD, it's still not going to behave as a mouse, you'll just have a library that can read the data from the device. You will still need to write a mouse driver that translates that for the os.Quote from: ziomario on June 08, 2025, 09:48:22 pmAt the end of the day there's nothing special about USB that makes itnecessary... However it sounds like what you're after is something that you can plug together modules and get a working mouse without custom hardware or custom software.Quote from: ziomario on June 08, 2025, 09:48:22 pmGiven buying and combining off the shelf products seems to be the goal, just starting from something that works as a USB mouse is going to be far easier than anything you're proposing here. What's the problem with the one you already had working?

author: ziomario
author_rank: Contributor
timestamp: June 08, 2025, 11:57:54 pm
content: I'm complicating my life because I didn't find the right product to add to my phone,yet : a small USB touchpad or trackpad and / or a small USB keyboard with a touchpad / trackpad integrated. This one works out of the box (already tried) :https://www.ergonomictouchpad.com/mini_touchpad.phpbut I don't like its size (3.5.x 3.5 cm is too big for me) and when I touch it the mouse movements aren't precise and comfortable.I'm looking for a better product.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 09, 2025, 12:09:44 am
content: I kind of doubt anything much smaller than that first one you linked at the beginning of the thread would actually make an effective mouse anyway... it's only 34x28 mm already. I don't know of anything smaller you're going to find as a finished module.

author: ziomario
author_rank: Contributor
timestamp: June 09, 2025, 12:20:25 am
content: Yes. The cirque touchpad of 1.6 mm x 1.6 mm is the best choice. But it isn't USB natively,but I2C. It means that I should find the way to let FreeBSD "think" that it is USB,so that it uses its own driver. Well,I'm on upwork,trying to hire an engineer who wants to do that,but the amount of money asked is too high for me.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 09, 2025, 08:50:41 pm
content: ?Radxa Zero 3W does have I²C on the pin header, for example pins 27 (I2C4 SDA) and 28 (I2C4 SCL), and on pins 29 (I2C5 SCL) and 31 (I2C5 SDA). GND is nearby on pins 25, 30, and 34, and +3.3V on pin 1 and 17. I'd use 17 (+3.3V), 29 (SCL), 30 (GND), and 31 (SDA), because 27-28 can also be configured as an extra USB 2.0 port by removing two 0 Ohm resistors (R32 and R39) and adding two 0 Ohm resistors (to R45 and R46). All this is explained in the documentation, in theHardware Interface Section. To enable the I2C (I2C5) functionality, you probably will need to use a Device Tree overlay. The I2C – HID bridge is then completed by theiichiddriver in FreeBSD; although if the I²C commands differ, some modifications may be necessary.That said, I do prefer to use standard USB interfaces myself, here USB HID Touch Pad (Digitizer page), which all OSes should support with standard class drivers. I think a WCH CH32X033 or CH32X035 would be very suitable, having native USB 2.0 (Full Speed), one I²C bus, and requiring only some supply bypass capactors to work. LCSC, JLCPCB, and WCH sell these for less than 1€ apiece, so the cost is low even in singles. If you have 3.3V available separately, the USB 5V VBUS does not need to be used; otherwise you need to regulate the VBUS down to 3.3V because that's the maximum your touchpad accepts. (CH32X033 and CH32X035 can be powered from 3.0V to 5.3V with USB functionality.)Personally, I would move the two 0 Ohm resistors, and use pins 17 (3.3V), 25 (GND), 27 (D+), 28 (D-) for this USB, keeping the wires as short as possible. If I understood correctly, no software or kernel configuration changes are needed to enable this extra USB 2.0 bus.Stefan Wagner has developedCH32X033 USB Knob, licensed underCC BY-SA 3.0, which implements some individually programmable RGB LEDs and a rotary knob, exposed as a standard multimedia keyboard via USB HID, programmed in the PlatformIO environment. While this is not suitable for you for this exact purpose, it is of comparable complexity (implementing a different USB HID device). In particular, you can see how the USB HID functionality is implemented, even though your descriptor and reports are slightly different.

author: ziomario
author_rank: Contributor
timestamp: June 09, 2025, 09:25:04 pm
content: So,ok. It seems to me that the Adafruit's idea is too much complicated. Is not easier to do something like in the scheme that you see on the attached picture called "sample.png" ? You can see which components could be used on the picture called "Screenshot_2025-06-08_17-05-51.jpg"...Which kind of problems and difficulties there could be trying to implement that ?

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 10, 2025, 02:20:17 am
content: Quote from: ziomario on June 09, 2025, 09:25:04 pmWith a WCH CH32X033 or CH32X035, you replace the middle board with a very simple custom one, and the USB-C cable with four (short) wires to the 40-pin header. You can also make the small middle board sit directly on the pin header, perhaps on the bottom side; it doesn't need much room. You can of course use an USB-C cable also, but you only have two USB-C ports –– one USB 2, one USB 3 –– so I'd suggest using those for something more important.It's not a complicated board. I grabbed the same MOLEX 525590633 as used in the Circle Trackpad Development Kit, and drew up a 23mm×15mm board that mounts on the backside of the Radxa Zero 3W, using the USB 2.0 pins on the header, requiring removing two resistors and soldering them elsewhere, as explained in theRadxa Zero 3W Hardware interface page. BOM cost is under $1.20 at JLCPCB assembly, and most of that is the MOLEX connector. Using a horizontal 6-pin FFC at 0.5mm pitch would be better. You could also use the unused pins on the CH32X033 for e.g. touch detection or buttons or something –– producing HID keyboard or multimedia keyboard events ––, so your actual board might look somewhat different. (The same board can implement USB HID Touchpad and USB HID Keyboard, no problem.) This is just an example of how simple the PCB should be. And I've already shown you a link to what the HID code in a similar project is like.Before you ask, no, Icannotdo this for you. I suffer from a self-inflicted mental problem (side effect of repeated burnout and depression) that makes me utterly lock up and not be able to do anything, if Ipromise, or agree to produce results, or somebody expects something from me. I am only able to help when nobody expects me to.

author: ziomario
author_rank: Contributor
timestamp: June 10, 2025, 09:26:17 am
content: I'm a psychologist...I can understand.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 11, 2025, 12:39:02 am
content: I wish I could, because it is in fact been my hobby for many years now to add all kinds of USB-connected human interface stuff –– mostly small displays (up to 4" or so), buttons and rotary encoders, USB HID stuff –– to Linux-based appliances like routers, NAS boxes, print servers, firewalls, et cetera; the idea being to help non-technical humans observe the appliance status easier: easily observed overall status and likely problem points. While FreeBSD and Linux differ, they are quite similar for these.My next project is either a Radxa Rock 3B or OrangePi RV2 with 4G/LTE modem via USB (ADT-Link WS17, I already have a couple of mini-PCIe modems), and some kind of small display using DSI, USB, or SPI/I²C bus.I particularly like the idea of using a round display with capacitive touch, for example BuyDisplayER-TFT1.28-3, 1.28" 240×240controlled via SPI, 30mA 2.9-3.1V backlight, I²C for touch, and 4-wire SPI for data. Outer diameter is 42.50mm with capacitive touch panel, active area diameter is 32.40mm; connector is a 15 pin FPC at 0.5mm pitch, and includes the touch panel I²C signals. TheGC9A01A controllerit uses is rarer, but well documented and close enough to ILI9341 et cetera so support is not an issue. It has a particularly high maximum data clock (100 MHz, 10ns write cycle time), so at 16 bit color (where each frame is 2×240×240 = 115200 bytes < 950,000 bits per frame including command overhead, frame update rate isn't limited by the data flow. While the Tear Effect pin is not exposed, the controller does support the Get Scanline command, so properly written display update will not show any artefacts. The limitation is that the MCU used really should have at least 128k of RAM, preferably more, for a full framebuffer.Radxa Zero 3W could directly connect to that display module using for example pins 17 (+3.3V), 18 (backlight PWM), 19 (MOSI/DO), 20 (GND), 21 (RS), 22 (Reset for both display and touch controllers), 23 (CLK), 24 (CS), 29 (SCL), (30 GND), 31 (SDA), 32 (INT); it would only need a suitable connector board to connect aforementioned pins to the correct pads on the 15-pin 0.5mm pitch FFC connector, plus a kernel or userspace driver. It might be worth testing.For two-lane MIPI DSI, BuyDisplay has a very interesting (but much more expensive)ER-TFT021-2, 2.1" 480×480round display with capacitive touch and 60mA 3.2V backlight. Outer diameter with the touch is 60mm, active area diameter 53mm. This will also need an FPC adapter board with the Radxa Rock 3B / OrangePi RV2 (both have MIPI DSI connectors, but with an incompatible pinout), plus backlight control.I currently have some 320×240 displays (2.4" ER-TFT024IPS-3,2.8" ER-TFT028A2-4(favorite), and3.2" ER-TFT032IPS-3.2) with parallel data bus, that I can control from a Teensy 4.0 which has a megabyte of RAM, and a High-Speed USB interface (over 25 MBytes/sec), and can display 16-bit graphics at full 70 fps generated by the host (or by Teensy itself). I just believe that with round displays, I can get rid of some of the preconceptions regarding computer appliances, and use cartoonish humor and a round display (specifically, using Tux, my mascot) to describe the current state in a more intuitive fashion. Animation, not diagrams.All the linked displays have IPS panels, having very wide viewing angles, and don't suffer from visual distortion unless you view them from exactly the correct angle.For backlight, I've done many things (even started threads about it here), but I want to next testTI TPS92201Abuck driver with ultrasonic PWM support (no flicker, no whine). It's cheap and rated for huge currents (1500mA), but should work fine for 60mA – 120mA, too. IthinkI can solder the SOT-5x3 package by hand; it is 0.5mm pitch, but just 6 legs, under 2mm×2mm total size including those leggies.

author: ziomario
author_rank: Contributor
timestamp: June 11, 2025, 07:30:41 am
content: ---> I wish I could, because it is in fact been my hobby for many years now to add all kinds of USB-connected human interface stufflike me. I'm trying to assemble a modular USB based phone.---> My next project is either a Radxa Rock 3B or OrangePi RV2 with 4G/LTE modem via USB (ADT-Link WS17, I already have a couple of mini-PCIe modems), and some kind of small display using DSI, USB, or SPI/I²C bus.I have the same project,but using the radxa zero 3W,that's more low profile. And I've chosen another modem.---> I particularly like the idea of using a round display with capacitive touch, for example BuyDisplay ER-TFT1.28-3, 1.28" 240×240 controlled via SPII prefer HDMI displays.---> Radxa Zero 3W could directly connect to that display module using for example pins 17 (+3.3V), 1I don't want to solder any wire to the radxa board. I want only attach some devices to the usb-c port with an USB hub.