Multi-platform wireless IoT firmware repository featuring Bluetooth Low Energy (BLE) tracking and Sub-GHz wireless communication systems.
This repository contains embedded firmware for two distinct IoT applications:
| Module | Technology | Microcontroller | Frequency | Purpose |
|---|---|---|---|---|
| BLE | Bluetooth Low Energy | TI CC2640/CC2650 | 2.4 GHz | IoT tracker/beacon |
| SubGHz | FSK/OOK Radio | PIC18F4620 | 868 MHz | Wireless counter network |
cd BLE/src
# Use TI Code Composer Studio or similar tools
# Refer to BLE/README.md for detailed instructions# Base Station
cd SubGHz/BS
make
# Peripheral Stations (all 4 modules)
cd SubGHz/PS
make all # Builds ps1.hex, ps2.hex, ps3.hex, ps4.hex
make PS1 # Build individual moduleIoT/
βββ README.md # This file
βββ BLE/
β βββ README.md # BLE project documentation
β βββ src/ # BLE firmware source
β βββ cc26xxware/ # TI driver library
βββ SubGHz/
βββ README.md # Sub-GHz documentation
βββ BUILD.md # Additional build details
βββ BS/ # Base station firmware
β βββ main.c # BS main code
β βββ Makefile # Build configuration
β βββ pic18f4620.h # Microcontroller header
βββ PS/ # Peripheral stations (PS1-PS4)
βββ main.c # Unified PS source (configurable)
βββ Makefile # Multi-module build
βββ pic18f4620.h # Microcontroller header
- IDE: TI Code Composer Studio or similar
- Compiler: TI ARM compiler (included in CCS)
- Microcontroller: CC2640 or CC2650
- Programmer: TI XDS100 or similar JTAG debugger
- Compiler: SDCC v2.9.0 (Small Device C Compiler)
- Utilities: gputils v0.13.7
- Programmer: PICkit 2 v2.61.00
- Microcontroller: PIC18F4620
- Transceiver: QUASAR ALPHA-TRX868S
# macOS
brew install sdcc gputils
# Ubuntu/Debian
sudo apt-get install sdcc gputils
# Or download from: http://sdcc.sourceforge.net/Download from Microchip's website or use open-source alternatives like pk2cmd.
- BLE/README.md - BLE tracker implementation details
- SubGHz/README.md - Sub-GHz wireless network overview
- SubGHz/BUILD.md - Advanced build and test modes
- SubGHz/BS/BUILD.md - Base station build guide
- SubGHz/PS/BUILD.md - Peripheral station build guide
The SubGHz module implements a master-slave architecture:
ββββββββββββββββββββββββββββββββββββββββ
β Base Station (BS) β
β β’ Master controller β
β β’ Polls peripherals sequentially β
β β’ Aggregates counter data β
β β’ Controls 16 GPIO outputs (4/PS) β
ββββββββββ¬βββββββββ¬βββββββββ¬βββββββββ¬βββ
β β β β
868 MHz (wireless protocol)
β β β β
ββββββΌββ ββββΌβββ ββββΌβββ ββββΌβββ
β PS1 β β PS2 β β PS3 β β PS4 β
β0x01 β β0x02 β β0x03 β β0x04 β
ββββββββ βββββββ βββββββ βββββββ
Communication Protocol:
- Base Station β Peripheral:
0x5A + MODULE_ID - Peripheral β Base Station:
0x2D + 0xA5 + 0x5A + [data] + checksum + 0xEF
- β Test variants (main_1.c - main_4.c) consolidated into single main.c
- β Conditional BUILD_MODE flags for testing without separate files
- β All 4 PS modules built from unified source with configurable MODULE_ID
- β Single Makefile generates multiple firmware images
cd SubGHz/PS
make all # Build all PS modules
make PS1 # Build PS1 only (-DMODULE_ID=0x01)
make PS2 # Build PS2 only (-DMODULE_ID=0x02)
make PS3 # Build PS3 only (-DMODULE_ID=0x03)
make PS4 # Build PS4 only (-DMODULE_ID=0x04)
make clean # Remove build artifactsBLE Module:
- CC26xx-based BLE tracker/beacon
- Low-power operation
- TI driver library integration
SubGHz Module:
- 868 MHz wireless communication
- Base station + 4 configurable peripheral stations
- Checksum-based error detection
- GPIO-based counter I/O
- Optional test modes for development
See individual module documentation for license information.
Contributions welcome! Please maintain code consolidation principles:
- Avoid duplicating module-specific variants
- Use compile-time configuration flags (e.g., MODULE_ID, BUILD_MODE)
- Update documentation with any changes
- Test all build targets before committing
For issues or questions, refer to:
- Individual module README files
- BUILD.md files for detailed build instructions
- Inline code comments for implementation details