geekhack

geekhack Projects => Making Stuff Together! => Topic started by: mkawa on Tue, 21 April 2015, 07:09:07

Title: Bluetooth add-on for Infinity controller
Post by: mkawa on Tue, 21 April 2015, 07:09:07
In the Smallfry Kit GB thread, we've been talking about adding support for a bluetooth low power add-on daughterboard based on the TI CC254x chipsets. I have the following two modules arriving to start developing a prototype implementation:

a teensy v3.1 (basically hardware-equivalent to the infinity controller topo)
an nBlue BRLE4.0-S3a surplused from sparkfun https://www.sparkfun.com/products/12991

the nblue unit is nice due to the flat mounting without the need for a bga-like solder pattern, comes pre-canned and FCC approved, and has a particularly nice chip-antenna.

We'll need some software and hardware hacking to build a full bluetooth add-on for the infinity:

1. a UART output module for the infinity firmware
2. custom firmware for the CC254x chipsets to support multiple bluetooth HID devices on a single channel
3. daughterboard mounting solution. AVX has a number of SMT poke-through low-profile board-to-board connectors that i have samples of. i don't expect to have enough space on the infinity PCBs for direct-mount SMT pads in the outline of the BR-LE, and it would be nice to have support for any CC254x-based BLE module.
Title: Re: Bluetooth add-on for Infinity controller
Post by: Greeeg on Tue, 21 April 2015, 07:56:06
Add more if I've missed something. Here is some useful information to the project.

Infinity code and massdrop PCB files.
https://github.com/kiibohd

Also found this mouser BLE module based on the CC254x.
http://www.mouser.com/ProductDetail/Bluegiga-Technologies/BLE112-A-v1/?qs=ScTHCgOnmkJ6UytbwX03ig%3D%3D


Programming will need to be done on any of these modules, as out of the box they mostly come with some form of Bluetooth UART bridge.
A brief programming guide is found here. (requires a TI programmer/debugger....clones are available if cost is an issue.)
http://oswatch.org/mkII_build_page_7.php
Title: Re: Bluetooth add-on for Infinity controller
Post by: Skuloth on Tue, 21 April 2015, 08:24:31
I'm interested in hearing how development progresses.
Title: Re: Bluetooth add-on for Infinity controller
Post by: hanya on Tue, 21 April 2015, 12:26:26
IAR Embedded Workbench is quite expensive for hobbyist to develop fully customizable firmware for TI CC254X.
Title: Re: Bluetooth add-on for Infinity controller
Post by: Greeeg on Tue, 21 April 2015, 17:58:01
IAR Embedded Workbench is quite expensive for hobbyist to develop fully customizable firmware for TI CC254X.
Is there another product that you have in mind where the development tools are cheaper or completely free?

IAR feature a 30 day trial. It is classed for non-commercial use, which should be fine to get our feet wet.
When I started thinking about this it was always for hobbyist non-commercial purposes.

However if the final product were to be sold wouldn't all that is required be a one time license fee to the create a "identical" but licensed binary file to flash to the Bluetooth ICs?
Title: Re: Bluetooth add-on for Infinity controller
Post by: mkawa on Tue, 21 April 2015, 18:36:28
while i find it very hard to believe that the bluetooth stack libs that are distributed with the workbench files can't be linked to with gcc,

https://e2e.ti.com/support/wireless_connectivity/f/538/t/92837#pi239031348=2

and

https://github.com/tigoe/BLEDocs/wiki/Software-and-Hardware

suggest that it might be more trouble than it's worth. there are always the atmel socs i guess.
Title: Re: Bluetooth add-on for Infinity controller
Post by: alexofthewest on Tue, 21 April 2015, 19:16:26
Most of the information in this thread is way over my head but I want to say I wish you guys luck with this project! I never understood why they made a compact keyboard without using ble technology to make it more portable.

I never realizes how complicated it is adding Bluetooth to a device! Its dissapointing though because I really wanted to add Bluetooth to mine
Title: Re: Bluetooth add-on for Infinity controller
Post by: hasu on Tue, 21 April 2015, 19:49:32
I'm interested in hearing how development progresses.

^really this. Keep us updated!

I don't know how CC254x works at all but I can remember this interesting project.

https://geekhack.org/index.php?topic=62236.0
https://github.com/rampadc/cc2540-hidKbdM


I think Nordic chip is viable another route.
I was working on Nordic nRF51822 chip a little with GCC and mbed.org libs but do nothing actually yet.

Title: Re: Bluetooth add-on for Infinity controller
Post by: HaaTa on Tue, 21 April 2015, 20:28:58
I'm also looking at the Nordic stuff for future infinity keyboards. First using a UART, then a SPI interface.

http://www.rfdigital.com/product/rfd22102-rfduino-dip/index.html (http://www.rfdigital.com/product/rfd22102-rfduino-dip/index.html)

I did have a look at those TI chips, but I didn't feel like buying a proprietary toolchain if I needed to add changes. That being said, I'll make sure the UART api can support any chips we through at the Infinity firmware.
Title: Re: Bluetooth add-on for Infinity controller
Post by: Greeeg on Tue, 21 April 2015, 20:44:31
I'm interested in hearing how development progresses.

^really this. Keep us updated!

I don't know how CC254x works at all but I can remember this interesting project.

https://geekhack.org/index.php?topic=62236.0
https://github.com/rampadc/cc2540-hidKbdM


I think Nordic chip is viable another route.
I was working on Nordic nRF51822 chip a little with GCC and mbed.org libs but do nothing actually yet.

I actually know this guy, the reason I wanted to use the CC254x. But with the IAR issues, it's probably not viable.


I'm also looking at the Nordic stuff for future infinity keyboards. First using a UART, then a SPI interface.

http://www.rfdigital.com/product/rfd22102-rfduino-dip/index.html (http://www.rfdigital.com/product/rfd22102-rfduino-dip/index.html)

I did have a look at those TI chips, but I didn't feel like buying a proprietary toolchain if I needed to add changes. That being said, I'll make sure the UART api can support any chips we through at the Infinity firmware.


Nordic do look very nice, they have a Development kit for ~$70 that gives you the programmer and some target boards. Their SDK states they support armgcc. (making development painful, but cheap)

Something like this http://www.seeedstudio.com/depot/Seeed-Micro-BLE-Module-w-CortexM0-Based-nRF51822-SoC-p-1975.html could be put on the final keyboard.

On second thought, the part you linked looks better, Also cheaper and can be bought from a proper distributor, http://www.digikey.com/product-search/en/rf-if-and-rfid/rf-transceivers/3539948?k=%22RF%20Digital%20Corporation%22
Title: Re: Bluetooth add-on for Infinity controller
Post by: hanya on Wed, 22 April 2015, 05:02:45
There are many modules can be found. But most of them have pads only bottom side for SMD. If you can solder such type of modules, there are many choices.
I have seen some kind of Bluetooth products.

- TI CC2540 and CC2541 (8051). Requires IAR Embedded workbench ($3000) for development. CCDebugger is required to flash in general.
Bluegiga provides BGScript (Basic interpreter language) that allows you to write your firmware without the expensive tool.
Modules: Bluegiga BLE112, BLE113, BLE121LR

- CSR CSR8510 (XAP). The toolchain for development is provided as part of its development kit ($500?). This chip is used in many USB dongles.
Modules: Bluegiga BT111

- CSR CSR1010, CSR1011. The toolchain can be obtained as part of the development kit ($300).
Modules: not known?

- Broadcom BCM20737S (ARM Cortex-M3). The SDK is provided by the manufacture. The package looks normal chip but it contains antenna inside. I could not find HID example in its SDK few months ago.
Modules: Mpression Koshian MP-KSN001B

- Dialog DA14580 (ARM Cortex-M0). The SDK is provided by the manufacture.
Modules: Murata LBCA2HNZYZ-711

- STmicro BlueNRG (ARM Cortex-M0). Not widely used yet?

- Nordic nRF51822 (ARM Cortex-M0). The SDK can be obtained from the manufacture. mbed supported.
Modules: Laird BL600, Fujitsu Component MBH7BLZ02, DYNASTREAM N548M8CB, Hoshiden HRM1026, Raytac MDBT40

- Microchip RN4020 (?). As external BLE module. Impossible to reprogram?
Module: Microchip RN4020


Since I'm in Japan, listed modules are TELEC certified. There are many modules that can be seen in the market.
I'm considering to use MDBT40 module that has pads at the edge of the module and the module can be by in ebay. nRF51822 has many GPIO pins and MDBT40 expose all pins. But 32.768kHz crystal is not on the module.
Title: Re: Bluetooth add-on for Infinity controller
Post by: pomk on Wed, 22 April 2015, 08:04:05
I was thinking of making a bluetooth only pcb using the same MDBT40 module. The first step would be to get the BLE-NANO development kit (http://redbearlab.com/blenano/). It's just 30€ or so, uses the same MDBT40, and at a later point could be used to program the plain modules as well. With BLE-NANO I can also use the mbed platform which I'm already familiar with. The only problem that I have so far with this approach is that it can't be a fully open source project because of the restrictions with the SDK, unless we can pack it as a binary library or something.

So I have a question for the OP:

Why an addon? You will have enough pins as it is, you will need a custom PCB anyway, as well as custom code. Not to mention that you are going to have power issues with the hungry 50Mhz cortex m4 (three orders of magnitude for power consumption while the keyboard is just resting on the table).

Title: Re: Bluetooth add-on for Infinity controller
Post by: Greeeg on Wed, 22 April 2015, 09:16:36
There are many modules can be found.
...
Since I'm in Japan, listed modules are TELEC certified. There are many modules that can be seen in the market.
I'm considering to use MDBT40 module that has pads at the edge of the module and the module can be by in ebay. nRF51822 has many GPIO pins and MDBT40 expose all pins. But 32.768kHz crystal is not on the module.


Wow, you have quite a list. The Nordic part does seem quite solid, I don't quite understand the 32.768kHz crystal missing, isn't a slow speed clock a requirement of the BLE4.0 standard?

Why an addon? You will have enough pins as it is, you will need a custom PCB anyway, as well as custom code. Not to mention that you are going to have power issues with the hungry 50Mhz cortex m4 (three orders of magnitude for power consumption while the keyboard is just resting on the table).

Large PCBs have large NRE costs. Also not everyone WANTS bluetooth. Personally I want USB and bluetooth, I wouldn't want to re-invent the wheel, HaaTa has put a huge amount of work into the infinity keyboard firmware.

Power consumption shouldn't be an issue. The ARM cores we are dealing with are designed for low power. Possibly some code changes to reduces the power consumption, but possible.

The main idea around the addon is for easy of upgrading mostly. It also makes this project more manageable, knowing that key scanning, function layers, macros are all being handled for us.
Title: Re: Bluetooth add-on for Infinity controller
Post by: pomk on Wed, 22 April 2015, 11:36:14
I wonder if there exists a chip like nRF51822 that would also contain the arm usb core, so that we could just use that for everything? It just feels a bit overkill to have 2 ARM SoC's in one keyboard.
Title: Re: Bluetooth add-on for Infinity controller
Post by: mkawa on Wed, 22 April 2015, 20:08:05
i've thought about the smd pads issue. there are a number of cool samples i have from avx that turn large smd pads into poke-through terminals and other fun stuff. i think we only win with the smd outline, as long as it doesn't approach BGA-style with completely concealed pads.
Title: Re: Bluetooth add-on for Infinity controller
Post by: mkawa on Wed, 22 April 2015, 20:10:16
I wonder if there exists a chip like nRF51822 that would also contain the arm usb core, so that we could just use that for everything? It just feels a bit overkill to have 2 ARM SoC's in one keyboard.
significantly simpler to just throw money at the problem in order to keep the infinity firmware and the bluetooth HID separate. the kinetis on the infinity side is super easy to develop for. the BLE module, even if it's RF on an ARM soc, is going to be significantly harder to deal with. hence, one side BT HID, one side keyboard scan and other fun.

another thing to keep in mind is that the sole reason we're *****ing about the cs254x is because it's got an impossible-to-compile-for 8051 in the middle.
Title: Re: Bluetooth add-on for Infinity controller
Post by: hanya on Thu, 23 April 2015, 01:49:36
Wow, you have quite a list. The Nordic part does seem quite solid, I don't quite understand the 32.768kHz crystal missing, isn't a slow speed clock a requirement of the BLE4.0 standard?
To reduce power consumption of the module, BT modules sleep and wake in specific cycle. The power consumption of 32KHz crystal is quite small comparing with 16MHz main crystal.
nRF51822 has the function to generate 32KHz clock from the main clock source but it needs main crystal still in the sleep mode. In the case of HID like device,
the sleep and wake up cycle is about 10-20 msec, so it might not be big problem. The real time clock module is better than the normal timer module because of the less power consumption and it suite to count the such little bit long delay.
We can prepare the pads for sub crystal and add it later as option.

[edit]Sorry, we can use internal RC oscillator for the clock source. It increase few or several uA compared with external 32kHz crystal but it is not so large for HID devices.
Title: Re: Bluetooth add-on for Infinity controller
Post by: mkawa on Thu, 23 April 2015, 08:16:35
Hmm. Yes, Nordic looks 1uite interesting
Title: Re: Bluetooth add-on for Infinity controller
Post by: victorhooi on Tue, 18 October 2016, 07:37:54
I noticed the Infinity Keyboard is back on Massdrop:

https://www.massdrop.com/buy/infinity-keyboard-kit

Was there any progress made on Bluetooth support for the Infinity keyboard?

Is there anything you guys need that might help? (e.g. donations?)

Super keen to get a Infinity - but Bluetooth for me is a requirement. Would what you guys are working on be a retro-fit, or would I need to get a whole new Infinity kit? (basically working out if it's worth buying an Infinity kit now, and waiting for an add-on).