ATxmega128A1 Driving TFT Display ST7789 Using Web Image Editor
by sergei_iliev in Circuits > Microcontrollers
26 Views, 0 Favorites, 0 Comments
ATxmega128A1 Driving TFT Display ST7789 Using Web Image Editor
The main goal of the project is to show how to draw text,shapes and images on TFT display ST7789 using Web Serial API and Acorn micro-kernel operating system.
Web OLED browser editor app was develop to run online (no need to install any programm localy on desktop) and communicate pixel changes over web serial api directly to an AVR processor running acorn micro kernel. The processor sends changes over SPI protocol to OLED display and pixel changes are displayed instantly on screen.
No microcontroller internal memory buffering is used , internal SRAM is too small to allow 320x240x2 color per pixel=153 600 bytes, as a result serial to UART stream is directly send to TFT display using the produce consumer pattern.
Web Browser Editor App
Navigate to OLED Editor App and draw text , shapes or upload images of your choosing. Use the context property menu for each shape and eventually drag the shapes control points to change their sizing. Send content to st7789 by pressing the button "Send To Oled".
Description of header buttons
- Escape or Cancel - resets drawing operation
- Text- type the text in your language locale and move to position it any where on canvas - use context properties popup
- Draw Line - draw lines using control points to drag and move the line - use context properties popup
- Draw Rectangle - draw rectangles using control points to move and resize - use context properties popup
- Draw Circle - draw ellipses using control points to move and resize - use context properties popup
- Clear Canvas - reset canvas
- Load Image - load from your PC hard drive and display on canvas an image file. Image will be cropped if it exceeds the display size 320x240
- Load Icon - load from predefined embedded in app icons
- Send To OLED - send to st7789 using web serial API
Schematic and Tasks
ATXMEGA128A1 microprocessor controls 3 input-output channels - UART to PC, SPI to ST7789 and native protocol to GDSC-0801WP display
There are 3 tasks to control each channel
- tft_lcd_task - controls SPI protocol and consumes byte stream from UART task
- usart_D_task - controls UART communication and produces a byte stream to be consumed by #1 task
- lcd_task - controls GDSC-0801WP communication protocol and renders animated text on lcd screen
Project Source
Build Project From Source Code
Firmware project is based on acorn micro kernel operating system driving 3 separate tasks
- Download firmware source code from github repo - xmega128-oled-st7789
- Find and open project file ST7789V.atsln in Microchip AVR Studio
- Build project to generate HEX file
- Flash Hex file using AVR ISP programmer