Skip to content

ffich/MercurySystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

πŸ“– Description

Mercury System is a modular βš™οΈ hardware + πŸ’» software development platform tailored to streamline the creation of embedded, connectivity, and IoT applications 🌐.
It uses a LEGO-like 🧩 architecture, where interchangeable boards can be combined to build powerful systems without reinventing the wheel.


πŸ› οΈ Hardware Architecture

The hardware is organized into distinct families:

  • 🧠 Base Board (BB) – the β€œbrain” of the system. It hosts the main microcontroller (e.g., PIC18F46J50), handles communication buses (IΒ²C, UART), includes a LiPo battery charging circuit, USB bootloader, real-time clock, EEPROM, LEDs, buttons, and up to 11 GPIOs.

  • πŸ“‘ Modem Board (MB) – connects the system to networks or devices. Variants include Wi-Fi, GSM/GPRS, Bluetooth, ZigBee, LoRa, and more. These interface with the BB via a dedicated serial/UART link.

  • πŸŽ›οΈ Slave Board (SB) – modular sensors or actuators, each with local microcontrollers that accept high-level command sets. They connect to the BB via IΒ²C (multidrop) or UART and enable flexible expansions without pin conflicts.

  • πŸ”‹ Power Board (PB) – addresses power needs for more demanding setups. Variants support higher current requirements or alternative energy sources like solar or piezo harvesting.

  • πŸ–₯️ Expansion Board (EB) – supports planar connections of multiple boards and may include peripherals like displays or prototyping areas, offering an alternative to vertical stacking.

  • πŸ’‘ Brain-Less Board (BL) – lightweight, cost-effective, controller-free boards for simple sensor or actuator functions that connect directly to BB GPIO


Example of connection:

image

Mercury Ecosystem:

image

πŸ§‘β€πŸ’» Software Framework (MSF)

The Mercury System Framework (MSF) is a layered software architecture that abstracts hardware details and provides a clean structure for building embedded and IoT applications.
It is designed to reduce boilerplate, increase portability, and allow developers to focus on application logic instead of low-level device drivers.


πŸ”Œ HAL (Hardware Abstraction Layer)

  • Provides drivers for low-level hardware blocks (GPIOs, timers, ADC, UART, IΒ²C, SPI, …).
  • Encapsulates device-specific code so that higher layers remain portable.
  • Shields developers from MCU hardware differences.
  • Example: toggling an LED through HAL instead of directly touching registers.

🧩 SML (System Management Layer)

This layer manages all the shared system resources and services:

  • Bus Management – controls communication interfaces (IΒ²C, UART, SPI).
  • Peripheral Management (PML) πŸ“Ά – provides high-level APIs for Modem Boards and Slave Boards, so you can send commands without worrying about bus protocols.
  • System Services (SSL) ⚑ – manages power rails, LEDs, buttons, the RTC/RTCC, EEPROM, and the USB terminal.
  • Communication Stacks – handles Wi-Fi, Bluetooth, GSM/GPRS, LoRa, or ZigBee modems transparently.

Thanks to SML, the developer can use modem/sensor boards interchangeably without rewriting core code.


⏱️ OSL (Operative System Layer)

Implements a lightweight cooperative RTOS tailored for Mercury projects:

  • Scheduler – table-driven, periodic execution model (each task has a defined cycle time).
  • Task Management – applications are split into tasks with defined states (InitializationState and RunningState).
  • Timers & Alarms – software timers and alarms for periodic or one-shot operations.
  • Event Handling – inter-task communication via events and signals.
  • Low Power Support – tasks can be scheduled around power states to extend battery life.

This gives the developer an Arduino-like simplicity (setup/loop) but with more structure, scalability, and multitasking capabilities.


πŸ“¦ Application Layer

At the top sits the user application, which ties everything together:

  • Uses HAL and SML APIs to control hardware and modems.
  • Registers tasks in the OSL scheduler to run periodically.
  • Implements business logic, e.g., β€œread temperature sensor every 10s and send via GSM”.
  • Designed to be easily portable across projects by reusing configuration and task code.

MSF Architecture:

image

πŸš€ Advantages of MSF

  • 🧩 Separation of Concerns – hardware, system services, OS, and application logic are clearly layered.
  • πŸ”„ Reusability – code can be reused across different projects and hardware setups.
  • πŸ“š Consistency – same API and coding model, regardless of the hardware used.
  • ⏳ Rapid Prototyping – focus only on high-level logic, while MSF handles drivers, services, and task scheduling.
  • 🌍 IoT-Ready – built-in support for modem boards means you can connect your project to the internet with minimal code changes.

πŸ› οΈ Development Workflow

  • πŸ“₯ Setup – includes documentation, framework libraries, demos, and tools.
  • πŸ—οΈ Project Generation – automated scripts create MPLAB X projects linked to the framework.
  • βš™οΈ Configuration – features enabled via sys_cfg.h (e.g., modem selection, task periods).
  • πŸ” Coding Model – dual-state (InitializationState / RunningState), similar to Arduino’s setup()/loop().
  • πŸš€ Deployment – choose between Standalone (direct programming) or Bootloader (USB .hex flashing).

🌟 Benefits & Use Cases

  • 🧩 High Modularity – easily extend hardware with new boards.
  • πŸ“ˆ Scalability – bus-based expansion for sensors/actuators.
  • πŸ”‹ Efficient Power Management – built-in LiPo support + external PBs.
  • ⏳ Faster Development – framework abstracts complexity so you focus on logic.
  • 🏠 πŸ€– 🏭 Applications – home automation, robotics, industrial control, IoT devices, test benches, and more.

βœ… Summary

Mercury System combines scalable modular hardware 🧩 with a layered software framework πŸ—οΈ, enabling developers to move quickly from idea to implementation.
It’s an IoT-ready platform 🌍 that balances flexibility, simplicity, and powerβ€”perfect for makers, engineers, and innovators.

About

Public repository for Mercury System Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages