Author Topic: How do I approach this?  (Read 3074 times)

0 Members and 1 Guest are viewing this topic.

Offline HeroXLazer

  • Thread Starter
  • Posts: 70
How do I approach this?
« on: Fri, 06 January 2017, 18:29:56 »
I want to design a custom controller (teensy for example) that incorporates the Atmega32u4, USB-C, Bluetooth, and two battery ports for load sharing. How do I approach this?

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: How do I approach this?
« Reply #1 on: Sat, 07 January 2017, 02:36:54 »
I would start by chosing what software you will use to design the PCB, have a play and read some tutorials.

Then read the datasheet for the 32u4 - is it suitable for your needs?  You might be better using the chip from the Teensy 2.0++ instead as it has more pins and more memory for firmware while being basically the same.  Or not (maybe it uses more power?  Do you need lots of pins with bluetooth or are you going for portable and not backlit?  If you have less pins and thus less switches you need more layers...)

USB is the same whatever connector you use so that's first to add (there's a schematic in the datasheet)  Start with a big PCB area so you can see everything clearly.

Then you need to find/design schematics for battery charging and bluetooth and add them.

Next cram everything into the smallest space possible - this is the hardest part.

Then lay out pads for all the IO pins and attach them to the controller chip - more trace routing fun.

Finally get a test sample made.  This will be expensive - there are usually price breaks at 10/25/50 units but who wants them if they don't work.  If you can hand solder everything that will keep the cost down but it's going to be small and cramped....


Easy to write out, not so easy to do :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline pomk

  • Posts: 470
  • Location: Finland
Re: How do I approach this?
« Reply #2 on: Sat, 07 January 2017, 03:12:51 »
May I ask why you ended up with 32u4? There are chips which cost less, perform better and allow for better battery life. Most bluetooth chips have integrated arm cores and it seems counter intuitive to have a lesser chip do the heavy lifting.

Offline HeroXLazer

  • Thread Starter
  • Posts: 70
Re: How do I approach this?
« Reply #3 on: Sat, 07 January 2017, 07:49:03 »
I can't find any Bluetooth LE chips with ARM cores and QMK/TMK support the 32u4, but if I find a BLE chip with ARM cores, then maybe.

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: How do I approach this?
« Reply #4 on: Sat, 07 January 2017, 08:42:13 »
I have not seen any firmware developer that has made his own USB device code. That is pretty hard to write and debug. Once that is available, the rest of the firmware is relatively simple. Relatively ...

TMK now supports the ARM Cortex M - based NXP Kinetis microcontrollers (same as Teensy 3.x) through code from Chibios, which is a lightweight realtime operating system.
Haata's Kiibohd controller supports the same microcontrollers, but by using PJRC's USB routines that have been modified for N-key rollover - compatible with both Windows, Linux and Mac. (Kiibohd could be interesting for that reason alone)

Personally I find 8-bit AVR nicer to program. I find the documentation to be better than for the Kinetis also.
Whenever/ifever I release my own firmware - that will be for the AVR only, because I wrote my own USB code for it. The Kinetis' Cortex M0 core might run at 3× the clock and have more flash but it also needs also all low-level USB protocol stuff to be done in software that the AVR does in hardware.

BTW, I came across the nRF51-series today but I have not read through it. There is an interest-check thread for a keyboard that uses it.
« Last Edit: Sat, 07 January 2017, 08:45:28 by Findecanor »

Offline pomk

  • Posts: 470
  • Location: Finland
Re: How do I approach this?
« Reply #5 on: Sat, 07 January 2017, 08:47:52 »
I can't find any Bluetooth LE chips with ARM cores and QMK/TMK support the 32u4, but if I find a BLE chip with ARM cores, then maybe.
What BLE chips have you then been looking at?

BTW, I came across the nRF51-series today but I have not read through it. There is an interest-check thread for a keyboard that uses it.
If you plan on making new development, you should focus on the nRF52, as it has even better performance and battery life.
« Last Edit: Sat, 07 January 2017, 08:50:39 by pomk »

Offline HeroXLazer

  • Thread Starter
  • Posts: 70
Re: How do I approach this?
« Reply #6 on: Sat, 07 January 2017, 09:01:20 »
I haven't looked yet tbh.

Offline HeroXLazer

  • Thread Starter
  • Posts: 70
Re: How do I approach this?
« Reply #7 on: Sat, 07 January 2017, 09:09:28 »
I can't find any Bluetooth LE chips with ARM cores and QMK/TMK support the 32u4, but if I find a BLE chip with ARM cores, then maybe.
What BLE chips have you then been looking at?

BTW, I came across the nRF51-series today but I have not read through it. There is an interest-check thread for a keyboard that uses it.
If you plan on making new development, you should focus on the nRF52, as it has even better performance and battery life.

Is the Cortex-M4F supported by TMK/QMK?

Offline pomk

  • Posts: 470
  • Location: Finland
Re: How do I approach this?
« Reply #8 on: Sat, 07 January 2017, 09:21:38 »
I can't find any Bluetooth LE chips with ARM cores and QMK/TMK support the 32u4, but if I find a BLE chip with ARM cores, then maybe.
What BLE chips have you then been looking at?

BTW, I came across the nRF51-series today but I have not read through it. There is an interest-check thread for a keyboard that uses it.
If you plan on making new development, you should focus on the nRF52, as it has even better performance and battery life.

Is the Cortex-M4F supported by TMK/QMK?
M0 is and the differences between the two is minimal (Firmware related differences. The performance is clearly superior on M4). The problem is that there is no HW support for USB on nRF52. A v-USB implementation should be possible or having some cheap other chip handle the USB communication. If the other chip would be active only when USB is connected, then the battery life for wireless mode could be pretty OK.

Offline HeroXLazer

  • Thread Starter
  • Posts: 70
Re: How do I approach this?
« Reply #9 on: Sat, 07 January 2017, 14:37:20 »
thx