Pyboard Hookup Guide

Pages
Contributors: LightningHawk
Favorited Favorite 3

Hardware Overview

Pyboard comes fully loaded with hardware features:

  • STM32F405RG microcontroller
  • 168 MHz Cortex M4 CPU with hardware floating point
  • 1024KiB flash ROM and 192KiB RAM
  • Micro USB connector for power and serial communication
  • Micro SD card slot, supporting standard and high capacity SD cards
  • 3-axis accelerometer (MMA7660)
  • Real time clock with optional battery backup
  • 31 GPIO
  • 3x 12-bit analog to digital converters, available on 16 pins, 4 with analog ground shielding
  • 2x 12-bit digital to analog (DAC) converters, available on pins X5 and X6
  • 4 LEDs
  • 1 reset and 1 user switch
  • On-board 3.3V LDO voltage regulator, capable of supplying up to 250mA, input voltage range 3.6V to 16V
  • DFU bootloader in ROM for easy upgrading of firmware

Easily control the following peripherals using the the pyb module's built-in classes for:

  • ADC
  • SPI
  • I2C
  • DAC
  • SD Card storage
  • UART

pyboard pinout

Click the image for a closer look. Image courtesy of micropython.org

LEDs

The pyboard has four LEDs. We are going to use the REPL to interactively determine how these LEDs are numbered and what color they are. The LEDs are also indicators for the current state of the board. Here are some examples of what you might see:

  • The red and green LEDs flash alternatively: main.py has an error use the REPL to debug
  • All four LEDs cycle on and off: You must perform a hard reset of the board.
  • Only the Red LED is on: You may just tried to save main.py to the drive. Do not eject the flash drive before the red LED turns off!

pyBoard leds

Switches

There are two switches, one labeled "USR" for user and the other "RST" for reset. Micropython handles switch input very easily on this board and we will use the USR switch to prove it. The Switch class has three methods that allow you obtain the switch state or register when there has been a change in the switch state.

pyboard buttons

MicroSD Socket

There is a drive on the pyboard called /flash. When an microSD card is inserted this drive becomes available as /sd.

pyboard SD card

Accelerometer

The pyboard has an accelerometer-MMA766FC that can be used to detect the angle and motion of the board. The Accel class of the pyb module has five methods which allow you get the x, y, z axis info, access the tilt register, and a 3-tuple of x,y,z values.

pyboard accelerometer