siliconchip.com.au Australia’s electronics magazine May 2019 93
touch interface, which in turn would require a calibration
procedure, to account for differences in displays.
We’ve also provided a sketch called “8bit320x480
touch_calibration”, which shows the basics of how to do
this conversion and gives you a starting point for doing it.
microSD card slot
Even though the SD card socket on this display appears
to be wired directly to the Arduino’s I/O pins (and thus,
would be driving a 3.3V device from 5V outputs), we tried
the “listfiles” sketch as above, but this time changing the
initialisation line to read:
if (!SD.begin(10)) {
to suit the Uno’s pin mapping. Surprisingly, it worked. We
suspect that we have a tough microSD card and would be
surprised if it lasts long being directly driven from 5V pins.
The SOIC-8 footprint on the board also appears to be
directly connected to 5V I/O pins as well, with its pin 1
(which is CS-bar on many flash ICs) connected to pin A5
on the Uno.
Verdict
As noted above, this unit looks very tidy when paired
with an Uno board, but since it leaves virtually no I/O pins
free, it’s hard to think of a useful application for it.
And as also mentioned above, if you use the obvious so-
lution of upgrading to an Arduino Mega board, you lose
most of its speed advantage over a serial display, since you
can no longer do direct port writes.
That the shield appears to connect to the microSD card
slot and flash chip pins at 5V is concerning, and we would
not recommend using those interfaces on these modules.
Building the Arduino breakout board
We are very happy with the 3.5 inch SPI display panels
(the first ones described above). We felt that a proper break-
out board was necessary to make it easier to connect them
to an Arduino, avoiding the need for messy jumper wires.
The circuit for this board is shown in Fig.5.
There isn’t much to it. It mainly just routes the signals
between the Arduino and display, while converting the
Arduino’s 5V signal swing to 3.3V to suit the LCD screen,
Screen2: both the Adafruit_GFX and MCUFRIEND_kbv
libraries can be installed through the Arduino IDE’s Library
Manager. Use the search terms above to help find them.
Screen1: this Arduino code was generated by software
running on the Arduino itself, after we added carefully
crafted debugging code to the library which was able to
initialise the LCD controller successfully.
touch panel and SD card interfaces.
There are seven 470/1k resistive dividers to achieve
this. These are for the MOSI and SCK connections on the
shared SPI bus, three CS lines (one each for the LCD, touch
controller and SD card) and two extra control lines on the
LCD controller; DC (data/command) and RESET.
Note that we haven’t put a divider on MISO since it is a
3.3V signal coming out of the touch controller (or SD card),
which a 5V Arduino boards can accept as-is. Per the data
sheet, the minimum voltage level that an ATmega328 mi-
cro running from 5V is guaranteed to read as high is 3.0V.
The board also supplies logic power (3.3V) to the dis-
play, which is taken from the Arduino’s 3.3V supply, and
power for the backlight LED(s), which comes directly from
the Arduino’s 5V supply.
The touch controller’s T_IRQ line is not connected, as
we felt that this would eat too much into the already dwin-
dling number of available I/O pins on the Arduino.
We have provided connection pads to all unused pins
on the Arduino, so they can be connected by jumper le-
add if needed. In most applications, we find that it is not
necessary.
The SPI communication lines for the display are routed
to the 6-pin ICSP header on the Arduino board. Since the
introduction of the so-called ‘R3’ Arduino board layout,
this is the location which is guaranteed to be connected
to the Arduino’s hardware SPI pins, regardless of which
digital I/O pins they map to (that differs between various
Arduino boards).
For this reason, the breakout board can be used with just
about any 5V Arduino R3 board, and we’ve tested it with
a few including the Leonardo, Mega and Uno.
If you’re not sure that your board is R3 compatible, check
that it has the ICSP header approximately halfway between
the TX/RX pins and the analog pins. It should also have
one 10-way, two 8-way and one 6-way female pin headers.
Earlier versions typically lack the 10-way header.
As mentioned earlier, JP1 can be used to connect the
MISO line to the LCD controller, but generally, you will
want to leave this open, or else the touch controller inter-
face may not work.
The PCB also has mounting holes for both the 2.8 inch and
3.5 inch display panels, as well as the Arduino board itself.
The remaining spare room is occupied with a small pro-
totyping area with 5V, 3.3V and GND connections nearby,
and all unused Arduino pins have adjacent breakout pads.
There’s also a slot which allows the end of the PCB to