Author Topic: Help With a 32-Bit AEK II PCB  (Read 3908 times)

0 Members and 1 Guest are viewing this topic.

Offline Solastice

  • Thread Starter
  • Posts: 13
Help With a 32-Bit AEK II PCB
« on: Mon, 02 January 2023, 16:23:44 »
Hey guys, this is my first time creating a pcb and I need advice.

I'm working on a AEK II PCB using a STM32 F3 MCU. The STM32F302ZDT6 to be exact (it's got 109 free pins minus the Crystal, USB, and Serial). I have the power circuitry settled. QMK should be compatible? I just need some advice on a few features.

1) I don't really know how to implement ESD protection for an STM32, or if I really need it

2) How to get usb pass through working?
 The AEK has two ports and I want them to work like they would on the original pcb, with the other acting as a pass through.
For the second port, do I just link it to the main usb data lines? and what about the CC pins?

You can find the schematic linked below

Offline simplycanada

  • Posts: 38
  • Location: canada
Re: Help With a 32-Bit AEK II PCB
« Reply #1 on: Mon, 02 January 2023, 17:19:55 »
tbh as I recall usb is point-to-point so you would have to designate one side as the computer host side and other end as the device side very specifically (as in eg you can't one day decide to plug computer onto left side then next day plug on the right side instead)

then after you have decided that you would need to add a small bus-powered 2-port usb hub (or a 2x2 4-port one is probably still as small pcb-wise) at the computer host side because one downstream port would go to the keyboard itself while the other downstream port would go to the device side port

if you want to really try design your own custom chip that would be smart enough to flip-flop the two usb ports without user input then it may be plausible (unrelated but I know some external modems that could figure out which two rj14 port was the actual one going to the wall likewise)

Offline Solastice

  • Thread Starter
  • Posts: 13
Re: Help With a 32-Bit AEK II PCB
« Reply #2 on: Mon, 02 January 2023, 18:19:20 »
I'm sorry, I'm new to hardware design. Basically, without creating a new chip, I would have to choose a side specifically as the host and the other would have to be a receiver?

Then I would have to wire both to an internal hub on the host side of the keyboard?

Is there a reference I can look at?

Also whats a 2x2 4-port? lol

Offline simplycanada

  • Posts: 38
  • Location: canada
Re: Help With a 32-Bit AEK II PCB
« Reply #3 on: Tue, 03 January 2023, 06:05:44 »
I wrote that just shortly before supper was ready then it was a long evening-night afterward sorry :-)

as for having to choose a specific host side yes thats correct, likewise to the hub too

as for reference mm well I think a bit of ascii may do it but let me know if a quick picture drawing would be better..
computer ---------> left(host) port on keyboard -> usb hub (first downstream port) -> right port on keyboard ---------> mouse/etc
[and the second downstream port on the hub would feed the keyboard pcb]

btw I know its not what your project was about now but solastice - just for as a future footnote .. some of the other apple keyboards that uses a fixed middle-located cable instead (such as the appledesign one) in theory would be more agnostic because the fixed cable -is- always the host cable and the other port(s) available on such keyboard in question are always downstream

Offline Solastice

  • Thread Starter
  • Posts: 13
Re: Help With a 32-Bit AEK II PCB
« Reply #4 on: Tue, 03 January 2023, 15:01:09 »
I see, I appreciate the help! It makes more sense now. I'all also keep that note in mind to, a center cable would mean having an additional port. If i was brave I would probably drill a hole in my AEK and do that lol :p.

For a usb hub, I could probably just use the same mcu right? wouldn't need another one.

Offline Applet

  • Posts: 487
  • Location: Sweden
Re: Help With a 32-Bit AEK II PCB
« Reply #5 on: Wed, 04 January 2023, 02:35:06 »
I had some feedback here: https://geekhack.org/index.php?topic=48851.msg3151270#msg3151270

For a USB-hub, you'd need a dedicated USB-hub IC. Something like a FE1.1, TUSB4020 or similar. You simply connect the STM32F302 to one of the USB-hub ICs downstream ports. I'd suggest to try and keep your first project as simple as possible, you can always make a second, enhanced version :)
« Last Edit: Wed, 04 January 2023, 02:45:24 by Applet »

Offline Solastice

  • Thread Starter
  • Posts: 13
Re: Help With a 32-Bit AEK II PCB
« Reply #6 on: Wed, 04 January 2023, 15:01:20 »
appreciate the feedback!