-
Bit-banging LCDs
04/22/2018 at 14:12 • 0 commentsThe LCD elements in the 3D glasses I'm using for a prototype are normally transparent and become opaque when driven with an AC waveform. To prevent damage to the LCDs, it's important to eliminate any DC component in the driving waveform; a DC bias across the the elements will eventually damage them. The PIC12LF1571 doesn't feature dedicated LCD-driving hardware, but for something this simple, the required waveforms are easily generated in code.
The LCDs will be driven by two pins. When the LCD is clear, both pins will be low. To darken the LCD, the pins will drive the elements in push-pull, with an identical number of positive pulses from each phase to ensure no overall DC bias. A representative waveform is shown here:
In this case, 5 positive pulses and 5 negative pulses are generated each on the clk_a and clk_b lines to darken the LCDs for 10 periods. To clear the LCD for 1 period, both lines are brought low, then the cycle begins again, generating a 9.1% duty cycle. In practice, the switching frequency will be higher than this, so that perhaps hundreds of cycles of AC will punctuate periods of transparency. This is necessary to prevent flickering during the dark period.
The actual frequency and voltage level required depend on characteristics of the LCDs themselves. Since I don't have a datasheet for the prototype glasses, I'll have to determine appropriate values experimentally, but this shouldn't take long.
-
Power Supply and MCU
04/22/2018 at 13:41 • 0 commentsSo, on another project, I've been playing with a power supply for microcontrollers using a single AA or AAA battery. The idea is to use a low-quiescent-current boost converter to convert the input voltage to 3V to run the MCU. In that project, I've used a MCP1624, which will will start at a battery voltage 0.65V and once started, continue to run to even lower input levels. Although there are converters with even lower quiescent currents, the MCP1624 seems well suited to the sunglasses application.
The design for the current prototype is released under an MIT license, and the design files and gerbers are available on GitHub.
For a quick prototype, I can use the PCB developed for the 1-cell-mcu project to drive the sunglasses. The schematic shows how the supply interacts with the PIC12LF1571:
In the original circuit, the converter charges a large capacitor to power the MCU through long periods of sleep. The pull-up resistor R3, combined with the tri-state condition of the PIC GPIO pin on reset, creates a fail-safe mechanism to automatically re-start the converter should the MCU not wake before the capacitor fully discharges. For the sunglasses, this mechanism won't be necessary, since the PIC will be actively driving the glasses whenever the power is on.
For the sunglasses application, two GPIO pins on the PIC will be used as an LCD driver. The details will be discussed in a subsequent project log.
The first prototype PCB has been tested, and works as expected. A large storage capacitor won't be necessary for the sunglasses, so this part can be eliminated, saving some cost.
Rough estimates indicate that this type of circuit should power the sunglasses for several years on a single AAA battery. Although this number is preliminary, it may mean that the sunglasses can be "always on," not requiring a power switch, which can decrease cost and increase reliability.