Need help with TMK.
-
- Location: Beli Manastir
- DT Pro Member: -
Hi
I need some help with understanding and installing TMK firmware on Teensy 3.0
My first goal is to install one of TMK keyboards on Teensy 3.0 and ultimately write my own firmware based on TMK.
1. What does change in Build Firmware and Program Controller for Teensy 3.0 (ARM processor MK20DX) ?
2. What changes do I need to make in tmk_keyboard/keyboard/ to make it work for Teensy 3.0 ?
3. What does converter do? Do I need to have it when making my own firmware?
4. Where can I learn more about making a keyboard firmware?
As you can see by the question I am noob here and my knowledge about keyboards is almost non-existing.
I need some help with understanding and installing TMK firmware on Teensy 3.0
My first goal is to install one of TMK keyboards on Teensy 3.0 and ultimately write my own firmware based on TMK.
1. What does change in Build Firmware and Program Controller for Teensy 3.0 (ARM processor MK20DX) ?
2. What changes do I need to make in tmk_keyboard/keyboard/ to make it work for Teensy 3.0 ?
3. What does converter do? Do I need to have it when making my own firmware?
4. Where can I learn more about making a keyboard firmware?
As you can see by the question I am noob here and my knowledge about keyboards is almost non-existing.
-
- Location: Austria
- DT Pro Member: -
You need an ARM crosscompiler and tools instead of the Atmel toolchain.Maybeplanck wrote: Hi
I need some help with understanding and installing TMK firmware on Teensy 3.0
My first goal is to install one of TMK keyboards on Teensy 3.0 and ultimately write my own firmware based on TMK.
1. What does change in Build Firmware and Program Controller for Teensy 3.0 (ARM processor MK20DX) ?
Change the Atmel specific code to ARM code.
No, you don't need it if you're controlling the keyboard 'directly'.
Depend's on what exactly you want to know.
-
- Location: Beli Manastir
- DT Pro Member: -
Will this work https://launchpad.net/gcc-arm-embedded/+download ?You need an ARM crosscompiler and tools instead of the Atmel toolchain.
What that code would be for gh60? Is there any tutorial for doing that?Change the Atmel specific code to ARM code.
I want to make firmware from ground up but i don't know where to start.Depend's on what exactly you want to know.
- jou
- Location: Switzerland
- Main keyboard: Ergodox
- Main mouse: Apple Magic Trackpad
- Favorite switch: Not sure yet
- DT Pro Member: -
Yep, that's the toolchain you need for embedded ARM.Maybeplanck wrote:Will this work https://launchpad.net/gcc-arm-embedded/+download ?You need an ARM crosscompiler and tools instead of the Atmel toolchain.
GH60 already has a controller (an ATmega32U4) on it, so you don't need a teensy to drive the keyboard. You'd need the Teensy if you're going to build your keyboard from the ground up (e.g. by hand wiring it).
If you're just starting out, it's probably easier to start with an ATmega (e.g. a Teensy 2.0) since that what TMK supports best and it's more commonly used for DIY keyboards.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
That's a very tall order.
If you're just starting to learn, TMK is not the best way to start - by now it's quite complicated, the source code is not very transparent, because the goal wasn't transparency, but modularity. TMK has several layers, and in some layers there are several (mutually exclusive) possibilities of what code will actually be used (and all this is configurable in the Makefiles).
There are three "basic" layers: 1) communicating with the MCU's USB controller; 2) reading the matrix, etc; and 3) the keyboard/layout logic.
The first two are MCU-dependent, the last one is not. This separation by itself introduces quite a bit of complexity into the code.
Traditionally, 1) and 2) are done for ATMEL's AVR8 MCUs (e.g. atmega32u4) and this is by now extremely well tested code.
There are now two options for 1) and 2) for ARM MCUs (e.g. the ones that are in the Teensies 3.x or LC): one based on mbed, and one based on chibios. This code is not well tested yet, and has been integrated into TMK only recently.
---
It all pretty much depends on how much experience you have with programming microcontrollers (both AVR and ARM).
EDIT: I'm not aware of any good guides out there, I learned the stuff by studying existing code, but definitely not TMK. Good places to look are Teensyduino sources and some examples on PJRC website. However this already assumes that you have a very good background in how the MCUs work, can look up things in datasheets and things like that. There's a lot more relevant code for AVR8 than for ARM.
-
- Location: Beli Manastir
- DT Pro Member: -
I am trying to make keyboard from ground up, something similar to planck. I already have Teensy 3.0 so that's why I want to "convert" some of ATmega32U4 keyboards to MK20dx128.GH60 already has a controller (an ATmega32U4) on it, so you don't need a teensy to drive the keyboard. You'd need the Teensy if you're going to build your keyboard from the ground up (e.g. by hand wiring it).
Teensy 2.0 is a bit pricey, and I already have Teensy 3.0If you're just starting out, it's probably easier to start with an ATmega (e.g. a Teensy 2.0) since that what TMK supports best and it's more commonly used for DIY keyboards.
There is Leonardo Pro Micro for $5 but only have 12 digital I/O and that's 36 keys.
I need at least 47 keys.
- flabbergast
- Location: Southampton, UK
- DT Pro Member: 0120
- Contact:
You'll save yourself a lot of headaches if you go with an atmega32u4-based board.Maybeplanck wrote:Teensy 2.0 is a bit pricey, and I already have Teensy 3.0If you're just starting out, it's probably easier to start with an ATmega (e.g. a Teensy 2.0) since that what TMK supports best and it's more commonly used for DIY keyboards.
There is Leonardo Pro Micro for $5 but only have 12 digital I/O and that's 36 keys.
I need at least 47 keys.
BTW on Arduino Pro Micro, pins A0 - A5 can be used as digital pins (it's just that they *also* have analog functionality), so that board has enough pins for a 47-key keyboard.
EDIT: There's a "onekey" example for Teensy 3.x in TMK mainline now, here (use Makefile.3.0).
-
- Location: Beli Manastir
- DT Pro Member: -
Well nice I didn't know I could use analog pins as digital.BTW on Arduino Pro Micro, pins A0 - A5 can be used as digital pins (it's just that they *also* have analog functionality), so that board has enough pins for a 47-key keyboard.
On Arduino Pro Micro I can only see A0-A3. A4 and A5 are PF0 and PF1 on ATmega32U4 but it seems they aren't connected anywhere. Can I solder directly on ATmega32U4 PF0 and PF1 and use them?
Edit: Looking at this Arduino Pro Micro pinout can I use pins TX and RX as I/O pins?
Last edited by Maybeplanck on 26 Feb 2016, 19:20, edited 1 time in total.
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
Sure, I don't see any reason why not (well except it's going to be hard mechanically).Can I solder directly on ATmega32U4 PF0 and PF1 and use them?
Pro Micro Schematic: http://cdn.sparkfun.com/datasheets/Dev/ ... o_v13b.pdf
Last edited by Halvar on 26 Feb 2016, 20:56, edited 1 time in total.
-
- Location: Beli Manastir
- DT Pro Member: -
Thank you so much for help.
I will order one Pro Micro
I will order one Pro Micro
- jou
- Location: Switzerland
- Main keyboard: Ergodox
- Main mouse: Apple Magic Trackpad
- Favorite switch: Not sure yet
- DT Pro Member: -
If you're desperate for additional IO pins, you can also solder to the resistor of the LEDs at the bottom (with the micro USB connector at the top). They're PB0 and PD5. They'd be a lot easier to solder onto than those QFN pads…
- Halvar
- Location: Baden, DE
- Main keyboard: IBM Model M SSK / Filco MT 2
- Favorite switch: Beam & buckling spring, Monterey, MX Brown
- DT Pro Member: 0051
Yes, no problem.Maybeplanck wrote: Edit: Looking at this Arduino Pro Micro pinout can I use pins TX and RX as I/O pins?