Skip to content

sh3r4zhassan/MGM240S-ADC_OVER_BLE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

High-Performance ADC Sampling and BLE Transmission on EFR32xG24 SoC

Overview

This firmware is designed for the MGM240S wireless module, which features the EFR32xG24 SoC, showcasing high-speed ADC data sampling and transmission over BLE. The implementation uses a circular buffer to handle ADC data efficiently, ensuring no data loss, even under high-speed sampling conditions. This setup is generalizable to projects requiring precise ADC sampling, minimal latency, and reliable BLE connectivity.

The ADC pin is connected to a bus designed for interfacing with external sensors (e.g., a microphone). Using the iadc library, the system achieves a sampling frequency of 4 kHz, with BLE advertising and notifications configured for optimal performance. BLE parameters and MTU sizes are also optimized for high-throughput applications.

Features

  • Module Compatibility: Designed for the MGM240S wireless module with the EFR32xG24 SoC.
  • ADC Sampling:
    • Configured for 12-bit resolution.
    • Sampling at 4 kHz (adjustable via clock configurations).
    • ADC input pin: gpioPortB, pin 0.
  • Circular Buffer:
    • Two halves, each holding 100 samples.
    • Flags (0x1111 and 0x0000) mark buffer boundaries for seamless BLE transmission.
    • Size customizable via BUFFER_SIZE macro.
  • BLE Transmission:
    • Device advertises with a configurable timeout (default: 60 seconds).
    • Notifications sent when buffer halves are full.
    • Optimized for high-throughput BLE communication.
  • Interrupt-Driven Design:
    • ADC interrupts trigger data handling and buffer updates.
    • BLE notifications are sent only when a connected device is available.

Contribution

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make and test your changes.
  4. Commit (git commit -m 'Add feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages