RP2040 MCU board with Round LCD (RP2040-LCD-1.28)

hello world on RP2040

Waveshare has these cute round LCD boards with embedded RP2040, these boards are available with touch and without touch. Along with controller and LCD, board comes with some additional peripherals (No BLE/WiFi support as of now).

  • RP2040 (Dual core ARM Cortex M0+, 264 KB SRAM, 133 Mhz) with 2MB flash (W25Q16JVUXIQ)
  • 1.28Inch 240*240 IPS color display (GC9A01A)
  • Gyroscope, accelerometer (IMU – QMI8658C)
  • Battery charge manager (ETA6096), Battery header(MX1.25)
  • USB-C connector, reset button, boot button and 1.27MM pitch headers

I bought the one without touch, In this post will see how to get some text displayed on the LCD.

Setting up Arduino IDE

First we need to setup the Aruduino IDE, add the link following additional boards section (File -> Preferences -> Additional board manager URLs).

https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

Then search for pico in board manager (Tools -> Board -> Boards manger) and install the Mbed OS RP2040 Boards

Install the board

Once installation done, select the board and COM port (if popup comes after selecting the board asking to install the board, click Yes)

select board and COM port
install the board

Download and extract the demo code, open the project in arduino IDE and replace the contents of RP2040-LCD-1.28.ino with the following code. Once the code is loaded you should see the “Hello World” text on LCD.

#include "LCD_Test.h"

void setup() {
  if(DEV_Module_Init() != 0)
    Serial.println("GPIO Init Fail!");
  else
    Serial.println("GPIO Init successful!");
  LCD_1IN28_Init(HORIZONTAL);
  DEV_SET_PWM(50);
  LCD_1IN28_Clear(WHITE);
  UDOUBLE Imagesize = LCD_1IN28_HEIGHT * LCD_1IN28_WIDTH * 2;
  UWORD *TxtImage;
  if ((TxtImage = (UWORD *)malloc(Imagesize)) == NULL)
  {
      Serial.println("Failed to apply for black memory...");
      exit(0);
  }
  Paint_NewImage((UBYTE *)TxtImage, LCD_1IN28.WIDTH, LCD_1IN28.HEIGHT, 0, WHITE);
  Paint_SetScale(65);
  Paint_Clear(WHITE);
  Paint_SetRotate(ROTATE_0);
  Paint_DrawString_EN(30, 100, "Hello World", &Font24, WHITE, BLACK);
  LCD_1IN28_Display(TxtImage);
}

void loop() {}

More details of this board are available on this wiki

Tags:
One Comment

Add a Comment

Your email address will not be published. Required fields are marked *