How analogdevicesinc/ad5940-examples works
Main Components
• Hardware Platforms:
• AD5940/AD5941 Evaluation Boards: Two main types, one optimized for healthcare applications (EVAL-AD5940BIOZ) and the other for industrial/sensor applications (EVAL-AD5940ELEC). These boards include the AD5940 analog front end and the necessary sensor connectors.
• External Sensors and Peripherals: Depending on the application (e.g., ECG electrodes, gas sensors, pH sensors), these connect to the evaluation board.
• Microcontroller (MCU):
• Examples show projects for both ADICUP3029 and NUCLEO-F411, both of which serve as the MCU that communicates with the AD5940 via an SPI bus.
• Communication Interfaces:
• SPI Bus: Acts as the key interconnect between the MCU and AD5940.
• Software/Firmware Layers:
• AD5940 Driver Library (ad5940lib): Contains low-level functions and drivers for AD5940.
• Example Application Code: Each example (e.g., ADC, Amperometric, Impedance, ECG, etc.) layers on top of the driver and shows how to implement specific measurement routines.
• Porting/Hardware Abstraction Layer: Files such as ADICUP3029Port.c and NUCLEOF411Port.c mediate between the example code and the underlying MCU hardware.
• Development Environment (IDE): Although not a functional component in operation, note that development and debugging are performed in IAR or Keil (with ARM Compiler version requirements).
Establish the Relationships and Data Flow
• The Hardware Layer shows the sensors connecting to the Evaluation Board (which houses the AD5940).
• Data Path:
• Sensors feed analog signals into the AD5940.
• The AD5940 processes these signals and communicates with the MCU over SPI.
• The MCU, running the example firmware (which in turn integrates ad5940lib and port-specific code), processes the data.
• Processed data can then be relayed to external tools (e.g., SensorPal GUI) for visualization or further analysis.
• Control/Configuration Flow:
• The firmware controls the operation of the AD5940 through register-level commands delivered over SPI.
• Porting layers ensure that the SPI and other hardware-specific operations are correctly abstracted for different MCUs.
Architectural Patterns and Design Principles
• Layered Architecture:
• Hardware Abstraction: Separates low-level MCU port code (different for ADICUP3029 versus NUCLEO-F411) from the generic measurement routines.
• Reusable Library: ad5940lib acts as a common core that all examples use, ensuring code reuse and consistency.
• Modularity:
• Each example is self-contained, demonstrating specific use cases without interfering with others.
• Separation between the hardware configuration (documented in “doc”, “Schematics”, and “Application Notes”) and software examples.
• Extensibility:
• The example projects are structured to allow easy porting to different MCUs as indicated in the README.
Relevant Technologies
• Evaluation Boards: EVAL-AD5940BIOZ and EVAL-AD5940ELEC
• Microcontrollers: ADICUP3029 and NUCLEO-F411
• Communication: SPI (between MCU and AD5940)
• IDEs/Compilers: Keil (recommended), IAR, and ARM Compiler version 5 for ADuCM3029 porting requirements.
• Software library: ad5940lib