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 MCP3427 devices. For voltage sense MCP3427, use pin 11. For current sense, use pin 9.I2C1_SCL
: port and pin for the MCP3427 devices. For voltage sense MCP3427, use pin 10. For current sense, use pin 8.I2C_PORT
: Configured to I2C_PORT_1 by default (reference to the schematic)SMOKE_MAX_CONSECUTIVE_FAULTS
: Max number of consecutive faults before issuing a warningSMOKE_SAMPLE_RATE
: Number if bits of the converted values. Seemcp_3427_adc.h
or the datasheet for more details.SMOKE_AMP_GAIN
: The factor by which the MCP3427 should amplify the input voltage before converting. Seemcp_3427_adc.h
or the datasheet for more details.SMOKE_CONVERSION_MODE
: One-shot mode or continuous mode. Seemcp_3427_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 MCP3427, MUST use indices 0 to 5. For testing current sense, MUST use index 6. Note: Cannot test both voltage sense and current sense MCP3427s at the same time.