Pimoroni Tufty2040

The Pimoroni Tufty2040 is a tiny development board based on the Raspberry Pi RP2040 microcontroller.

Interfaces

InterfaceHardware SupportedTinyGo Support
GPIOYESYES
UARTYESYES
SPIYESYES
I2CYESYES
ADCYESYES
PWMYESYES
USBDeviceYESYES

Pins

PinHardware pinAlternative namesPWM
LEDGPIO25USER_LEDPWM4 (channel B)
BUTTON_AGPIO7PWM3 (channel B)
BUTTON_BGPIO8PWM4 (channel A)
BUTTON_CGPIO9PWM4 (channel B)
BUTTON_UPGPIO22PWM3 (channel A)
BUTTON_DOWNGPIO6PWM3 (channel A)
BUTTON_USERGPIO23PWM3 (channel B)
LCD_BACKLIGHTGPIO2PWM1 (channel A)
LCD_CSGPIO10PWM5 (channel A)
LCD_DCGPIO11PWM5 (channel B)
LCD_WRGPIO12PWM6 (channel A)
LCD_RDGPIO13PWM6 (channel B)
LCD_DB0GPIO14PWM7 (channel A)
LCD_DB1GPIO15PWM7 (channel B)
LCD_DB2GPIO16PWM0 (channel A)
LCD_DB3GPIO17PWM0 (channel B)
LCD_DB4GPIO18PWM1 (channel A)
LCD_DB5GPIO19PWM1 (channel B)
LCD_DB6GPIO20PWM2 (channel A)
LCD_DB7GPIO21PWM2 (channel B)
VBUS_DETECTGPIO24PWM4 (channel A)
BATTERYGPIO29ADC3PWM6 (channel B)
LIGHT_SENSEGPIO26ADC0PWM5 (channel A)
SENSOR_POWERGPIO27ADC1PWM5 (channel B)
I2C0_SDA_PINGPIO4PWM2 (channel A)
I2C0_SCL_PINGPIO5PWM2 (channel B)
UART0_TX_PINGPIO0UART_TX_PINPWM0 (channel A)
UART0_RX_PINGPIO1UART_RX_PINPWM0 (channel B)
ADC2GPIO28PWM6 (channel A)

Machine Package Docs

Documentation for the machine package for the Pimoroni Tufty2040

Flashing

UF2

The Tufty2040 comes with the UF2 bootloader already installed.

CLI Flashing

  • Flash your TinyGo program to the board using this command:

    tinygo flash -target=tufty2040 [PATH TO YOUR PROGRAM]
    
  • The Tufty2040 board should restart and then begin running your program.

Troubleshooting

Any troubleshooting tips go here.

Notes

You can use the USB port to the Tufty2040 as a serial port.

TinyGo has support for the RP2040’s on-board Programmable Input/Output (PIO) block.

For more informantion, see https://.com/tinygo-org/pio

For support for the Tufty’s display please see https://.com/tinygo-org/pio/tree/main/rp2-pio/examples/tufty