Author Topic: USB to Bluetooth with nRF51822  (Read 4953 times)

0 Members and 1 Guest are viewing this topic.

Offline MordredFTC

  • Thread Starter
  • Posts: 5
USB to Bluetooth with nRF51822
« on: Mon, 14 October 2019, 06:39:31 »
Hi, i want to create a USB2BT with a nRF51822, but i have several questions. The main problem is how communicate the keyboards or mouse with the module, alone to the Cortex M0 or trought an Arduino Pro Micro with USB host shield (my first plan, but power hungry). If the first option is the best, how can i configure the connections. The other question is i want to connect multiple peripherals (mouse, keyboard and touchpad), is it possible with a hub? Thanks in advice
« Last Edit: Mon, 14 October 2019, 07:24:17 by MordredFTC »

Offline nevin

  • Posts: 1646
  • Location: US
Re: USB to Bluetooth with nRF51822
« Reply #1 on: Mon, 14 October 2019, 07:24:07 »
.... that's above my paygrade (lol), but the most integrated solution will be the most efficient power wise.
- there are a handful of mechanical keyboards or kits that have bluetooth integrated, or alternate controller with bluetooth built-in (like Hasu's alt HHKB controller)
- Handheld Scientific had an usb to bluetooth adapter box or two that were popular a while ago...
- the implementation of pairing to multiple devices is hit & miss (that i've seen so far)
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline yui

  • Posts: 1082
  • Location: 127.0.0.1 (in azerty)
Re: USB to Bluetooth with nRF51822
« Reply #2 on: Mon, 14 October 2019, 07:50:09 »
There was a project like that a while back on hackaday, only it used PS/2 and not USB (https://hackaday.com/2016/04/14/minions-turn-your-keyboard-into-a-bluetooth-keyboard/) and it uses an RM42 flashed HC-05 instead of your nRF51822 but you could get inspiration (and searching there you may find what you need)
vi vi vi - the roman number of the beast (Plan9 fortune)

Offline MordredFTC

  • Thread Starter
  • Posts: 5
Re: USB to Bluetooth with nRF51822
« Reply #3 on: Mon, 14 October 2019, 07:53:50 »
.... that's above my paygrade (lol), but the most integrated solution will be the most efficient power wise.
- there are a handful of mechanical keyboards or kits that have bluetooth integrated, or alternate controller with bluetooth built-in (like Hasu's alt HHKB controller)
- Handheld Scientific had an usb to bluetooth adapter box or two that were popular a while ago...
- the implementation of pairing to multiple devices is hit & miss (that i've seen so far)

I know that exist finish user products with this funcionality, but i want to create a DIY solution like hc-05 with nano. I want to use any keyboard and no specific keyboard with bluetooth built-in, because i have multiples keyboard. My desiree is create something similar to Ipega 9116 but for windows. Thanks very much.
« Last Edit: Mon, 14 October 2019, 08:54:20 by MordredFTC »

Offline MordredFTC

  • Thread Starter
  • Posts: 5
Re: USB to Bluetooth with nRF51822
« Reply #4 on: Mon, 14 October 2019, 07:57:03 »
There was a project like that a while back on hackaday, only it used PS/2 and not USB (https://hackaday.com/2016/04/14/minions-turn-your-keyboard-into-a-bluetooth-keyboard/) and it uses an RM42 flashed HC-05 instead of your nRF51822 but you could get inspiration (and searching there you may find what you need)
Yes, i want this, but my doubt is if i can use the Cortex M0 include in the nRF51822 and how to wired the usb solution. If i do the project with the nRF51822 and nano or micro, i can do, i supose. Thanks.
« Last Edit: Mon, 14 October 2019, 08:08:14 by MordredFTC »

Offline yui

  • Posts: 1082
  • Location: 127.0.0.1 (in azerty)
Re: USB to Bluetooth with nRF51822
« Reply #5 on: Tue, 15 October 2019, 03:55:18 »
the cortex M0 is much more power full than the AVR in an arduino nano, just need to find the libraries and an IDE to program it
vi vi vi - the roman number of the beast (Plan9 fortune)

Offline MordredFTC

  • Thread Starter
  • Posts: 5
Re: USB to Bluetooth with nRF51822
« Reply #6 on: Tue, 15 October 2019, 06:57:43 »
the cortex M0 is much more power full than the AVR in an arduino nano, just need to find the libraries and an IDE to program it
Thanks for your reply. With this module, i am going to use openOCD ( a raspberry pi) and nordic softdevice for the funcionalities. My problem is that all examples and projects are made for nRF51 as MCU, while i want to use it only for bluetooth and manage devices connected. For this, i don't know how can i realize the connections between the USB of the keyboard and the nRF51822.

Offline yui

  • Posts: 1082
  • Location: 127.0.0.1 (in azerty)
Re: USB to Bluetooth with nRF51822
« Reply #7 on: Tue, 15 October 2019, 07:37:22 »
https://devzone.nordicsemi.com/f/nordic-q-a/36704/what-should-i-do-to-make-nrf52840-to-be-a-usb-host/142723#142723
from that source it seems that you would need a bridge for the mcu as it does not have the usb host functionality, they do seem to recommend the MAX3421E as a usb to spi bridge.
And as the nRF51822 is a mcu if you want to use it just as a bluetooth interface for some other mcu you will need to give it some sort of firmware to do so and make it communicate in serial or other stuff
vi vi vi - the roman number of the beast (Plan9 fortune)

Offline MordredFTC

  • Thread Starter
  • Posts: 5
Re: USB to Bluetooth with nRF51822
« Reply #8 on: Tue, 15 October 2019, 12:07:19 »
https://devzone.nordicsemi.com/f/nordic-q-a/36704/what-should-i-do-to-make-nrf52840-to-be-a-usb-host/142723#142723
from that source it seems that you would need a bridge for the mcu as it does not have the usb host functionality, they do seem to recommend the MAX3421E as a usb to spi bridge.
And as the nRF51822 is a mcu if you want to use it just as a bluetooth interface for some other mcu you will need to give it some sort of firmware to do so and make it communicate in serial or other stuff
But with this can i to use this like bluetooth hub for mouse and keyboard or only one of both? Thanks very much for yours responses. I am very confused, is my first time programming cortex

Offline yui

  • Posts: 1082
  • Location: 127.0.0.1 (in azerty)
Re: USB to Bluetooth with nRF51822
« Reply #9 on: Wed, 16 October 2019, 02:38:03 »
I actually never did either, i ordered a cortex M0 based micro (an STM) but it is still in the mail and it does not have bluetooth (wanted to build a mechanical calculator with keyboards spare parts) so i do not quite know how they do work and especially the usb host part of the thing, i would guess that if you are versed in C you could read hasu's USB to USB converter code (https://geekhack.org/index.php?topic=69169.0) and try to port it. For mice the protocol is a bit different and i have no idea if anyone tried to use it here (hasu supports mouse clicks in his converter but only sends them)
vi vi vi - the roman number of the beast (Plan9 fortune)