SlideShare a Scribd company logo
1 of 15
Getting Started with
MicroPython
on the
Raspberry Pi Pico
Toronto Raspberry Pi Meetup Group
2021-02-11
Stewart Russell – scruss@scruss.com
What, another one?
 Not a Linux machine:
a microcontroller
 Custom silicon, designed by
Raspberry Pi Foundation
 Lots of I/O
 Great documentation
 $5.25 🇨🇦, any qty.
 Arduino killer
Image credit: Raspberry Pi Foundation
RP2040 Overview
 Dual-core ARM Cortex-M0+ at 133 MHz
 264 KB RAM
 No Flash storage
(Pico has 2 MB external)
 26 × multi-function GPIO pins
 2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit
ADC, 16 × PWM
 8 × PIO state machines
Image credit: Raspberry Pi Foundation
So where do I get one?
 In theory, you can buy as
many as you want, but:
 BuyaPi: Sold Out
 Canakit: Sold Out
(preorders ship Feb 28)
 Elmwood: Sold Out
 Newark, Digikey: on order
 My Canada Post experience
 BuyaPi: ordered Jan 21, arrived Feb 2.
Average speed: house spider
 Elmwood: ordered Jan 27, arrived Feb
3.
Average speed: 3-toed sloth
 Don’t use Canada Post because 😷
What is MicroPython?
 Python 3 implementation
 Small: 256 KB flash, 16 KB RAM (minimum)
 Compiled on-chip; standalone
 Subset of standard Python library
 Core developers were hired to implement for Pico
 Now includes ARMv6M assembler
 micropython.org
MicroPython Differences
 System libraries are typically limited, e.g.:
 Strings are always UTF-8; 8-bit codecs excluded
 Time is monotonic (fractional) seconds: no timezones or DST
 No CSV, numpy, pip (→ upip), …
 .py → .mpy (like .pyc) compilation isn’t automatic
 Hardware interface modules:
 machine: for hardware features like pins, PWM, I²C, ADC, …
 rp2: RP2040 PIO assembler, raw Flash access
 help() docstrings short or absent: see online docs
Flashing MicroPython
 Pico firmware is distributed as UF2
images
 Hold BOOTSEL while plugging in
 Pico appears as a USB storage
device
 Drag/copy UF2 to PICO storage
 Pico reboots; USB disappears
Image credit: Raspberry Pi Foundation
Editing: Thonny
 Raspberry Pi Foundation’s
recommended editor
 Installed by default
 Includes loading/saving to
Pico flash
 Has a simple graph tool
 … plus firmware updater
 … and (Raspberry) REPL
sorry not sorry
(and no, I don’t know why the graph broke)
“but my $EDITOR …!!1!”
 You don’t have to use Thonny
 … it’s just more work if you don’t.
 The command-line MicroPython tool with REPL access is rshell:
https://github.com/dhylands/rshell/tree/pico
 Make sure you get the this branch, as it handles the quirks of the
Pico’s RTC
 … and yes, the Foundation has shipped yet another device which
doesn’t have battery backup on its clock ☹
All of the Pins
raspberrypi.org/documentation/pico/getting-started
Documentation
 This is absolutely stellar for a board at launch + 3 weeks
 Data sheets, API guides, code, Fritzing parts … all at
raspberrypi.org/documentation/pico/getting-started
Unexpected Quirks
 It’s a new board, and folks are just learning, but:
1 ADC: default analogue-to-digital setup is quite noisy
2 PWM: duty cycle changes if frequency is changed
3 UART Serial: has no wait/timeout, will lock if read and no data
waiting
4 Dual core/threading: seems to be not well understood yet
Worked example
 Trevor Woerner used an MCP3008 with a thermistor and
Raspberry Pi last month:
 Let’s use a Pico
 … which is cheaper than
an MCP3008 (by 50¢ !)
 … and can act as a serial
datalogger, perhaps
writing to a Raspberry Pi over USB serial.
Image credit: Trevor Woerner
twoerner.blogspot.com/2021/01/sensing-temperature-with-raspberrypi.html
Wiring
 Pins used:
 ADC2 (pin 34)
 3V3 (pin 36)
 AGND (pin 33)
 10 kΩ resistor between 3V3
and thermistor
 10 kΩ @ 25 °C thermistor, β
= 3950
Getting Started with MicroPython on the Raspberry Pi Pico

More Related Content

What's hot

Applications of microprocessor
Applications of microprocessorApplications of microprocessor
Applications of microprocessorAnjali Agrawal
 
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Moe Moe Myint
 
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUCONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUVINAY KUMAR GUDELA
 
Home automation- An Iot application
Home automation- An Iot applicationHome automation- An Iot application
Home automation- An Iot applicationArchana Golhar
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IVineethMP2
 
Advance Microcontroller AVR
Advance Microcontroller AVRAdvance Microcontroller AVR
Advance Microcontroller AVRDaksh Raj Chopra
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems VijayKumar5738
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
Automatic water level monitoring and control system using IoT
Automatic water level monitoring and control system using IoTAutomatic water level monitoring and control system using IoT
Automatic water level monitoring and control system using IoTDanish Mehraj
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controllerabhikalmegh
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systemsRAMPRAKASHT1
 

What's hot (20)

Applications of microprocessor
Applications of microprocessorApplications of microprocessor
Applications of microprocessor
 
ARM Architecture
ARM ArchitectureARM Architecture
ARM Architecture
 
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
Ch 1 introduction to Embedded Systems (AY:2018-2019--> First Semester)
 
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCUCONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
CONTROLLING HOME APPLIANCES WITH IOT,BLYNK APP & NODE MCU
 
Serial Communication in 8051
Serial Communication in 8051Serial Communication in 8051
Serial Communication in 8051
 
Raspberry Pi
Raspberry Pi Raspberry Pi
Raspberry Pi
 
Home automation- An Iot application
Home automation- An Iot applicationHome automation- An Iot application
Home automation- An Iot application
 
ARM Micro-controller
ARM Micro-controllerARM Micro-controller
ARM Micro-controller
 
8051 interfacing
8051 interfacing8051 interfacing
8051 interfacing
 
ATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part IATmega32-AVR microcontrollers-Part I
ATmega32-AVR microcontrollers-Part I
 
Advance Microcontroller AVR
Advance Microcontroller AVRAdvance Microcontroller AVR
Advance Microcontroller AVR
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems
 
ARM Processors
ARM ProcessorsARM Processors
ARM Processors
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Embedded system introduction
Embedded system introductionEmbedded system introduction
Embedded system introduction
 
Wimax / ieee 802.16
Wimax / ieee 802.16Wimax / ieee 802.16
Wimax / ieee 802.16
 
Automatic water level monitoring and control system using IoT
Automatic water level monitoring and control system using IoTAutomatic water level monitoring and control system using IoT
Automatic water level monitoring and control system using IoT
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
IoT with Arduino
IoT with ArduinoIoT with Arduino
IoT with Arduino
 
Introduction to embedded systems
Introduction  to embedded systemsIntroduction  to embedded systems
Introduction to embedded systems
 

Similar to Getting Started with MicroPython on the Raspberry Pi Pico

Raspberry Pi Hacks
Raspberry Pi HacksRaspberry Pi Hacks
Raspberry Pi HacksImad Rhali
 
Introduction to the rapid prototyping with python and linux for embedded systems
Introduction to the rapid prototyping with python and linux for embedded systemsIntroduction to the rapid prototyping with python and linux for embedded systems
Introduction to the rapid prototyping with python and linux for embedded systemsNaohiko Shimizu
 
Presentation raspberry pi
Presentation   raspberry piPresentation   raspberry pi
Presentation raspberry piMarco Casini
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PICliff Samuels Jr.
 
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...Ravindranath67
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfWiseNaeem
 
Getting started pi with android
Getting started pi with androidGetting started pi with android
Getting started pi with androidMasafumi Ohta
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry piHusainBhaldar21
 
Single Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi BasicsSingle Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi BasicsEueung Mulyana
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfWiseNaeem
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfWiseNaeem
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110Masafumi Ohta
 
Raspberry-PI introduction
Raspberry-PI introductionRaspberry-PI introduction
Raspberry-PI introductionBasavaraj Sagar
 
Raspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 updateRaspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 updateKevin Hooke
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Piyeokm1
 
Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Mandeesh Singh
 

Similar to Getting Started with MicroPython on the Raspberry Pi Pico (20)

Raspberry Pi Hacks
Raspberry Pi HacksRaspberry Pi Hacks
Raspberry Pi Hacks
 
Introduction to the rapid prototyping with python and linux for embedded systems
Introduction to the rapid prototyping with python and linux for embedded systemsIntroduction to the rapid prototyping with python and linux for embedded systems
Introduction to the rapid prototyping with python and linux for embedded systems
 
Presentation raspberry pi
Presentation   raspberry piPresentation   raspberry pi
Presentation raspberry pi
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...
IOT Experiment-2.pptx --- Hands on Approach & Easy to learn IOT Basics...
 
Raspberry Pi
Raspberry PiRaspberry Pi
Raspberry Pi
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Getting started pi with android
Getting started pi with androidGetting started pi with android
Getting started pi with android
 
Raspberry Pi
 Raspberry Pi  Raspberry Pi
Raspberry Pi
 
report
reportreport
report
 
My presentation raspberry pi
My presentation raspberry piMy presentation raspberry pi
My presentation raspberry pi
 
Single Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi BasicsSingle Board Computers & Raspberry Pi Basics
Single Board Computers & Raspberry Pi Basics
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110
 
Raspberry-PI introduction
Raspberry-PI introductionRaspberry-PI introduction
Raspberry-PI introduction
 
Raspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 updateRaspberry Pi and Amateur Radio - 2020 update
Raspberry Pi and Amateur Radio - 2020 update
 
Getting Started with Raspberry Pi
Getting Started with Raspberry PiGetting Started with Raspberry Pi
Getting Started with Raspberry Pi
 
Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014Raspberry Pi Free Session - 20_09_2014
Raspberry Pi Free Session - 20_09_2014
 
Bringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near YouBringing Tizen to a Raspberry Pi 2 Near You
Bringing Tizen to a Raspberry Pi 2 Near You
 

Recently uploaded

Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Getting Started with MicroPython on the Raspberry Pi Pico

  • 1. Getting Started with MicroPython on the Raspberry Pi Pico Toronto Raspberry Pi Meetup Group 2021-02-11 Stewart Russell – scruss@scruss.com
  • 2. What, another one?  Not a Linux machine: a microcontroller  Custom silicon, designed by Raspberry Pi Foundation  Lots of I/O  Great documentation  $5.25 🇨🇦, any qty.  Arduino killer Image credit: Raspberry Pi Foundation
  • 3. RP2040 Overview  Dual-core ARM Cortex-M0+ at 133 MHz  264 KB RAM  No Flash storage (Pico has 2 MB external)  26 × multi-function GPIO pins  2 × SPI, 2 × I2C, 2 × UART, 3 × 12-bit ADC, 16 × PWM  8 × PIO state machines Image credit: Raspberry Pi Foundation
  • 4. So where do I get one?  In theory, you can buy as many as you want, but:  BuyaPi: Sold Out  Canakit: Sold Out (preorders ship Feb 28)  Elmwood: Sold Out  Newark, Digikey: on order  My Canada Post experience  BuyaPi: ordered Jan 21, arrived Feb 2. Average speed: house spider  Elmwood: ordered Jan 27, arrived Feb 3. Average speed: 3-toed sloth  Don’t use Canada Post because 😷
  • 5. What is MicroPython?  Python 3 implementation  Small: 256 KB flash, 16 KB RAM (minimum)  Compiled on-chip; standalone  Subset of standard Python library  Core developers were hired to implement for Pico  Now includes ARMv6M assembler  micropython.org
  • 6. MicroPython Differences  System libraries are typically limited, e.g.:  Strings are always UTF-8; 8-bit codecs excluded  Time is monotonic (fractional) seconds: no timezones or DST  No CSV, numpy, pip (→ upip), …  .py → .mpy (like .pyc) compilation isn’t automatic  Hardware interface modules:  machine: for hardware features like pins, PWM, I²C, ADC, …  rp2: RP2040 PIO assembler, raw Flash access  help() docstrings short or absent: see online docs
  • 7. Flashing MicroPython  Pico firmware is distributed as UF2 images  Hold BOOTSEL while plugging in  Pico appears as a USB storage device  Drag/copy UF2 to PICO storage  Pico reboots; USB disappears Image credit: Raspberry Pi Foundation
  • 8. Editing: Thonny  Raspberry Pi Foundation’s recommended editor  Installed by default  Includes loading/saving to Pico flash  Has a simple graph tool  … plus firmware updater  … and (Raspberry) REPL sorry not sorry (and no, I don’t know why the graph broke)
  • 9. “but my $EDITOR …!!1!”  You don’t have to use Thonny  … it’s just more work if you don’t.  The command-line MicroPython tool with REPL access is rshell: https://github.com/dhylands/rshell/tree/pico  Make sure you get the this branch, as it handles the quirks of the Pico’s RTC  … and yes, the Foundation has shipped yet another device which doesn’t have battery backup on its clock ☹
  • 10. All of the Pins raspberrypi.org/documentation/pico/getting-started
  • 11. Documentation  This is absolutely stellar for a board at launch + 3 weeks  Data sheets, API guides, code, Fritzing parts … all at raspberrypi.org/documentation/pico/getting-started
  • 12. Unexpected Quirks  It’s a new board, and folks are just learning, but: 1 ADC: default analogue-to-digital setup is quite noisy 2 PWM: duty cycle changes if frequency is changed 3 UART Serial: has no wait/timeout, will lock if read and no data waiting 4 Dual core/threading: seems to be not well understood yet
  • 13. Worked example  Trevor Woerner used an MCP3008 with a thermistor and Raspberry Pi last month:  Let’s use a Pico  … which is cheaper than an MCP3008 (by 50¢ !)  … and can act as a serial datalogger, perhaps writing to a Raspberry Pi over USB serial. Image credit: Trevor Woerner twoerner.blogspot.com/2021/01/sensing-temperature-with-raspberrypi.html
  • 14. Wiring  Pins used:  ADC2 (pin 34)  3V3 (pin 36)  AGND (pin 33)  10 kΩ resistor between 3V3 and thermistor  10 kΩ @ 25 °C thermistor, β = 3950

Editor's Notes

  1. You can buy a whole reel of 480 for $2655 from Digikey: https://www.digikey.ca/en/products/detail/raspberry-pi/SC0915/13624793 Pins are not included. Board is castellated and can be surface-mounted to other electronics. Not really an Arduino killer: Arduino have announced the Arduino Micro Connect based on the RP2040 (price tba)
  2. Someone else will cover the deeper details soon It also has: * RTC * Low power sleep modes * Hardware RNG (though not crypto) Can be massively overclocked. The above photo was an early piece of test silicon: it’s not available in CERDIP format (boo!)
  3. Pico doesn’t export any USB storage, and some people don’t like the BOOTSEL process. You can use SWD to upload, and another Pico makes a good SWD probe