Testing the ST7789 LCD using the Atmega 328P Nano 3.0 and Arduino IDE

For just testing the ST7789 SPI LCD, only the following hardware is required:

The resistor values for the level shifter are not critical as long as long as they are approximately in the ratio of 2:1. So 1K with 470 to 510 ohms should be fine. But they shouldn't be much smaller (due to drive considerations) and if too large, there may be problems with the frequency response. Under some undetermined conditions, a 100 pF capacitor between D11 and GND is needed to prevent erratic behavior. There is probably a race condition in the ST7789 library SPI timing.

If you have an mLMA1 PCB, it can be used to test the LCD before fully populating it. The level shifter resistors are all in one block under the LCD. R7-R10 are ~500 ohm; R11-R14 are ~1K ohm. (The specific values included in the kit may vary slightly but should be in the approximate 2:1 ratio.) Or the circuit, above, can be built on a prototyping board or solderless breadboard. Double check the wiring and make sure the connections are secure.

Installing the Arduino IDE

The following are the steps to do a clean installation of the Arduino IDE and device drivers. If there already is an Arduino IDE installed and it is totally screwed up, it should be replaced or updated. This can be done without losing any of your Sketches. If it works, don't fix it unless it becomes clearly broken with the Nano. ;-) But if it's very old, the updating is recommenedd so that most of the old bugs have been removed and only new bugs remain. ;-)

Go to Arduino Software and install the current version of the Arduino IDE (V1.8.13 as of Jan 2021). (I'm not sure if the board needs to be plugged in to a USB port during this process, but mine was. During the install process, it will ask to install the drivers. Reply "Yes" to all its requests. When the Arduino IDE is started for the first time, go to "Tools", "Board", and select "Arduino Nano". If the Nano is plugged in, an new COM port should appear (in addition to any that were there originally) under "Tools", "Port".

If a new COM port DOESN'T appear when the Nano is plugged in, it probably means your Nano is a clone (most are) and the next step will be required.

Installing the CH340 Device Driver

There are at least two flavors of the Atmega 328P Nano 3.0 board, which differ primarily in their USB interface. The original genuine Nano used FDDI. But most of the inexpensive Nanos on eBay and elsewhere are clones that due to copyright restrictions, changed the interface. They use what's called a CH340 chip. It is very likely the Nanos you have are of this type. That's fine, as their capabilities are essentially identical to the high priced variety. But a special device driver for the CH340 chip is required which may be installed from Sparkfun How to Install CH340 Drivers. That Web page also shows how to determine which type of interface your Nano has. Follow the instructions for your OS. The original driver should be uninstalled first if that option is shown, then the CH340 driver should be installed. It may need to be done twice if the first time doesn't confirm success.

More info on software, drivers, and more at Getting Started with Arduino and Genuino on Windows.

Required C Libraries for Testing the LCD

Several Libraries are needed by the LCD test sketch. Use these links to download the .zip files into any convenient directory. Then the libraries can be installed from within the Arduino IDE. Go to "Sketch", "Include Library", "Add Zip Library".

The SPI library is also needed, but that can be loaded from within the Arduino IDE. Go to "Sketch", "Include Library", "SPI".

Configure the Arduino IDE for the Atmega 328P Nano 3.0

Go to: "Tools":