The PIP-Watch is a battery-powered device that will be continuously on, hence the average power consumption is one of the most important engineering aspects.
In this post I will go through two simple steps of optimizing CPU power – sleep modes and lowering the clock frequency. In a next separate post we will look into Bluetooth module power.
The printed circuit boards for PIP-Watch Zero came from Pragoboard fab on Friday 12 Sept. I ordered three pieces because the cost is practically identical as for two or one.
On Saturday I assembled one board, and on Sunday I tested it and started working on firmware. I had some problems with PLL in the microcontroller – the CPU hard-resetted the instant the PLL was enabled. Eventually I found a bad solder joint on one of the CPU’s power supply pins.
So far I tested the CPU & JTAG, the eInk EPD display, Bluetooth modem access (but not the BT communication itself), and LEDs. I had issues with bad solder joints (both shorts and cold joints) because the PCB footprint for the CPU (the LQFP64 package) was apparently designed for the reflow process, and it is not suitable for hand soldering. Silly KiCAD libraries!
Measuring crystal frequencies:
Schematic [PDF], BOM, and PCB layout for my PIP-Watch “Zero” was completed during this week. Layout data was sent to a local PCB fab – pragoboard.cz. The board should be ready and shipped during the next week.
The PCB is is 80mm*35mm. The top side is dedicated to the EPD display, battery (underneath the display), 3 push-buttons and 4 LEDs. The bottom side carries all the main electronics – processor, bluetooth modem, display driver, and power source.
All design files are in the project repository.
In my previous homebrew projects I did not use any operating system in the embedded processors. Software was programmed on a bare-metal hardware. In my Talking Clock project I created a simple cooperative event-processing abstraction layer, but it was very limited.
GDE021A1 is a graphics display with a resolution 172×72 pixels, each pixel is 2 bits deep (4 shades of grey). The display has an internal controller SSD1606 with a framebuffer. The framebuffer size is 172*72*2/8=3096 Bytes. When the display is powered up, the system processor sends initialization sequence that first sets up controller’s internal registers (the controller SSD1606 is fairly generic) and then sends new framebuffer content. The display controller then autonomously pushes the framebuffer contents to the physical screen.
The display controller can be configured to orient the framebuffer almost any way. I configured it into a landscape mode, with the X-axis going right and the Y-axis down, as shown on the photo.
Today I have managed to get the GDE021A1 ePaper display (EPD) working! I used my minimal EPD-Driver board, which implements a flat-flex cable connector and a booster circuit for the display. The booster generates high voltages needed for display operation (around +-25V). The display is driven by STM32F101 Cortex-M3 CPU, mounted on a universal PCB. The picture below depicts my workbench setup (click to see a full-size image):
In my PIP-Watch project I will use a Li-On battery to provide power. Li-On batteries are easy to use in hobby projects: they are light, small, with high capacity, and they come in variety of sizes. Most (not all) Li-On batteries have nominal voltage 3.7V, hence you can directly power your standard 3.3V digital logic directly, using only a simple low-drop linear regulator (e.g. LD59015).
For my first experiments I chose Nokia BL-4C Li-On battery. It’s nominal voltage is 3.7V, charging (maximal) voltage is 4.2V, the capacity is 860mAh.
Software repository location:
The issue this software solves:
Although the Voltcraft multimeter and the UNI-T USB cable are hardware compatible (the USB cable adapter fits into the multimeter connector perfectly), the software requirements are different. Original Voltcraft USB cable, which costs tripple the UNI-T cable by the way, mimics RS232 adapter when plugged in USB host PC. The UNI-T cable uses different chip internally and behaves like a HID device. On the other hand, UNI-T multimeters use different communication protocol over the serial line than the VC870 does.
This software package is composed of two independent parts:
1. USB cable interface in the utd04-cable directory,
2. multimeter protocol decoder in the vc870-decode directory.
The USB cable interface is adapted from other work, see copyrights in the directory. Compile according to instructions in the utd04-cable/readme.2.txt file.
The multimeter protocol decoder is a perl script. Use in a pipe together with the cable interface:
./utd04-cable/utd04-cable -b9600 | ./vc870-decode/vc870-decode.pl
The above commands need to be run under root (su) because of USB access permissions required in the cable interface program.
Note that I have not tested the protocol decoder extensively, there may be bugs (particularly in range decoding).
Being mostly ‘digital’ guy, I’ve always shied off from switching mode power supplies because they are too much analog to my liking. I decided to break my habit by playing around with MC34063A, a 1.5-A Boost/Buck/Inverting Switching Regulator.
I tried an inverting topology that generates -12V from +6V power supply. A copy of schema from datasheet is below, and an implementation on a breadboard can be seen above at the page tile:
The converter works by first charging coil L by a current drawn through transistor Q1. When Q1 is switched off the energy stored in the coil is discharged through diode 1N5819 into output capacitor Co. Because current through the coil L goes always from top to bottom (as drawn in the schematic above), the discharging phase is effectively pulling the output voltage below ground level.