MCP3427 smoke test user guide

The MCP3427 smoke test, smoke_mcp3427, allows read and log current/voltage data through I2C. This smoke test was written specifically from the solar module. To properly use the smoke test, user will need to customize projects/smoke_mcp3427/src/main.c in firmware_xiv.

Running the smoke test

Once the a single or multiple MCP3427s have been connected and the smoke test has been customized accordingly, simply do

make program PROJECT=smoke_mcp3427

 

Customizing the smoke test

The following items at the top of the file are up for customization:

  • I2C1_SDA: port and pin for the voltage sense MCP3427s, default GPIO_PORT_B and pin 11

  • I2C1_SCL: port and pin for the voltage sense MCP3427s, default GPIO_PORT_B and pin 10

  • I2C2_SDA: port and pin for the current sense MCP3427s, default GPIO_PORT_B and pin 9

  • I2C2_SCL: port and pin for the current sense MCP3427s, default GPIO_PORT_B and pin 8

  • SMOKE_SAMPLE_RATE: Number if bits of the converted values. See mcp3427_adc.h or the datasheet for more details.

  • SMOKE_AMP_GAIN: The factor by which the MCP3427 should amplify the input voltage before converting. See mcp3427_adc.h or the datasheet for more details.

  • SMOKE_CONVERSION_MODE: One-shot mode or continuous mode. See mcp3427_adc.h or the datasheet for more details.

  • s_test_devices: Hold the indices (or ID) which MCP3427 to be tested. For testing voltage sense MCP3427s, use indices 0 to 5. For testing current sense MCP3427, use index 6.