# Low power using CircuitPython on the new Swan board

**URL:** <https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434>\
**Category:** Hardware\
**Created:** [October 1, 2021, 1:11am UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434 "2021-10-01T01:11:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PostThis](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@PostThis](https://discuss.blues.com/u/PostThis)\
**Post date:** [October 1, 2021, 1:11am UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/1 "2021-10-01T01:11:42Z")

</div>

I see that the Swan has \< 10uA low power mode…will that be supported in CircuitPython/Micropython?

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/matt/32/270_2.png) [@matt](https://discuss.blues.com/u/matt)\
**Post date:** [October 11, 2021, 1:35am UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/2 "2021-10-11T01:35:04Z")

</div>

MicroPython has excellent support for the STM32L4, including access to some of the low power modes.

I’m just not sure why Swan decided to support CircuitPython instead of MicroPython for this board; CircuitPython is great but MicroPython’s STM32 support is very mature.

All that said, it wouldn’t be difficult to create a MicroPython board definition and try it out. I’m holding off purchasing a Swan since, at the moment, shipping to Australia is 30% more expensive than the device itself!

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [October 11, 2021, 8:20pm UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/3 "2021-10-11T20:20:08Z")

</div>

Hey @matt,

Is there anything specific you get out of MicroPython that you can’t access with CircuitPython (aside from possibly the low power modes)?

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/matt/32/270_2.png) [@matt](https://discuss.blues.com/u/matt)\
**Post date:** [October 15, 2021, 1:51am UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/4 "2021-10-15T01:51:12Z")

</div>

Hey Rob,

It’s a little challenging figuring out what’s supported in CircuitPython for the L4 but MicroPython has:

- Interrupt and asyncio support
- Usual peripheral support (SPI, I2C, UART - incl LPUART, ADC, DAC, CAN)
- I2S (relatively new)
- A secure way to perform upgrades
- Low power support (light/deep sleep and clock frequency adjustment)
- LittleFS support (a more robust filesystem)
- Statically defined pins including optional labels per pin (refer to a pin with machine.Pin.board.SWAN\_SPECIFIC\_LED or machine.Pin.cpu.C4 or “C4”)

I’m sure there are others. In any case, for the stm port in particular, it’s very easy to create a board. Let me know if you want a hand doing so.

Cheers,  
Matt

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [October 15, 2021, 2:32pm UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/5 "2021-10-15T14:32:10Z")

</div>

This is really useful, thanks! We’re going to look into MicroPython support at some point here, so we’ll do our best to keep folks notified on this thread. 👍

---

<div class="post-metadata">

**Author:** ![PostThis](https://avatars.discourse-cdn.com/v4/letter/p/5f8ce5/32.png) [@PostThis](https://discuss.blues.com/u/PostThis)\
**Post date:** [October 15, 2021, 4:54pm UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/6 "2021-10-15T16:54:05Z")

</div>

Great info @matt . Thanks. I certainly wish circuitPython had interrupt support. That’s a big one for me. From what I recall, micropython libraries for sensors and such were far and few between while circuitPython has hundreds (looked at them this morning). I realize there are probably a few little changes needed to make the libraries compatible. In any case, I would like to have what you described in micropython but with all the yummy circuitPython libraries. I want to have my cake and eat it, too.

---

<div class="post-metadata">

**Author:** ![matt](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/matt/32/270_2.png) [@matt](https://discuss.blues.com/u/matt)\
**Post date:** [October 16, 2021, 2:05pm UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/7 "2021-10-16T14:05:58Z")

</div>

@PostThis CircuitPython libraries are almost all centralised which makes them much easier to find.

MicroPython’s are distributed but, thankfully, Mike Causer is doing a great job indexing a lot of them at his [awesome-micropython](https://awesome-micropython.com/) page. There are a lot listed there but, if you want to use any of the CircuitPython libraries they’re usually pretty trivial to port to MicroPython.

@RobLauer great, I’ll keep an eye on this thread then 🙂 I only just noticed there was a published schematic; if I can find any spare time I’ll try and flesh out a basic board definition…

---

<div class="post-metadata">

**Author:** ![JimM](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/jimm/32/16_2.png) [@JimM](https://discuss.blues.com/u/JimM)\
**Post date:** [October 18, 2021, 1:48pm UTC](https://discuss.blues.com/t/low-power-using-circuitpython-on-the-new-swan-board/434/8 "2021-10-18T13:48:54Z")

</div>

@PostThis I too think robust interrupt support is essential for when external events versus timers need to wake up the processor from low power modes, without limiting the application to simply restarting.
