PIC32 Sleep current PIC32-PINGUINO-MICRO

So yesterday I did some experiments with the PIC32-PINGUINO-MICRO board from Olimex.

In the previous entry I did a rough analysis how much current draw is expected in sleep mode. It was about 5mA-s As we see this could be definitely better with a different HW or even worser. Depending on the schematic and used parts.

Lets see the experiment set up:
TODO: add picture here, if not done then imagine a picture of the board, a multimeter and some cables. Or just look up :)

So basically the set up was the following. A 5V power supply was used (self made) to supply the board over the external 5V. A cable was prepared for current measurements. I found out that the best way doing this is to cut the cable somewhere and add 1 plus 2 banana stecker. This way the cable can be used to switch between different current measurements. And finally the board from olimex with and ICD3 debugger connected to the PC.

Current measurement: As previously mentioned the cable with 3 stecker is very good, since you can shunt out the current measurement as long as your current is higher than the ratings of the multimeter. For example, in normal mode the current might be 2A, but in sleep mode it falls down to 100uA. So as long as the current is 2A you simply do a shortcut over the multimeter, or even better you use the 10A rating setting. Then when you see that the device is in sleep and the current consumption is low, you cut the shortcut or change the rating from 10A to 20mA in a way, that first you apply the cable for the 20mA, then switch the multimeter to 20mA. This way you do not need to break the current, so the device wont get an unwanted reset.

ICD3: Since the ICD3 might affect the measurement, it is a good idea to do a measurement with and without ICD3. Of course the measurement without the ICD3 is the most important. But there might be cases when you want to know how would behave the system with debugger attached.

Lets see the measured values:
Type: with ICD3 / without ICD3
Reset: 62,1mA / 9,2mA
Run: 82,4mA / 80,4 mA
Sleep: 6,9mA / 6,1mA after some optimization it was 5,6mA

The big difference in reset was that with ICD3 i was just reseting the PIC and then it was basically running but stopped by the debugger. While without ICD3 I was really pressing the reset button on the board.
In Run the programmed SW was simply running. ICD3 draws 2mA-s as it seems. Value seems to be plausible.
Now the Sleep mode. Lets see, final current was 5,6mA, expected was 5mA. I tried to do some kind of optimization, for example changed the OSCCON settings and TRIS and PORT settings. Only the PORT setting was giving some kind of enhancement. There might be changes which might help, but in fact due to the 5,6mA I was unable to measure a difference of some 10 uA-s. So after I was not seeing any more improvement, I just stopped the optimization.

For the board the expected current drawings are meet. Further optimizations in the SW does not make any sense, since the benefit is so small compared to the whole current drawing that is would basically not improve the battery run time. With a given big battery the board is still usable for some kind of application where running from battery for some days is expected. But for a real long running low power measurement logger this board is not the best choice.
Open question is, how much current is really draw by the LDO and how much by the PIC32. The use case with SD Card is not measured any way, also the exception is that due that it can not turned off, the sleep current draw could increase.

Next step is to measure the other Olimex board (PIC32-PINGUINO-OTG). Since the expectation is there in the range of uA-s, more kind of optimizations can be checked out :)

Here is the test software which I used for this measurements: