tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

CircuitPython!

Thu Jan 21, 2021 8:04 am

Hi all! CircuitPython is also available for the Pico and generally RP2040 boards. You load it just like loading MicroPython.

While CircuitPython is based on MicroPython, there are some key differences why you may want to use CircuitPython instead of MicroPython.

1) Editing code is simpler because CircuitPython presents a CIRCUITPY drive with a code.py file on it you edit. When you save the file, your code is automatically rerun. See Welcome to CircuitPython for details.
2) There are 300+ libraries for the standard CircuitPython API. Most of these will already work. Listed here
3) Tons of guides and tutorials at https://learn.adafruit.com/category/circuitpython
4) Most CircuitPython libraries also work on Raspberry Pis via the Blinka library.

You may want to use MicroPython for:
1) Advanced APIs such as interrupts and threading.
2) Complete PIO API (CircuitPython's support is incomplete)
3) Using existing MicroPython code

To get started, download CircuitPython for the Pico from circuitpython.org: https://circuitpython.org/board/raspberry_pi_pico/

For now, click "Absolute Newest", then click your language code such as "en_US", and finally download the UF2 file at the top. That will be the latest and greatest version of CircuitPython. As support matures, the download page will have beta and then stable releases.

After dragging the CircuitPython UF2 to RPI-RP2 the chip will reset and show a CIRCUITPY drive.

See the Welcome to CircuitPython and CircuitPython Essentials guides for CircuitPython basics. API Docs are here though they won't include RP2040 specific modules until support is merged in. A Pico specific guide that will grow in time is here.

Join the Adafruit Discord for #help-with-circuitpython and feel free to mention me (@tannewt) for RP2040 specific questions.

The current code is available here: https://github.com/adafruit/circuitpython/pull/4031
Last edited by tannewt on Mon Apr 05, 2021 11:12 pm, edited 1 time in total.

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Sat Jan 23, 2021 1:58 am

Update! We've release CircuitPython 6.2.0-beta.0 with the initial RP2040 support. You can download it here: https://circuitpython.org/board/raspberry_pi_pico/

The CircuitPython PIOASM library is also available to assemble pioasm text into the encoded instruction bytes. It is here: https://github.com/adafruit/Adafruit_Ci ... hon_PIOASM

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Wed Jan 27, 2021 11:11 pm

Hi folks! Just wanted to post that we released 6.2.0-beta.1! It's got a few RP2040 changes including adding GP15 to Pico's board.

You can find the UF2s here: https://circuitpython.org/board/raspberry_pi_pico/

Full release notes are here: https://github.com/adafruit/circuitpyth ... 2.0-beta.1

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Fri Feb 05, 2021 8:31 pm

Hi folks, just wanted to drop in to say we now have a guide with the examples from the MicroPython Getting Started Book but for CircuitPython! Now you can follow along and use CircuitPython for the examples.

The guide is here: https://learn.adafruit.com/getting-star ... cuitpython

It also covers how to get and install CircuitPython on the Pico.

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Thu Feb 11, 2021 8:10 pm

Just another update! We've released CircuitPython 6.2.0-beta.2. You can get it here. Here are the release notes:
This is the third beta release of CircuitPython 6.2.0. This release, 6.2.0-beta.2, contains fixes and improvements, most notably for RP2040 and ESP32-S2. See Port status below for details on port stability for each port, and Known issues for known problems. If you find any issues with this release, please file an issue.

Download from circuitpython.org
Firmware downloads are available from the downloads page on circuitpython.org. The site makes it easy to select the correct file and language for your board.

Installation
To install follow the instructions in our new Welcome to CircuitPython! guide. To install the latest libraries, see this page in that guide.

Try the latest version of the Mu editor for creating and editing your CircuitPython programs and for easy access to the CircuitPython serial connection (the REPL).

Port status
CircuitPython has a number of "ports" that are the core implementation for a variety of microcontroller families. Stability varies on a per-port basis. As of this release, atmel-samd, nrf, and stm for the F4 family are stable. cxd56, esp32s2, raspberrypi, and stm for other STM chip families are being actively improved but may be missing functionality and have bugs. litex and mimxrt10xx are in an alpha state and will have bugs and missing functionality.

Changes since 6.2.0-beta.1
Fixes and enhancements
  • pew.tick() now does its own time-keeping. #3536. Thanks @deshipu
  • Fix write_then_readinto() in native adafruit_bus_device I2CDevice. #4146. Thanks @gamblor21.
  • Ensure tud_task() is run on auto-reload to finish USB writes. #4122. Thanks @hathach.
  • Add WEBUSB serial support (turned off by default). #4126. Thanks @FiriaCTO.
  • Clarify I2C pullup error message. #4118. Thanks @BiffoBear.
  • Fix native adafruit_bus_device for boards without longint. #4112. Thanks @gamblor21.
  • Update ulab to 1.7.2. #4089. Thanks @jepler.
  • RGBMatrix: change default to serpentine=True. #4084. Thanks @jepler.
Board- and port-specific changes
  • ESP32-S2:
    • Fix sockets created by accept(). #4139. Thanks @hierophect.
    • Fix deep sleep wakeup sometimes appearing to be brownout wakeup. #4159. Thanks @dhalbert and thanks @jfabernathy for testing.
    • Improve socket arg validation and clean up internal types use for argument passing. #4136. Thanks @hierophect.
    • Fix socket connect error. #4138. Thanks @hierophect.
    • Fix socket.recv_into() receiving one less byte than expected. #4148. Thanks @Neradoc.
    • Separate SSLSocket from Socket. #4049. Thanks @hierophect.
    • Fix default socket timeout. #4095. Thanks @hierophect.
  • raspberrypi:
    • Fix PWMOut idea of which channels are variable frequency. #4165. Thanks @DavePutz.
    • rp2pio: transfer up to 32 bytes before checking background tasks. Fixes use of short NeoPixel strips. #4155. Thanks @jepler, @gamblor21, and @jerryneedell.
    • neopixel_write: Set NeoPixel pin as output after PIO use, to avoid spurious signals. #4160. Thanks @gamblor21.
    • Initialize display for Lilygo TTGO T8 ESP32-S2. #4124. Thanks @m4tk.
    • Correct maximum allowed number of PIO instructions. #4154. Thanks @LuminousOwl.
    • Update to very latest pico-sdk. Fixes issues with GP15 and adds unique id support. #4141. Thanks @tannewt.
    • Add (internal-only) board.SMPS pin, which toggles internal regulator PWM mode. #4137. Thanks @ferret-guy.
    • Add (internal-only) board.A3/board.VOLTAGE_MONITOR pin. #4125. Thanks @xorbit.
    • Implement microcontroller.reset() and .reset_to_bootloader(). #4123. Thanks @jepler.
    • Support for RTC. #4110. Thanks @microDev1.
    • Support for watchdog timer. #4083. Thanks @microDev1.
    • Change microcontroller.cpu to refer to the current CPU, restoring .cpu.temperature, etc. Add microcontrollers.cpus[]. #4087. Thanks @DavePutz.
    • Enable Gameduino 3x Dazzler support. #4092. Thanks @jamesbowman.
  • mimxrt10xx:
    • Fix SPI OSErrors. #4048. Thanks @janderit.
  • nrf:
    • Add UART hardware flow control. #4018. Thanks @iot49.
  • Metro M4 Airlift Lite:
    • Enable Gameduino 3x Dazzler support. #4054. Thanks @dglaude.
Build and infrastructure changes
  • Add bitmap_font to sys.path in a better place to fix builds. #4140. Thanks @FoamyGuy.
  • Update to actions/cache@v2. #4090. Thanks @jepler.
  • Fix circuitpython.org automatic PR new-languages list. #4080. Thanks @tannewt.
Documentation
  • sdcardio: Add caution about sharing SPI bus with SD cards and other devices. #4163. Thanks @jepler.
  • Translation additions and improvements. Thanks:
    • @bergdahl (Swedish)
    • @hexthat (Chinese Pinyin)
    • @fede2cr (Spanish)
    • @wtuemura (Portugese - Brazil)
    • @BumblebeeMan (German)
    • @jepler (German)
    • @hugodahl (French)
    • @Anton-2 (French)
    • @tawez (Polish)
New boards since 6.2.0-beta.1
  • DynaLora-USB Dongle. #4168. Thanks @ecasadod.
  • Lilygo TTGO T8 ESP32-S2. #4077. Thanks @netroy.
  • Silicognition LLC M4-Shim. #4105. Thanks @xorbit.
Full commit log is here.

Breaking changes since 5.x
  • i2cslave is now i2cperipheral and the class in it is changed as well.
  • The stop kwarg has been removed from I2C.writeto(). If no stop is desired, then use writeto_then_readfrom.
  • The default speed of busio.I2C and board.I2C is now 100khz, not 400khz as before. Use busio.I2C to set the speed explicitly. #3471 Thanks @caternuson, @ladyada, @hierophect and @tannewt.
  • _bleio.ConnectionError has be removed. Code will now raise the native ConnectionError instead.
Known issues Thanks
Thank you to all who used, tested, and contributed since 6.2.0-beta.1, including @ajs256, @anecdata, @Anton-2, @bergdahl, @BiffoBear, @bspsbee, @BumblebeeMan, @DavePutz, @dglaude, @dhalbert, @ecasadod, @fede2cr, @ferret-guy, @FiriaCTO, @FoamyGuy, @gamblor21, @hathach, @hexthat, @hierophect, @hugodahl, @jamesbowman, @jepler, @jerryneedell, @jfabernathy, @kamtom480, @ladyada, @LuminousOwl, @m4tk, @microDev1, @Neradoc, @netroy, @nichols10, @rpavlik, @siehputz, @skieast, @StarWitch, @tannewt, @tawez, @theacodes, @weblate, @wtuemura, @xorbit,, and many others on GitHub and Discord. Join us on the Discord chat to collaborate.

Documentation
Documentation is available in readthedocs.io.

This release is based on MicroPython 1.9.4 @25ae98f. Support upstream MicroPython by purchasing a PyBoard (from Adafruit here) or sponsoring MicroPython on GitHub.

Translations
One important feature of CircuitPython is translated control and error messages. With the help of fellow open source project Weblate, we're making it even easier to add or improve translations. Sign in with an existing account such as Github, Google or Facebook and start contributing through a simple web interface. No forks or pull requests needed!

Troubleshooting
Check out this guide for info on common problems with CircuitPython. If you are still having issues, then post to the Adafruit Support Forums and join Discord.

Assets
Builds are no longer stored as assets on this release page, because there are too many of them. Please see the Download from circuitpython.org section above.

User avatar
scruss
Posts: 4778
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON

Re: CircuitPython!

Thu Feb 11, 2021 8:35 pm

Will you be developing/releasing a high-level module for the board, equivalent to say Adafruit_CircuitPython_CircuitPlayground for the CPX? I know that the Pico doesn't have that many toys built-in, but it's a useful start for beginners
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Fri Feb 12, 2021 7:58 pm

Not for the Pico because it only has an on-board LED. We generally only do so for boards with on board sensors which require library initialization.

We think the guide (https://learn.adafruit.com/getting-star ... cuitpython) is enough for the Pico.

MisterD91
Posts: 2
Joined: Tue Feb 23, 2021 3:00 pm

Re: CircuitPython!

Tue Feb 23, 2021 3:03 pm

Hello,

while i was playing with circuitPython i found that DHT22 sensors are not wirking because "pulseio" is still missing. I read on github that its beeing worked on.

Is there a place where i can see what features are still missing?

Also is there some support for multithreading planed?

thanks a lot!

MisterD91
Posts: 2
Joined: Tue Feb 23, 2021 3:00 pm

Re: CircuitPython!

Wed Feb 24, 2021 7:48 am

How much of the Pico is supported at the moment? i found out that "pulseio" is not supported and it is needed for DHTxx sensors!

are there any plans for threading?

dhalbert
Posts: 15
Joined: Mon Feb 16, 2015 10:39 pm

Re: CircuitPython!

Wed Feb 24, 2021 1:51 pm

All the RP2040-specific issues, including features left to implement, are tagged in the CircuitPython repo: https://github.com/adafruit/circuitpyth ... abel%3Arp2. You can review the list to see what we have left to do; the milestones indicate by when we want to add features or fix certain bugs, though they are subject to change.

We are actively thinking about multi-processing in one form or another, but have not yet settled on exactly what to do.

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Fri Feb 26, 2021 1:13 am

MisterD91 wrote:
Wed Feb 24, 2021 7:48 am
How much of the Pico is supported at the moment? i found out that "pulseio" is not supported and it is needed for DHTxx sensors!
There is a work-in-progress PR to add PulseIn support here: https://github.com/adafruit/circuitpython/pull/4262

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Mon Apr 05, 2021 11:15 pm

Hi folks, just wanted to point out CircuitPython 6.2.0 has been released. It is the first stable release with RP2040 support. Includes most of the existing CircuitPython APIs and a detailed PIO API. It is a great foundation for Pico and other RP2040 projects. Download it for Pico here: https://circuitpython.org/board/raspberry_pi_pico/ The release notes are here: https://github.com/adafruit/circuitpyth ... /tag/6.2.0

hippy
Posts: 11966
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: CircuitPython!

Tue Apr 06, 2021 11:03 am

tannewt wrote:
Mon Apr 05, 2021 11:15 pm
CircuitPython 6.2.0 has been released. It is the first stable release with RP2040 support.
Excellent news.

Are there instructions for adding C extension modules, particularly regarding how to include such when building the RP2 port. Things seem to have changed from what was published for version 4.0 -

https://learn.adafruit.com/extending-ci ... al-machine

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Wed Apr 07, 2021 12:38 am

hippy wrote:
Tue Apr 06, 2021 11:03 am
tannewt wrote:
Mon Apr 05, 2021 11:15 pm
CircuitPython 6.2.0 has been released. It is the first stable release with RP2040 support.
Excellent news.

Are there instructions for adding C extension modules, particularly regarding how to include such when building the RP2 port. Things seem to have changed from what was published for version 4.0 -

https://learn.adafruit.com/extending-ci ... al-machine
Those are the most up to date instructions unfortunately (and they are somewhat out of date.) We're happy to help folks get going through our Discord chat: https://adafru.it/discord

What module do you have in mind? I could point you to a more recent PR that does something similar.

hippy
Posts: 11966
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: CircuitPython!

Wed Apr 07, 2021 3:11 pm

There's no particular module I need at this time. I was more interested in doing it, seeing if I can mould CircuitPython to how I might like it as I can for MicroPython, how to do that. It seems it is possible, that whole page describes doing it, it's just that it's out of date and doesn't work the way it's described.

tannewt
Posts: 71
Joined: Tue Nov 17, 2020 1:14 am

Re: CircuitPython!

Wed Apr 07, 2021 4:04 pm

hippy wrote:
Wed Apr 07, 2021 3:11 pm
There's no particular module I need at this time. I was more interested in doing it, seeing if I can mould CircuitPython to how I might like it as I can for MicroPython, how to do that. It seems it is possible, that whole page describes doing it, it's just that it's out of date and doesn't work the way it's described.
The concepts should be the same but the Makefile setup has changed somewhat. Here is a recently added module: https://github.com/adafruit/circuitpython/pull/3612 Ignore the board stuff because this module replaced a frozen python one. Feel free to ask about it on our Discord too.

Return to “General”