Atmel 328pb-xmini and 2.2" TFT LCD display

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all, this is my first forum post and need help on a project I'm currently doing. 

 

The project is an IC Chip tester. For a prototype, I'm using the Atmega 328pb Xplained Mini, a Zif socket, a 3x4 keypad, and a 2.2" TFT LCD display w/SD Card slot.

The problem is I'm not sure how to properly wire the TFT display to the Xplained mini. Also, I am using microchip studio for the code and noticed many libraries for the TFT display for Arduino but not sure if they'll work with the 328pb xplained mini.

 

TFT : Hailege 2.2 inch ILI9225 SPI TFT LCD Display 176X220

https://www.amazon.com/Hailege-I...

 

Anything to get time started on the right track will be very helpful. Thank you 

Attachment(s): 

This topic has a solution.
Last Edited: Wed. Oct 20, 2021 - 05:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The display is SPI driven so you will need to find the SPI pins including the CS pin on the Mini board to wire is up.

 

edit if you don't have the board's diagram you can get it here https://www.farnell.com/datashee...

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Sun. Oct 17, 2021 - 05:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

tomahawkz wrote:

The problem is I'm not sure how to properly wire the TFT display to the Xplained mini. Also, I am using microchip studio for the code and noticed many libraries for the TFT display for Arduino but not sure if they'll work with the 328pb xplained mini.

 

1.  there are third party cores that will work with the Arduino IDE.   This will let you run Arduino code on the 328PB.

2.  the display is SPI (but write-only)

3.  the display will plug directly into the Arduino Analog header and Power header.   (CS into Analog #5)

4.  you can either bit-bang SPI on the Analog pins PC0-PC5 (slow) or hand-wire to the hardware SPI pins PB3, PB5 (faster)

 

The display is relatively small 176x220.  So speed is not very important

Arduino code is certainly the quickest and easiest way to get your prototype running.

 

Note that Arduino libraries expect either hardware SPI on PB3, PB5 or bit-bang on any GPIO pins.

There are better alternatives for the 328PB e.g. USART_MSPI but you would have to code this yourself.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thank you this was a huge help, just needed a start to the process to get me going. I appreciate it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

That diagram does sure help a lot. Thank you.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

VCC - If your Vcc is +5V then use that voltage as the input on pin 1 (marked VCC).  If your CPU voltage is 3.3v, then jump with tiny thin piece of wire the two pads marked J1 on the back of the TFT red display board.  The TFT uses 3.3V and U1 is a Low-Dropout regulator to bring the +5 Vcc down to 3.3v.  J1 bypasses U1 if the input voltage (on yellow header pin1) is already 3.3v.
The GND pins (2,3) can be tied together and the NC pins (4,5) ignored.
LED will be a PWM input that will determine how bright the white backlight will be.
CLK connects to the AVR's SPI clock.
SDI (serial data input) connects to AVR's SPI MOSI (master out, slave in).
RS (register select) determines if the SPI data is to be used as pixel information or TFT commands.  An I/O line will control this.
RST is reset.  Can be connected to AVR reset because it is active low.  If the TFT doesn't initialize without a reset pin press, then try adding 10 K resistor to Vcc and a 0.1uF cap to ground to lengthen the power-on reset pulse to the TFT.
CS is chip select.  Pull this low with an I/O pin before writing either pixel data or commands to the TFT.

U2 is a level-shifter to convert the 5V control signals from the CPU to 3.3V for the TFT.
U3 is pad layout for a Serial RAM chip with SPI interface.