Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Firmware for Hardware Validation

Writing firmware may be hard, but building hardware to run that firmware is often harder. A common problem is being unsure if an external IC is connected properly, since functionality is hard to test with just electrical bench tools. This can be helped from the firmware side with ‘smoke tests’: projects that engage an IC with as little user input as possible. These would differ from the actual board firmware project in that they 

Some examples of what a smoke test might do are as follows:

  • For most ICs, periodically read a manufacturer-set status register and compare the read value to the expected value, logging the results

  • For an ADC (e.g. ADS1015), periodically take readings and log output

  • For a serial to CAN converter (e.g. MCP2515), periodically send CAN messages and log whatever is received

  • For a multiplexer (e.g. ADG731), periodically cycle through all possible outputs, flipping pins

  • For a demultiplexer (e.g. ADG731), periodically cycle through all possible inputs, perhaps taking readings with the STM’s onboard ADC

  • For a switch (e.g. BTS7040), periodically toggle on and off

Combining these, it would also be useful to have a smoke test for an entire board. For example, a smoke test for the pedal board might periodically read from each ADC channel. A smoke test for the center console might log all GPIO button presses to ensure all of them are wired correctly.

IC list to write smoke tests for

BMS AFEs

  • LTC6811 via SPI

  • ADG731 via LTC6811 via SPI

BMS Current sense

  • ADS1259 via SPI

MCI

  • MCP2515 via SPI

Solar Sense

  • SPV1020 via SPI and MC74LVX138 demuxer

  • MCP3427 via I2C

Pedal Board

  • ADS1015 via I2C

Power Distribution

  • PCA9539r via I2C

  • MCP23008 via I2C

  • BTS7200

  • BTS7040 / BTS7080

  • No labels