While the glue for the Peltier module is curing, I'll start writing some code for the EFM32. The target is of course to make the complete solution low power, so I'll start by looking how the demo loaded on the board was programmed.
Turn it off when not needed
To realize low power: do as little as possible! The temperature demo reads the temperature sensor, convertst those values to Celsius or Fahrenheit numbers, and displayst them on the LCD screen, while reacting to input buttons. Not a real 'power horse application' to show the power of the Gecko Giant peripherals and M3 core, but a very good application to show how to stuff functionality in low power.
After initializing the microcontroller, an application loop is entered that repeatedly does this:
- Start the AD converter
- Go to sleep (EnergyMode1)
- On getting an interrupt the value is read, and displayed on the TFT
- Device goes to sleep (EnergyMode2) for 2 seconds
Diving into EnergyModes
To get low power, all modern microcontrollers have several ways to conserve power. For all ARM Cortex processors this is realized by turning off all peripherals on startup. Unused peripherals will remain powered off, and the programmer has to turn on peripherals (GPIO, UART ,SPI..) that have to be used.
Another way to be low power is to shut off certain blocks of the microcontroller. This is done with EneryModes, as described in AN0007 from EnergyMicro (you'll have to download Simplicity Studio to get the documentation). A quick and blunt overview of EnergyModes in the EFM32:
- 0: Run mode; everything active
- 1: Sleep mode; Only CPU is disabled. RAM, Flash and peripherals are available; when DMA (Direct Memory Access) is used, operations can run autonomously (send blocks of data over serial port without using the CPU!!). Device is 'woken up' by an event or an interrupt.
- 2:Deep Sleep Mode; only low frequency peripherals may be running. Think of slower running timers, or (relatively slow) serial communication. Again, the device is woken up by an interrupt or an event.
- 3: Stop Mode. No clocks are running. Device may be woken up by a watchdog, or a digital input change, or by I2C address match (wow! possible by using i2c's own clock signal. Cool feature)
- 4: Shut Off mode. Does what it says. Can only be revived by resetting, which may be done by a special backup RTC in some devices. Supply current as low as 20nA. Yes, nanoampere.... But then again; you can't do anything

LESense
The EFM32s also have some very nice tools to run measurements on resistive, inductive and capacitive sensors while staying in Energy Mode 2 (Deep sleep). This is very cool; you don't need to wake up from this mode to make a measurement, and you can even set up a range of measurements to be done while in deep sleep mode. As far as I can quickly scan through the resistive measurement techniques (most interesting for me) this is more for rough indicational measurements (on/off, trip points) than for precise analog values.
Conclusion
For my application the temperature demo could be a very good basis; I don't need frequent updates, I'll use a button or two, and I need to take a measurement and do some calculations. Great start, this setup!