Experimental project to drive a TFT LCD with an AVR MCU and avr-libc

cats Initial support for RA8875 (#11) 1 year ago
emojis Initial support for RA8875 (#11) 1 year ago
nbproject Initial support for RA8875 (#11) 1 year ago
scripts Initial support for RA8875 (#11) 1 year ago
.gitignore Project setup 2 years ago
CODE_OF_CONDUCT.md Initial commit 2 years ago
LICENSE Initial commit 2 years ago
Makefile Initial support for RA8875 (#11) 1 year ago
README.md Fix image URLs 1 hour ago
avrtft.c Fix comments 1 year ago
bitmaps.c Initial support for RA8875 (#11) 1 year ago
bitmaps.h Initial support for RA8875 (#11) 1 year ago
bmp.c Initial support for RA8875 (#11) 1 year ago
bmp.h Initial support for RA8875 (#11) 1 year ago
cmd.c Initial support for RA8875 (#11) 1 year ago
cmd.h Initial support for RA8875 (#11) 1 year ago
colorspace.c Small improvements 1 year ago
colorspace.h Initial support for RA8875 (#11) 1 year ago
display.c Continue impl. of RA8875 + refactoring (#12) 1 year ago
display.h Continue impl. of RA8875 + refactoring (#12) 1 year ago
emojis.c Initial support for RA8875 (#11) 1 year ago
emojis.h Initial support for RA8875 (#11) 1 year ago
font.c Initial commit 2 years ago
font.h Add emojis 🙂 (#2) 2 years ago
hack.c Initial support for RA8875 (#11) 1 year ago
hack.h Initial support for RA8875 (#11) 1 year ago
i2c.c Initial implementation of touch screen (#7) 2 years ago
i2c.h Initial implementation of touch screen (#7) 2 years ago
paint.c Continue impl. of RA8875 + refactoring (#12) 1 year ago
paint.h Initial support for RA8875 (#11) 1 year ago
pins.h Initial support for RA8875 (#11) 1 year ago
ra8875.c Continue impl. of RA8875 + refactoring (#12) 1 year ago
ra8875.h Continue impl. of RA8875 + refactoring (#12) 1 year ago
sdcard.c Narrow down SD card init failure/simplify solution 1 year ago
sdcard.h Small improvement of SD card init, correct CRC values (#14) 1 year ago
spi.c Initial support for RA8875 (#11) 1 year ago
spi.h Initial support for RA8875 (#11) 1 year ago
tft.c Give the display some more time to power up 1 year ago
tft.h Continue impl. of RA8875 + refactoring (#12) 1 year ago
touch.c Initial support for RA8875 (#11) 1 year ago
touch.h Initial support for RA8875 (#11) 1 year ago
types.h Initial support for RA8875 (#11) 1 year ago
usart.c Initial support for RA8875 (#11) 1 year ago
usart.h Initial support for RA8875 (#11) 1 year ago
utils.h Initial commit 2 years ago
README.md

AVRTFT

Experimental project to drive a TFT LCD with an AVR MCU (ATmega328P) and avr-libc.

Currently supported displays/drivers:

Additionally, there is some support for larger (up to 800x480) TTL displays, for example the
Adadruit 7.0" 40-pin TFT Display - 800x480 with Touchscreen,
with the RA8875 controller like the
RA8875 Driver Board for 40-pin TFT Touch Displays
including touch support.

Currently implemented features:

  • Mostly complete UTF-8 set (code points U+0000 to U+00FF) of Hack font
    with antialiasing (4-Bit greyscale)
  • Some emojis (16-Bit RGB)
  • Write text in Hack including emojis 🙂
  • Draw bitmaps
  • Write text and bitmaps via USART
  • Upload BMP images via USART (16-Bit 5/6/5 RGB)
  • Basic SD card support: read and write blocks of 512 bytes
  • Read BMP images from SD card (raw)
  • Process touch events (FT6206, RA8875)
  • Very basic paint application
  • Logging via USART

Ideas:

  • Make features usable from a touch screen menu

IMG_20231125_011054

Write something via USART

Connect to the controller with for example GTKTerm (38400 Baud).
Write some text and a bitmap, and upload a BMP image:

c 0xffff // clear display
d // display the demo
t 0 0 Just some text // write text in Hack to x = 0, y = 0
b 0 0 1 // write bitmap with index 1 (line icon) to x = 0, y = 0
p 0 0 // prepare to "stream" a 16-Bit (5/6/5) RGB BMP image x = 0, y = 0
cat Bali160x128.bmp > /dev/ttyUSB0 // upload a BMP image
s 0 // read BMP image from SD card starting at address 0 (x = 0, y = 0)
a // start paint application

Enter emojis

Emojis are entered with a tabulation char + their "code", i.e. Smile!<TAB>s for a smiling emoji.

IMG_20231129_004922

Convert and write images to SD card

With scripts/bmp.sh, images can be bulk-converted and written raw to SD card, so they can be viewed and
advanced to the next image with a touch.

Paint application

A super basic paint application created to learn about processing touch events
and draw something on the screen.

The FT6206 based touch screen of the
Adafruit 2.8" Color TFT LCD with Cap Touch 320x240 ILI9341
works quite well but at least for me the coordinates of touches close to the
long edges of the screen are a bit off (too close to the edge) and there seems
to be no calibration capability - the data sheet mentions "auto calibration".

But still it is fun and it should be possible to create an application
supporting touch with reliable usability.

IMG_20240103_134738

Larger (up to 800x480) TTL displays

If at all possible, it probably is quite a challenge to drive such a 40-pin display with a 28-pin
MCU like the ATmega238P, but it is easy with the RA8875 driver, offering support for a touch screen
as well. Here it is combined with the SparkFun Level Shifting microSD Breakout
to read images from an SD card, advancing to the next image by touching the screen.

IMG_20240704_214710