RPI PICO – Burning Questions 1-5

(1) Does the PICO tell time?

Yes! In the Thonny shell try the following:

>>> import time
>>> time.localtime()
(2021, 6, 4, 10, 52, 36, 4, 155)
>>>

After connecting a PICO to Thonny the RTC registers are set to your computer’s time. As long as power is maintained to the PICO you will have UTC time within some number of milliseconds of your computer’s time plus drift.

(2) Can you log directly to a file on the PICO?

Yes! In the Thonny shell try the following:

>>> fid = open("log.csv","w")
>>> fid.write("My Data: {:}\n".format(1.234))
15
>>> fid.close()

Not sure how much or how fast is practical for the PICO just yet.

(3) Is the PICO low Power?

Yes!

PI Pico Current Consumption at the Input to the DCDC (whole board) is shown in the table below:

Core Clock [MHz] Vsys [V]
2.0 3.0 4.0
10 11.1 mA 6.0 mA 4.8 mA
125 60.3 mA 29.5 mA 23.4 mA
150 66.0 mA 34.3 mA 26.9 mA

Presently, the sleep and lightsleep functions do not appear to idle the core clock and are just simple busy wait loops, there is no power savings.

Provided you spend most of the time idling the core at 10 MHz you will get a few days battery life with a pair of alkaline AAA cells.

Once again, I managed to brick my PICO… At this moment, all I can say is that, ensure the PICO is operating at the default clock rate of 125 MHz when a USB cable is attached.

If you need a battery life of months or years you will have to write C code not python.

from machine import Pin
VBUS = Pin(24,Pin.IN)
machine.freq(int(150e6))
x = 1
while True:
    x = x + 1
    if (VBUS.value() == 1) & ( machine.freq() != int(125e6) ):
        machine.freq(int(125e6))