I am designing a mixed-signal board with microcontroller that will need flash memory programming for its firmware, (self-)testing, and documentation for the final production steps.
I know there is a whole branch of the electronics manufacturing industry just around testing (ATE), but I have not yet found a simple list of steps and options for the basic process, just to get started and figure out the simplest, low cost way of automating this for a small scale.
Let's start with the essential flashing of the micro:
- Connect device to programmer (PC+Software)
- Click "program" button to flash firmware
- Disconnect device
How would one simplify this to minimal human involvement like
- Insert device
- Remove device
? Likely with
- a test jig and spring-loaded probes (pogo-pins) for the connections.
- a method for the computer to detect the device (switch, or retry until successful connection to MCU was established).
- a human-machine interface (audio, visual via PC or on test jig)
The machine IO could be as "simple" as another microcontroller board (say Arduino) connected via serial port (UART/RS-232). Then the PC software might have to be customized to control the process (IO and Flasher software). Of course for flashing alone there are several options (vendor specific link, JTAG, bootloader).
Next of interest would be automated testing and calibration of the device. Of course, this is very specific to the hardware. The necessary equipment could be generalised as
- power supply
- signal generator (reference voltage / signal)
- measuring device (multimeter, oscilloscope)
- loads (sinks, sources)
Instead of using self-test or IO routines on the hardware (separate testing firmware or test routines part of production firmware), low-level tests could be run by external control host via hardware Boundary scan / JTAG.
Depending on the circuit, this might be simplified to self-testing with a passive jig that mostly acts as a loopback device.
In any case, a general sequence for test/calibration might be:
- apply signal
- measure signal
- [calculate / store calibration parameters]
For instance, outputs could loop back to (multiple) inputs via the test jig. Analog signal calibration requires a reference that could be external. Signal switching might be required if using a reference with inputs (ADC) and outputs (DAC), e.g.
- apply external reference voltage to input
- calibrate input
- switch output to input
- self-calibrate output (adjust until output is same as reference)
Alternatively an external comparator could be used with the reference voltage for feedback (requiring an input and a routine to search for the correct output value). Of course, off-the-shelf test equipment with control interfaces are available and allow direct setting/measurement of analog signals to calculate calibration values.
Writing the calibration data to the device or attached memory requires corresponding data structures/addresses used by the firmware. The data could be written directly to memory where possible (flash memory limitations e.g. erase cycle, block size) or embedded into firmware/eeprom image before writing final production firmware. Alternatively, if the firmware has a calibration interface, this could be used to transfer/update these values after flashing once the device is running.
As for ID and documentation, if no hardware ID is present in the devices, one might be generated by the test environment and written to the device. Firmware and product information could be written to database and sent to label printer for physical ID on the device.
Of course, any solution is always a trade-off and can only be approached further based on the details of the test requirements.
I'd be interested in further ideas or pointers to accounts of implementations.