| |
python:micropython:raspypico2040 [2023/05/07 09:21] – [7. Exemples de programmes] phil | python:micropython:raspypico2040 [Date inconnue] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 |
---|
[[:python:micropython:accueil|{{ :iconemaison.jpg?nolink&30|Sommaire MicroPython, CircuitPython}}]] | |
| |
===== MicroPython - Les modules Raspberry Pi Pico et Pico W ===== | |
| |
{{ :python:micropython:mycropythonraspi.png?nolink|}} | |
[Mise à jour le 13/3/2023] | |
| |
* **Ressources** | |
* Documentation sur <html><a href="https://www.raspberrypi.com/documentation/microcontrollers/" target="_blank">raspberrypi.com</a></html> | |
* Documentation <html><a href="https://docs.micropython.org/en/latest/index.html" target="_blank">MicroPython</a></html> | |
* <html><a href="https://thonny.org/" target="_blank">IDE Thonny</a></html> | |
| |
* **Distributeur** : <html><a href="https://www.gotronic.fr/art-carte-raspberry-pi-pico-33027.htm" target="_blank">Go Tronic</a></html> | |
| |
<callout type="primary" icon="true">Les cartes Raspberry Pi Pico et Pico W sont basées sur un circuit <html><a href="https://www.raspberrypi.com/documentation/microcontrollers/rp2040.html#welcome-to-rp2040" target="_blank">RP2040</a></html> conçu par Raspberry Pi. Il est très simple, a d'excellentes performances et un coût très faible (~5€). Sa programmation en MicroPython se fait via **REPL**, par **glisser-déposer** ou directement avec l'**IDE Thonny**.</callout> | |
| |
==== 1. Raspberry Pi Pico ==== | |
* **Source** : documentation du <html><a href="https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html" target="_blank">Raspberry Pi Pico </a> sur le site raspberrypi.com</html> | |
| |
=== 1.1 Brochage === | |
{{ :python:micropython:raspipico.jpg?nolink&900 |}} | |
| |
=== 1.2 Caractéristiques === | |
{{ :python:micropython:19536_3.png?nolink&350|}} | |
* **Alimentation**: | |
* 5 Vcc via micro USB | |
* 1,8 à 5,5 Vcc via la broche VSYS | |
* **Microcontrôleur**: <html><a href="https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf" target="_blank">RP2040</a></html> | |
* **Microprocesseur**: ARM Cortex-M0+ Dual Core à 133 MHz | |
* **Mémoire SRAM**: 264 KB | |
* **Mémoire Flash**: 2 MB externe | |
* **26 broches GPIO** comprenant: | |
* 23 x E/S digitales | |
* 3 x entrées analogiques (via ADC 12 bit) | |
* 2 x interfaces UART | |
* 2 x bus I2C | |
* 16 x sorties PWM | |
* 1 x port micro-USB 1.1: alimentation, programmation, hôte USB et périphérique de stockage USB | |
* 1 x interface SWD de debug | |
* **Module** RTC intégré | |
* **LED** programmable sur GP25 | |
* **Capteur** de température intégré | |
| |
=== 1.3 PDF === | |
* <html><a href="https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf" target="_blank">Raspberry Pi Pico Datasheet</a></html> | |
* <html><a href="https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf" target="_blank">Getting started with Raspberry Pi Pico</a></html> | |
* <html><a href="https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf" target="_blank">Raspberry Pi Pico Python SDK</a></html> | |
| |
<callout type="warning" icon="true">Les entrées et sorties logiques de cette carte sont uniquement compatibles **3,3Vcc**. Une tension supérieure endommagerait irrémédiablement la Raspberry Pi Pico.</callout> | |
| |
==== 2. Raspberry Pi Pico W ==== | |
* **Source** : documentation du <html><a href="https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html" target="_blank">Raspberry Pi Pico W</a> sur le site raspberrypi.com</html> | |
| |
=== 2.1 Brochage === | |
{{ :python:micropython:pinoutpicow.jpg?nolink& |}} | |
| |
=== 2.2 Caractéristiques === | |
Raspberry Pi Pico W ajoute des interfaces sans fil monobande 2,4 GHz intégrées (802.11n) à l'aide de l'**Infineon CYW43439** tout en conservant le facteur de forme Pico. L'interface sans fil 2,4 GHz intégrée présente les caractéristiques suivantes : | |
| |
* Wifi 4 (802.11n) + Bluetooth 5.2, bande unique (2,4 GHz) | |
| |
* WPA3 | |
| |
* Point d'accès logiciel prenant en charge jusqu'à **quatre clients** | |
| |
L'antenne est une antenne embarquée sous licence d'ABRACON (anciennement ProAnt). | |
| |
=== 2.3 PDF === | |
* <html><a href="https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf" target="_blank">Raspberry Pi Pico W Datasheet</a></html> | |
* <html><a href="https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf" target="_blank">Connecting to the Internet with Raspberry Pi Pico W</a></html> | |
* <html><a href="https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf" target="_blank">Raspberry Pi Pico Python SDK</a></html> | |
| |
==== 3. Kit de développement Windows (SDK) ==== | |
<html><a href="https://www.domo-blog.fr/la-fondation-raspberry-pi-officialise-kit-developpement-windows-pour-raspberry-pico/" target="_blank">La fondation Raspberry Pi officialise un kit de développement Windows pour le Raspberry Pico</a></html> | |
| |
==== 4. Les shields ==== | |
=== 4.1 Shield Grove === | |
Le <html><a href="https://wiki.seeedstudio.com/Grove_Shield_for_Pi_Pico_V1.0/" target="_blank">Grove Shield Pico</a></html> est une carte d'interface permettant de raccorder sans soudure les capteurs et actionneurs Grove sur une carte Raspberry Pi Pico (W). <html><a href="https://files.seeedstudio.com/wiki/Grove_Shield_for_Pi_Pico_V1.0/Grove_shield_for_PI_PICOv1.0SCH.pdf" target="_blank">[Schéma]</a></html> | |
{{ :python:micropython:pico_hardware.png?nolink&400 |}} Il est équipé de 10 connecteurs 4 broches dont : | |
* 3 entrées analogiques, | |
* 3 entrées-sorties logiques, | |
* 2 interfaces I2C et | |
* 2 interfaces UART. | |
| |
Le bus SPI est accessible sur un connecteur 6 broches mâles. | |
| |
**Brochage des connecteurs**: GND - Vcc - signal 2 - signal 1 | |
<callout type="warning" icon="true">Attention à la **position du commutateur** permettant de régler **Vcc=5V** ou **Vcc=3,3V** sur les connecteurs.</callout> | |
| |
=== 4.2 Pico OMNIBUS === | |
Doublez les broches GPIO et attachez deux modules complémentaires à un seul Raspberry Pi Pico avec <html><a href="https://shop.pimoroni.com/products/pico-omnibus?variant=32369533321299" target="_blank">Pico Omnibus</a></html>. | |
{{ :python:micropython:pim-556_0-1024x768.jpg?nolink&400 |}} | |
| |
==== 5. Installer Python sur la Rpi Pico (W) ==== | |
* **Voir le tutoriel** <html><a href="https://how2electronics.com/getting-started-with-raspberry-pi-pico-w-using-micropython/" target="_blank">"Getting Started with Raspberry Pi Pico W using MicroPython"</a></html> | |
| |
==== 6. IDE Thonny ==== | |
* **Installer** l'éditeur : <html><a href="https://thonny.org/" target="_blank">Thonny</a></html> | |
{{ :python:micropython:thonny.png?nolink |}} | |
| |
==== 7. Exemples de programmes ==== | |
* <html><a href="https://projects.raspberrypi.org/en/projects/getting-started-with-the-pico" target="_blank">Getting started with Raspberry Pi Pico</a></html> | |
* Blink the onboard LED | |
* Use digital inputs and outputs | |
* Control LED brightness with PWM | |
* Control an LED with an analogue input | |
* <html><a href="https://www.tomshardware.com/how-to/connect-raspberry-pi-pico-w-to-the-internet" target="_blank">How to Connect Raspberry Pi Pico W to the Internet</a></html> | |
* <html><a href="https://www.tomshardware.com/how-to/raspberry-pi-pico-w-node-red" target="_blank">How to Use Raspberry Pi Pico W With Node-RED</a></html> | |
* <html><a href="https://how2electronics.com/raspberry-pi-pico-w-web-server-tutorial-with-micropython/" target="_blank">Raspberry Pi Pico W Web Server Tutorial with MicroPython</a></html> | |
* <html><a href="https://peppe8o.com/mqtt-and-raspberry-pi-pico-w-start-with-mosquitto-micropython/" target="_blank">MQTT and Raspberry PI Pico W: Start with Mosquitto (MicroPython)</a></html> | |
| |
| |