CURRENT ISSUE
Contests
Feature Article
|
|
Issue #206 September
2007
Smart Power
An Intelligent Power Supply for Embedded Systems
by Alexander Popov & Jordan Popov
Start | Hardware | Software | Calibration | Voltage Presets | Slowly Rising Voltage | Slowly Falling Voltage | Short Time Test | Periodcal Linear Voltage | Periodical Voltage Drops | Future Development | Sources & PDF
SOFTWARE
Martin Thomas’s GCC port of the demo code for the Butterfly is used as a base for the software (see Figure 4). Atmel’s driver for the USI has been ported to GCC and software timeouts have been introduced to eliminate freezing if errors occur on the I2C bus.
|
| Figure 4—The power supply can be fully configured and used through the Butterfly’s comfortable user interface. |
The CPU frequency is changed to 8 MHz because floating-point arithmetic is used. In addition, all the power-saving features are removed because they are not needed in a power supply project.
The ATmega169V’s ADC is configured to generate an interrupt on every conversion. Current protection is a priority over any other process in the software. ADC measurements are averaged in packets of eight to eliminate spikes and errors that could lead to false-overcurrent detection. The constants for matching the ADC code to the current were calculated after measuring several points of the characteristic and it proved to be linear with just a small offset.
All the test cases are generated through a programmable linear interpolating engine with as many points as needed. Every point consists of a time interval and a voltage to be reached at the end of the interval. This way, many forms can be generated, the most useful of which are already programmed: brown-out, slow-rise, slow-fall, etc. The points and parameters for each program may be easily configured with several arrays in the program memory.
|
