Firmware for BLE-based RC receiver for miniature RC vehicles.
The board is based on nRF52810 MCU.
More details about the project: https://positron96.gitlab.io/projects/rc-ble/
The project uses PlatformIO build system, which in turn uses custom platform and framework based on Nordic nRF5 SDK. PlatformIO will download these components automatically, but here are the links to the projects anyway: https://github.com/positron96/platform-nordicnrf52, https://github.com/positron96/framework-nrf5sdk.
The firmware supports OTA updates. For this the MCU needs to have a bootloader flashed, so there are 3 components in the flash: SoftDevice, Bootloader and this firmware.
Example "open_bootloader" from the SDK (version adapter for platformIO is in platform repository) was used. Instructions for flashing will come later.
This project is not compatible with typical RC remotes (due to using BLE), so it requires its own dedicated BLE-based remote.
At the moment there are these possible options:
-
Android application created with MIT App Inventor. Currently no way to provide link to AppInventor project.
-
Hardware remote that uses ESP32. Description here: https://github.com/positron96/rc-ble-transmitter.
-
(Experimental) Web-based controller utilising Web Bluetooth standard. Should work on a lot of smartphones without the need to install anything. Launch it from here: https://positron96.github.io/rc-ble/. Source is in this folder.
Communication is via UART-like interface over BLE. At the moment, UUIDs of Nordic UART Service (NUS) are used:
-
6E400001-B5A3-F393-E0A9-E50E24DCCA9E
is service UUID -
6E400002-B5A3-F393-E0A9-E50E24DCCA9E
is RX charachteristic UUID. This is tha main channel to communicate with FW, send data to this charachteristic. -
6E400003-B5A3-F393-E0A9-E50E24DCCA9E
is TX charachteristic UUID (not used at the moment)
Basic commands follow typical RC protocols that simply contain values for each control channel. These commands are separated by newline (“\n”).
Command |
Description |
|
Set channel N to value V (uint8, center position is 128). So far there are 3 channels: 0=throttle, 1=steering, 2=headlights, 3=marker lights. |
|
Reboot into DFU mode (see below). |
|
Change center value of steer servo to Nus |
|
Whether to invert drive direction. |
https://github.com/NordicPlayground/nrf52-timer-gpiote-ppi-hands-on/blob/master/main.c - example of generating PWM with timer, PPI and GPIOTE and no involvement or CPU.
https://docs.nordicsemi.com/bundle/sds_s112/page/SDS/s1xx/sd_resource_reqs/hw_block_interrupt_vector.html - on what peripherals are occupied by SoftDevice
https://novelbits.io/nrf52-ota-dfu-ble-part-4/ - an short tutorial of DFU OTA