Electronics > Microcontrollers

Design suggestions for split keyboard

(1/8) > >>

eigenvektor:
Hi,
I'm designing a split keyboard (each hand has it's own half keyboard) and was wondering how to approach this.
I want each half to have 2 usb c ports, one at the top to connect to the computer and one on the side to connect the other keyboard half. The goal would be that each half can be used independent,
or slaved to a half connected to the computer.

My original plan was using a pic18f24k50 8bit microcontroller supporting 1 USB connection. The top usb c port would get the usb connection, while the side-usb port would be connected to UART on the mc. (UART would be stepped down from 5v to 3v3 using a logic level converter to conform to USB specifications).

With the recent hype for the wch RISC V mcus I've thought about using a CH32V203 instead. It's cheaper, supports 2 USB connections (1 device and 1 host/device), is 32 bit, much faster and more memory. However the packaging options aren't great: a QSOP28 package is too large, QFN48 would fit but it seems ridiculous to use such a package for half a keyboard.

Are there any other low cost MCU's I should consider or should I approach this in a different way? This is my first microcontroller project and figuring out what should happen when 2 keyboard halves are connected over USB sounds a bit complicated. I've attached a schematic to hopefully make this easier to understand.
Thanks!

ejeffrey:

--- Quote from: eigenvektor on February 03, 2023, 08:23:53 pm ---My original plan was using a pic18f24k50 8bit microcontroller supporting 1 USB connection. The top usb c port would get the usb connection, while the side-usb port would be connected to UART on the mc. (UART would be stepped down from 5v to 3v3 using a logic level converter to conform to USB specifications).

--- End quote ---

Do you mean you would run the UART over a USB-C connection, or that you would use a USB->UART adapter chip like the FT232 family?

If the former, please don't.  USB type C is confusing enough as is, don't put a non-USB USB port on devices.

If the latter, that won't work.  USB does not support "peer to peer" connectivity.  All communication is from 1 host to 1 device.  The FT232 USB chips are devices, not hosts.



--- Quote ---With the recent hype for the wch RISC V mcus I've thought about using a CH32V203 instead. It's cheaper, supports 2 USB connections (1 device and 1 host/device), is 32 bit, much faster and more memory. However the packaging options aren't great: a QSOP28 package is too large, QFN48 would fit but it seems ridiculous to use such a package for half a keyboard.

Are there any other low cost MCU's I should consider or should I approach this in a different way? This is my first microcontroller project and figuring out what should happen when 2 keyboard halves are connected over USB sounds a bit complicated. I've attached a schematic to hopefully make this easier to understand.
Thanks!

--- End quote ---

I would avoid implementing a USB host if possible.  The easiest solution is to use a UART for side-to-side communicaiton, just over a different connector than USB-C.  This could be anything: M8, RJ11, RJ45 all have common pinouts for serial connections.  Alternately, you could use a USB hub chip and add a downstream hub port to each half.  This would provide extra utility since you could use the extra port for anything (like a USB flash drive or security key), but would mean that the correct way to chain them is to connect the top port of one to the side port of the other, not side-to-side.

Finally, keep in mind that (at least traditionally) BIOS had quite limited device compatibility for boot time input devices like mice and keyboards.  I think modern EFI systems have greater compatibility, but you may have trouble using your non-conventional keyboard for BIOS/EFI.

thm_w:
You are making this far too complicated. Just have the one main USB port on either the left or right side.
Also, using any micro thats not supported by QMK will make your life about 10x harder: https://github.com/qmk/qmk_firmware/blob/master/docs/compatible_microcontrollers.md
Assuming you are interested in that featureset.

If you are dead set on using a USBC connector for serial connection between the two sides, just go for it. Don't really care if its non-compliant, its not like you are selling it as a product.

ejeffrey:
One more thing:


--- Quote ---QFN48 would fit but it seems ridiculous to use such a package for half a keyboard.

--- End quote ---

I wouldn't worry about the package at all.  That chip may or may not be a good fit, but don't worry about the package, as long as you are able to assemble it.

eigenvektor:
Sorry for the late reply, didn't have WiFi on my bus.

Classically, these types of keyboards are connected with UART over TRRS aux cable. This isn't hot swappable however, as pulling it out causes a short. I wanted to go with usb c as it just seems elegant having everything connected with usb c to usb c cables.
So yes I meant running the UART over USB-C and telling the user to pretty please not plug it into anything else. Hence stepping down the voltage, never trust em :P


--- Quote ---The easiest solution is to use a UART for side-to-side communicaiton, just over a different connector than USB-C.

--- End quote ---
I need a slim connector, the attached render of an older version shows what it's gonna look like. There's not much space for anything other than usb micro / c.

Depending on how it turns out selling it is an option.

As for assembly: board will be entirely single sided smd components, though I have soldered larger pitch QFN packages with an iron already.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod