First I will need an 8-bit ADC, with a simple enough interface to be driven without an MCU. Ideally, I'd like to have a pulse to initiate the analog-to-digital conversion, and then 8 pulses to clock out the result - preferably MSB first as that's the bit order the LEDs expect.
Most ADCs that I've found use a SPI-like protocol like this:
CS transitions low to initiate a conversion, then a few dummy bits need to be clocked out before the MSB of the result shows up. So for each 8-bit color value we'd need to pause sending data pulses to the NeoPixel for a few clock cycles.
Another, less common serial protocol looks like this: (AD7823)
While not requiring extra clock pulses, this ADC does require a pause for the conversion to complete. This isn't an issue if the pause is much shorter than our clock (~1MHz). Unfortunately the AD7823 requires a 5us pause, and I didn't find any faster ones.
One approach to avoid pausing the bit stream to the LEDs would be to place the ADC with the signal source and interleave results with the MUX.
The downside is cost (3x $10 for the AD7823, ouch!), and for the cheaper and more common SPI ADCs the complexity of orchestrating the extra clock cycles.
There are also ADCs with parallel output. The TI ADC1175 looks like a good candidate:
Similar to the SPI ADCs, the conversion result is only available after 3 extra clock cycles. But after filling the pipeline, a new sample is available with every clock cycle. So worst case, we may have an issue with the first LED on a string.
A parallel-to-serial shift register will be required to convert the 8-bit data to a serial stream. The logic would be something like this:
- switch mux
- start ADC conversion
- parallel load shift register (with sample N-3)
- clock out 8 bits
- repeat
This seems doable with very little extra logic.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.