DolphinV4 API
1.6.1.0
|
There are special designed functions for ultra low power applications available in Dolphin API, recommended to be used to get the best performance. This chapter describes the philosophy of using these functions.
Analog measurements
To perform an analogue measurement it is necessary to measure a reference voltage and the source voltage, and then scale it. Because of hardware limitations to measure very small and very large voltages, every measurement consists of two measurements against an internal 0.9 V voltage. So in sum we get 4 measurement values for the scaling computing. As the reference voltage should be constant it is only necessary to measure it once. And if the source voltage is a single measurement against VSS it is also possible to measure it once and reuse that measurement value for scaling.
The example below shows the use of that functions for performing a single ended measurement of ADIO_1:
The result of the measurement is in s16adio0value, scaled to 8 bit with the reference of RVDD, whose value is s16posref. It is important to call io_enableAnalog directly before and after measurement, because it switches on and off the ASIC analogue circuitry. Not calling io_enableAnalog(0) as soon as possible causes higher consumption. energy.
The difference of using these functions instead of io_measAnalog is the optimized runtime.
Timer functions
It is possible to use the time_wait function in ultra low power applications for implementing time delays. To save energy this function switches to standby mode and will be waked up by the unused timer0 of the Dolphin chip, which is usually reserved for the scheduler. When the scheduler runs in non ulp applications the time_wait function waits in CPU mode, using the scheduler for computing the delay.