Difference between revisions of "1.28-round-lcd-breakout"

From SB-Components Wiki

 
(9 intermediate revisions by 2 users not shown)
Line 20: Line 20:
 
</div>
 
</div>
 
   <div class="large-4 column">
 
   <div class="large-4 column">
[[File:round_LCD_breakout.png|thumb|left|alt=Pico 1.28 Round LCD Breakout| Buy it From : ''[https://shop.sb-components.co.uk/products/1-28-round-lcd-breakout Click Here]'']]
+
[[File:Round_lcd_breakout.png|thumb|left|alt=Pico 1.28 Round LCD Breakout| Buy it From : ''[https://shop.sb-components.co.uk/products/1-28-round-lcd-breakout Click Here]'']]
 
   </div>
 
   </div>
 
</div>
 
</div>
Line 30: Line 30:
 
<tr> <td> GND </td> <td> Ground Supply </td></tr>
 
<tr> <td> GND </td> <td> Ground Supply </td></tr>
 
<tr> <td> VCC </td> <td> Power Supply 3.3V - 5V DC </td></tr>
 
<tr> <td> VCC </td> <td> Power Supply 3.3V - 5V DC </td></tr>
<tr> <td> DIN </td> <td> Serial Data Input / Outout </td></tr>
+
<tr> <td> DIN </td> <td> Serial Data Input / Output </td></tr>
 
<tr> <td> CLK </td> <td> Serial Clock </td></tr>
 
<tr> <td> CLK </td> <td> Serial Clock </td></tr>
 
<tr> <td> CS </td> <td> Chip select input pin ("Low" enable) </td></tr>
 
<tr> <td> CS </td> <td> Chip select input pin ("Low" enable) </td></tr>
Line 40: Line 40:
  
 
== Installation ==
 
== Installation ==
==== MicroPython ====
+
 
For running this HAT, you require these components :
+
==== Arduino ====
** Raspberry Pi Pico X 1
+
* [https://github.com/moononournation/Arduino_GFX '''Arduino Library for 1.28" Round LCD Breakout''']
** Pico 1.28" Round LCD HAT X 1
+
 
** USB Cable X 1
+
If you are using Arduino Ide, you can use the above library.
 +
 
 +
==== PICO RP2040 (MicroPython) ====
 +
Below components are required to run Pico RP2040 compatible boards :
 +
** Raspberry Pi Pico x 1
 +
** Pico 1.28" Round LCD Breakout x 1
 +
** USB Cable x 1
  
 
* Copy or clone code from Github.
 
* Copy or clone code from Github.
 
https://github.com/sbcshop/1.28-Round-LCD-Breakout
 
https://github.com/sbcshop/1.28-Round-LCD-Breakout
  
* Stack Pico 1.28 Round LCD HAT with Raspberry Pi Pico, Make sure the USB symbol on LCD HAT should be on the same side as PICO USB.
+
* Connect LCD breakout with Raspberry Pi Pico as shown in the below pinout.
 +
 
 +
<table class="wikitable">
 +
<tr> <th>1.28" Round LCD Breakout </th> <th>PICO Pins </th></tr>
 +
<tr> <td> VCC </td> <td> 3.3V / 5V </td></tr>
 +
<tr> <td> GND </td> <td> GND </td></tr>
 +
<tr> <td> LCD DIN </td> <td> GP11 </td></tr>
 +
<tr> <td> LCD CLK </td> <td> GP10 </td></tr>
 +
<tr> <td> LCD DC </td> <td> GP8 </td></tr>
 +
<tr> <td>LCD CS</td> <td> GP9 </td></tr>
 +
<tr> <td> LCD RST </td> <td> GP12 </td></tr>
 +
<tr> <td> LCD BL </td> <td> GP13 </td></tr>
 +
</table>
  
 
* Press and hold  '''BOOTSEL''' pin of Raspberry Pi Pico and connect the USB cable, it will create a drive as RPI-RP2.
 
* Press and hold  '''BOOTSEL''' pin of Raspberry Pi Pico and connect the USB cable, it will create a drive as RPI-RP2.
  
* Now drag and drog/copy '''firmware.uf2''' file from firmware folder to RPI-RP2 Drive. It will reboot your raspberry pi pico.
+
* Now drag and drop or copy and paste '''firmware.uf2''' file from firmware folder to RPI-RP2 Drive. It will reboot your raspberry pi pico.
  
* Open Thonny IDE and Choose interpreter as MicroPython (Raspberry Pi pico).
+
* Open Thonny IDE and Choose interpreter as MicroPython (Raspberry Pi Pico).
 
[[File:Thonny-interpreter.PNG|600px]]
 
[[File:Thonny-interpreter.PNG|600px]]
  
Line 145: Line 163:
 
<b> Github </b>
 
<b> Github </b>
 
* [https://github.com/sbcshop/1.28-Round-LCD-Breakout Source Code]
 
* [https://github.com/sbcshop/1.28-Round-LCD-Breakout Source Code]
 +
 +
<b> Datasheet </b>
 +
* [https://github.com/sbcshop/Round-LCD-HAT/blob/main/lib/GC9A01A%20Datasheet.pdf GC9A01 Datasheet]

Latest revision as of 05:36, 14 July 2021

1.28" Round LCD Breakout

The 1.28" Round LCD Breakout is a 1.28-inch display breakout with 240 x 240 resolution, 65K RGB colours, and a clear and colourful displaying effect meant to help gadgets increase their interaction via SPI connection by providing a GPIO header for easy interface. The GC9A01 display driver and SPI interface are integrated into the 1.28" Round LCD Breakout, decreasing the number of IO pins required.

Features

  • 4-wire SPI Communication
  • GPIO header for easy interfacing
  • Cross-Platform compatibility
  • 1.28” Round LCD

Specifications

  • Operating Voltage - 3.3 V
  • Pixel Size - 0.135 × 0.135mm
  • Board Dimension - 36mm x 44mm
  • Pixels - 240×240 resolution
  • Display Colour - 65K RGB
  • Driver - GC9A01
Pico 1.28 Round LCD Breakout
Buy it From : Click Here

Pinout

Round LCD Breakout Description
GND Ground Supply
VCC Power Supply 3.3V - 5V DC
DIN Serial Data Input / Output
CLK Serial Clock
CS Chip select input pin ("Low" enable)
DC Display data / Command selection pin
DC='1': Display data.
DC='0': Command data
RST Reset Pin. Initialize the chip with a low input
BL Blacklight Control. High: Blacklight on Low: Blacklight off.

Installation

Arduino

If you are using Arduino Ide, you can use the above library.

PICO RP2040 (MicroPython)

  • Below components are required to run Pico RP2040 compatible boards :
    • Raspberry Pi Pico x 1
    • Pico 1.28" Round LCD Breakout x 1
    • USB Cable x 1
  • Copy or clone code from Github.

https://github.com/sbcshop/1.28-Round-LCD-Breakout

  • Connect LCD breakout with Raspberry Pi Pico as shown in the below pinout.
1.28" Round LCD Breakout PICO Pins
VCC 3.3V / 5V
GND GND
LCD DIN GP11
LCD CLK GP10
LCD DC GP8
LCD CS GP9
LCD RST GP12
LCD BL GP13
  • Press and hold BOOTSEL pin of Raspberry Pi Pico and connect the USB cable, it will create a drive as RPI-RP2.
  • Now drag and drop or copy and paste firmware.uf2 file from firmware folder to RPI-RP2 Drive. It will reboot your raspberry pi pico.
  • Open Thonny IDE and Choose interpreter as MicroPython (Raspberry Pi Pico).

Thonny-interpreter.PNG

  • Now you can run example codes from the Pico_Example_mpy folder in Thonny Ide. For example, Open the hello.py file in thonny and click on the green play button to run this example.

Pico Round lcd HAT thonny.PNG

It will print "Hello" on Round LCD. You can use the joystick to change the LCD color.

Working Example

  • This module was tested on Raspberry Pi Pico. You need to provide a SPI object and the pin to use for the DC pin of the screen.
import machine
import gc9a01
spi = SPI(1, baudrate=40000000, sck=Pin(10), mosi=Pin(11))
tft = gc9a01.GC9A01(spi, 240, 240, reset=Pin(12, Pin.OUT), cs=Pin(9, Pin.OUT), dc=Pin(8, Pin.OUT), backlight=Pin(13, Pin.OUT), rotation=0)
tft.init()


Functions and Arguments

  • gc9a01.GC9A01(spi, width, height, reset, dc, cs, backlight, rotation, buffer_size)

required arguments:

`spi` spi device
  `width` display width
  `height` display height

optional args:

`reset` reset pin
  `dc` dc pin
  `cs` cs pin
  `backlight` backlight pin
  `rotation` Orientation of display.
  `buffer_size` 0= buffer dynamically allocated and freed as needed.

  Rotation | Orientation
  -------- | --------------------
     0     | 0 degrees
     1     | 90 degrees
     2     | 180 degrees
     3     | 270 degrees
     4     | 0 degrees mirrored
     5     | 90 degrees mirrored
     6     | 180 degrees mirrored
     7     | 270 degrees mirrored

If buffer_size is specified it must be large enough to contain the largest bitmap, font character, and/or JPG used (Rows * Columns *2 bytes). Specifying a buffer_size reserves memory for use by the driver otherwise, memory required is allocated and free dynamically as it is needed. Dynamic allocation can cause heap fragmentation so garbage collection (GC) should be enabled.

This driver supports only 16bit colors in RGB565 notation.

  • GC9A01.on()

Turn on the backlight pin if one was defined during init.

  • GC9A01.off()

Turn off the backlight pin if one was defined during init.

  • GC9A01.pixel(x, y, color)

Set the specified pixel to the given color.

  • GC9A01.line(x0, y0, x1, y1, color)

Draws a single line with the provided color from (x0, y0) to (x1, y1).

  • GC9A01.hline(x, y, length, color)

Draws a single horizontal line with the provided color and length in pixels. Along with vline, this is a fast version with reduced number of SPI calls.

  • GC9A01.vline(x, y, length, color)

Draws a single horizontal line with the provided color and length in pixels.

  • GC9A01.rect(x, y, width, height, color)

Draws a rectangle from (x, y) with corresponding dimensions

  • GC9A01.fill_rect(x, y, width, height, color)

Fill a rectangle starting from (x, y) coordinates

Source code credit: https://github.com/russhughes/gc9a01_mpy

Resources

Github

Datasheet