2.4 Transflective TouchScreen 240x320 Display ST7789V

Hi,

I’m going to try this display I found- Startek KD024QVRMA038 that seems to provide some pretty good options.

Before I get to deep into it wanted to ask for some feedback on the interface choices. The datasheet appears to show this capable of a 4-pin Serial 8-bit connection, among others. Am I correct to assume that the current ST7789 Library should work with this fairly easy?

Thanks!

KD024QVRMA038.pdf (1.78 MB)

Your module has access to the IM# pins. So you can select any interface that you want.

The main considerations are how to connect to a 0.50mm pitch ribbon.
And how many 3.3V level shifter channels are needed for a 5V Arduino.

Serial uses less wires. You need 3 bytes per pixel. (I think) You can use 2 bytes per pixel.
8080-16 or 8080-8 parallel will be faster. And can use 2 bytes per pixel.

The ST7789V has many different interface options. And several ways to render pixels e.g. 4-4-4, 5-6-5, 6-6-6.
4-wire SPI on an ARM chip can use DMA. SAM3X or STM32 very well. SAMD not so easy.

If you are competent with the hardware, I am sure that we can provide suitable software.
Seriously, I would use a 3.3V Arduino e.g. Due, Zero, Teensy3.x, STM32, ...

David.

Thanks Dave!

I'd say I'm 'okay' with the hardware... still learning. Very much appreciate confirming what I thought I was reading in the data sheet. Still considering whether to use a 3.3 mcu or the 5v. My project reads 4 sensors that provide a combo of analog and digital 5v signals. So either I convert the sensor signals to 3.3 or the display signals to 5v.

Go on. When do you ever get 5V sensors?

david_prentice:
Go on. When do you ever get 5V sensors?

The project interfaces with automotive pressure and temp sensors that have a calibrated v/t output chart based on 5v. The whole circuitry could be flipped to run on 3.3v with level converters for the sensors. I have a working project now based on the 5v and only want to change the display to a transflective with touch instead of the TFT with physical buttons.

This is an effort upgrade a current working project
FROM:
Atmega328p and ST7735 with 2 physical buttons
TO:
Atmega 1284P and ST7789v with touchscreen input.

The display for is the KD024QVRMA041 and will be using a Atmega1284P.

Seeking to drive the display with the least amount of wires while taking advantage of currently available display drivers… so I’m guessing a 4-wire Serial interface is good and am considering the MCUFRIEND_kbv ST7789v Driver. GitHub - prenticedavid/MCUFRIEND_kbv: MCUFRIEND_kbv Library for Uno 2.4, 2.8, 3.5, 3.6, 3.95 inch mcufriend Shields

Let me admit now that when it comes to just the NAMES for SPI connections my head starts swimming. There’s just so many alternate abbreviations for the same thing. It gets confusing.
So, for the hardware wiring for a 4-wire SPI, it would be great if someone could verify which wires go where??? lol

Is this the correct translation using the MCUFriend_kbv.h:

-CS (SS)
-RS (SCK)
-WR (MOSI)
-RD (MISO)
-RST (Reset)

The schematic attachment is an overall layout that includes shows both the I2C interface for the BMP280 Temp/Pres Sensor and the DS3231 RTC, and the 4-wire SPI for the Display. Please don’t hesitate to offer suggestions about this setup.

Thanks,

KD024QVRMA041-C012A SPEC V1.2 -reduced.pdf (1.47 MB)

The PDF shows a 45-way ribbon. It has access to IM0, IM1, IM2. So you can choose whichever interface you like.

Personally, I would choose 4-wire SPI. If you choose 8080-8 it will work out of the box with the MCUFRIEND_kbv library.

Quite honestly. The ribbon is very fine pitch. The logic signals must be 3.3V or less.

When I see someone mention ATmega1284P I automatically assume they will be obsessed with 5V operation.

These panels are designed for 1.8V - 3.3V operation. An ideal candidate for ESP8266, ESP32, ARM, ...
All your components work at 3V. You do not need level shifters.

David.

david_prentice:
The PDF shows a 45-way ribbon. It has access to IM0, IM1, IM2. So you can choose whichever interface you like.

Personally, I would choose 4-wire SPI. If you choose 8080-8 it will work out of the box with the MCUFRIEND_kbv library.

Quite honestly. The ribbon is very fine pitch. The logic signals must be 3.3V or less.

When I see someone mention ATmega1284P I automatically assume they will be obsessed with 5V operation.

These panels are designed for 1.8V - 3.3V operation. An ideal candidate for ESP8266, ESP32, ARM, ...
All your components work at 3V. You do not need level shifters.

David.

I appreciate your suggestions regarding the Voltage levels, etc. However, I really do need help properly wiring the display to the MCU using a 4-wire SPI.

It's not clear which of the SPI display pins are connected to the MCU (via the logic-level).

Can anyone provide clarity on that?

thanks!

The Panel PDF suggests that IM3 is always 0. So your schematic selects IM = 0110 and not 1110.
This means that SDA is bidirectional. SDO pin is unused.

It is VERY painful using bidirectional SDA with an AVR. Much easier with regular MOSI, MISO.

On the other hand, most apps only need to read the ID or an occasional register. Many apps never read GRAM. Very few registers can be read via the bidirectional pin.

What does your ST7735 app do? Most ST7735 modules use a bidirectional SDA pin.

Can you mount the ribbon ok?

Why do you want a 44-pin mega1284 ?
You only seem to use SPI, I2C, INT0.
Your I2C has omitted the pullups.

Xmega, ARM or ESP would be faster. And run at a proper 3.3V.

David.

david_prentice:
The Panel PDF suggests that IM3 is always 0. So your schematic selects IM = 0110 and not 1110.
This means that SDA is bidirectional. SDO pin is unused.

It is VERY painful using bidirectional SDA with an AVR. Much easier with regular MOSI, MISO.

On the other hand, most apps only need to read the ID or an occasional register. Many apps never read GRAM. Very few registers can be read via the bidirectional pin.

What does your ST7735 app do? Most ST7735 modules use a bidirectional SDA pin.

Can you mount the ribbon ok?

Why do you want a 44-pin mega1284 ?
You only seem to use SPI, I2C, INT0.
Your I2C has omitted the pullups.

Xmega, ARM or ESP would be faster. And run at a proper 3.3V.

David.

I apologize but the first part of your response I just don't understand.

Doing fine mounting the ribbon.

The schematic is a functional representation and obviously doesn't include all the details.

Focus of the my question is to seek assistance in identifying the correct wiring for the SPI from the display to the 1284p.

I understand you're a fan of the other MCUs, however, unless someone else is willing to fully create both the schematics and software conversion from my project to any of those MCUs, I'm not in a position to do that.

Trying to be clear on what I want to accomplish. It is difficult understanding how your comments translate to specific wiring would be greatly appreciated.

Thanks,

Regarding IMn pins. Look at table 6.2 in the ST7789 datasheet and accompanying timing diagrams.

In simple terms. IM=0110 means that SDO is unused.

Are you going to create a custom pcb layout from scratch?
And expect it to work first time?

If so, I suggest that you connect SDO to MISO with a solder-bridge. Then you can open or close it easily.

I am not a fan of other MCUs. Just 3.3V

You can run your 1284 at 3V. At least you have understood the necessity of level shifters from 3V to 5V.

Incidentally, many Arduino libraries will work on different targets. Or the mods are trivial.
If you use GFX style graphics the high level code will run on Adafruit, Bodmer, ...
with nothing more than changing include and constructor.

If you don't intend to read registers or GRAM there is no need for MISO (or bidirectional hardware)

David.

david_prentice:
Regarding IMn pins. Look at table 6.2 in the ST7789 datasheet and accompanying timing diagrams.

In simple terms. IM=0110 means that SDO is unused.

Are you going to create a custom pcb layout from scratch?
And expect it to work first time?

If so, I suggest that you connect SDO to MISO with a solder-bridge. Then you can open or close it easily.

I am not a fan of other MCUs. Just 3.3V

You can run your 1284 at 3V. At least you have understood the necessity of level shifters from 3V to 5V.

Incidentally, many Arduino libraries will work on different targets. Or the mods are trivial.
If you use GFX style graphics the high level code will run on Adafruit, Bodmer, ...
with nothing more than changing include and constructor.

If you don't intend to read registers or GRAM there is no need for MISO (or bidirectional hardware)

David.

Aren't the IMn pins for RGB interface mode setup per Section 3.1? Since I'm not using this, wouldn't these be GNDd? SDO (pin 10) is described as the SPI Interface output pin. Wouldn't mean this is the MISO?

Looking at Section 6.3, 4-wire Serial, I'm confused as to how these pins translate to those identified in MCUFRIEND_kbv driver.
Here's what I have so far:
DIS Pin = Driver
CSX 37 = CS
SCL 36 = RS
D/CX ?? = ??
SDA 29 = WR
DOUT 10 = RD

Will be breadboarding this first. Don't need assistance on how to breadboard. Got that covered.

Don't know what a GRAM is.

The Project displays realtime readings from a number of temp/pressure sensors. Currently using a passive TFT, but the display is inadequate so switching to the transflective touchscreen.

Apologies if I've been confusing or unclear in this request. I could really use some assistance in identifying what the wiring connections should be for the ST7789v and the 1284P for a 4-wire SPI setup to be successful with the MCUFRIEND_kbv ST7789v Driver.

If I can get this working, then I can proceed to move forward with the rest of the PCB and software conversion from my currently working project.

If your current project is working on a 128x160 ST7735 it should be easy to port it to 240x240 ST7789 or even 240x320 ST7789. I presume you are using a GFX style library like Adafruit_ST7735_and_ST7789.

IMn pins select the hardware interface.

Adafruit_ST7789 is designed for 4-wire SPI. It does not use MISO.
MCUFRIEND_kbv is designed for 8080-8 parallel interface. You would need thirteen level shifters.

Seriously. Your biggest problem is attaching the ribbon.

I answered most of these points in message #1.

The software is easy. The schematic is reasonably straightforward. Soldering a 0.5mm pitch ribbon is difficult. Obtaining a 0.5mm connector and adapter is expensive and difficult.

Please study my replies. Quote message number and text when you have a question.

David.

David,

I did take a close look at the ESP MCUs and seriously considered your suggestion. I do like what it offers and will likely include that MCU in my future learning. But for this project, it really is a bit of a sledge hammer for fly and poses a learning curve I don't want to take on for THIS project's upgrade.

Since I have a working project using the Atmega328p my needs at this point is to:
-upgrade the Display to the transflective
-change the 2 physical buttons to using the TouchScreen input.

Since I'm currently max'd out on I/Os with the 328 and pushing the limit on the flash memory with my code, I want to do just what's necessary to make the changes listed above while changing as little of the current coding as possible. The current project provides important information to me while riding my motorcycle and with the display no longer working I need to resolve this quickly.

With all of this, I reviewed the currently available ATMEL chipsets (a higher likely of compatibility) and deduced that the 1284P seemed to be the best overall candidate.
-Very few changes in coding.
-Provides the addition I/Os needed to accommodate the Touchscreen and any additional Display needs
-Provides the additional Flash memory to accommodate the additional coding for the TS and Display needs
-Similar power needs/accommodations, so fewer changes to the current schematic/PCB design.

Your assistance in applying your MCUFriend.kbv driver would be GREATLY appreciated. Didn't want to give the impression I was ignoring your other great advice, which I will likely follow up on at a later time. It's just at this point in this project I'm just trying to make very specific upgrades.

david_prentice:
If your current project is working on a 128x160 ST7735 it should be easy to port it to 240x240 ST7789 or even 240x320 ST7789. I presume you are using a GFX style library like Adafruit_ST7735_and_ST7789.

IMn pins select the hardware interface.

Adafruit_ST7789 is designed for 4-wire SPI. It does not use MISO.
MCUFRIEND_kbv is designed for 8080-8 parallel interface. You would need thirteen level shifters.

Seriously. Your biggest problem is attaching the ribbon.

I answered most of these points in message #1.

The software is easy. The schematic is reasonably straightforward. Soldering a 0.5mm pitch ribbon is difficult. Obtaining a 0.5mm connector and adapter is expensive and difficult.

Please study my replies. Quote message number and text when you have a question.

David.

Yes, will continue using the GFX style library, adjusting pixel locations as appropriate for the larger display area. I want to do a FIRST test in migrating to the new display and resolve those issues. That's why I'm seeking the assistance in the wiring. I can't decipher which pins on the 7789 correlate to what I know of the 7735. OR, If I need to change the type of display interface and coding?

Re: IMn. I'm confused then. The Datasheet Sec 3.1 says pins 39-41 are for "parallel' and "RGB" mode. I thought that meant for SPI interface these would not be used, hence set to GND.

Re SPI: I thought 4-wire SPI bus specified four logic signals:
SCLK: Serial Clock (output from master)
MOSI: Master Output Slave Input, or Master Out Slave In (data output from master)
MISO: Master Input Slave Output, or Master In Slave Out (data output from slave)
SS: Slave Select (often active low, output from master)

What am I missing? This is where the many different abbreviations cause confusion. Thought the Startek labels translated to the standard SPI labels. Serial Peripheral Interface - Wikipedia

Thought the MCUFRIEND_kbv had a 4-wire SPI interface support? If not then that's my mistake (and lack of knowledge). In reading the .h file I saw the similar pinout labels as I used for the 7735 and thought that meant it was a serial interface. I didn't read anything that indicated a D0-D7 pinout, etc. My mistake and sorry for any confusion.

Will be using FFC adapters for both ribbons. For Breadboarding I already have two breakout board adapters. For final PCB I'll be making a custom sister board with SMD plugs to receive the ribbons. Will not be directly soldering the ribbons.

In reviewing the responses I've not found specific 'this display pin goes to this 1284p pin' type of description. That's what I need to setup the initial breadboarding so I can start testing/adjusting the coding, drivers, etc. to get the new display working.

Looking at Section 6.3, 4-wire Serial, I'm confused as to how these pins translate to those identified in MCUFRIEND_kbv driver.
Here's what I have so far:
DISPLAY Pin = Driver
CSX 37 = CS
SCL 36 = RS
D/CX ?? = ??
SDA 29 = WR
DOUT 10 = RD

This is going to be a very difficult project for you. Is it a group project for school?

Your wiring from the 45-way ribbon would be:

5, 6   = GND
7, 8, 9= 3.3V
10_SDO = n.c.
29_SDA = MOSI
35_WR  = DC
36_RS  = SCK
37_CS  = CS
38_RST = RST
39_IM0 = 0V
40_IM1 = 3.3V
41_IM2 = 3.3V

Your schematic has LCD_CS going to thin air. There are no I2C pullups.
I have not read the spec of the Touch Panel. FT6336 is an I2C controller chip.

Yes, I agree that the "4-wire SPI" terminology is confusing. It means:
"3-wire SPI" CS, SCK, SDA, (SDO) 9-bit SPI
"4-wire SPI" CS, SCK, SDA, (SDO) + DC 8-bit SPI

Regular AVR SPI expects CS, SCK, SDA, SDO
These small displays tend to use bidirectional SDA i.e. SDO is unused

The "3-wire" implies 9-bit rather than the number of pins used.

David.

david_prentice:
This is going to be a very difficult project for you. Is it a group project for school?

Your wiring from the 45-way ribbon would be:

5, 6   = GND

7, 8, 9= 3.3V
10_SDO = n.c.
29_SDA = MOSI
35_WR  = DC
36_RS  = SCK
37_CS  = CS
38_RST = RST
39_IM0 = 0V
40_IM1 = 3.3V
41_IM2 = 3.3V




Your schematic has LCD_CS going to thin air. There are no I2C pullups.
I have not read the spec of the Touch Panel. FT6336 is an I2C controller chip.

Yes, I agree that the "4-wire SPI" terminology is confusing. It means:
"3-wire SPI" CS, SCK, SDA, (SDO) 9-bit SPI
"4-wire SPI" CS, SCK, SDA, (SDO) + DC 8-bit SPI

Regular AVR SPI expects CS, SCK, SDA, SDO 
These small displays tend to use bidirectional SDA i.e. SDO is unused

The "3-wire" implies 9-bit rather than the number of pins used.

David.

David,
I'm a 56 yo ham radio operator/electronics enthusiast. The current project is already built and performing successfully for a few years now using a custom made PCB I designed and coded with SMD. While I have decades experience designing PCBs with THT/SMD, I have an average degree of experience coding and the reason for my original question being very specific. Not sure why there was such a focus on the physical attributes of working with FFCs.

As mentioned, the schematic I provided was more for FUNCTIONAL reference and of course did not include all of the detailed discreet devices, as that was not germane to my original question to the group.

Thank you for the pinout description. That's the advice I needed. Now we have something to focus future discussion.

The pinout is MUCH appreciated. I'll start breadboarding this now.

BTW, the FFC Adapter I'm using is from Proto Advantage - The 8pin FFC adapter is from an Ebay site, but provides the same interface. The Final PCB is already designed to use the same SMD plugs for both ribbons. While SMD soldering can be done with the aide of a 60x headset, it's not difficult for anyone with practiced soldering skills.

I'll provide an update once this gets wired out.

Thanks again!

Ah-ha. That makes all the difference. An Arduino user that understands Ohms Law and pcb design!

I understand Ohm and Kirchoff but am wary of fine pitch SMD. I am happier with software.

You are going to end up with a regular 2.4 inch TFT. i.e. about the same footprint as a Uno.

Ready made shields + Uno ends up the same width and height but about 25mm deep.
A custom pcb with SMD components has the same width and height but could be 6mm deep.

David.

Oops. 0.5mm is not too bad to solder. A reader had a FFC with 0.3mm pitch. The only practical method was a FFC connector soldered to an adapter pcb. Your FFC does not need many external connections. It still has to line up correctly on pcb or FFC connector.

david_prentice:
Ah-ha. That makes all the difference. An Arduino user that understands Ohms Law and pcb design!

I understand Ohm and Kirchoff but am wary of fine pitch SMD. I am happier with software.

You are going to end up with a regular 2.4 inch TFT. i.e. about the same footprint as a Uno.

Ready made shields + Uno ends up the same width and height but about 25mm deep.
A custom pcb with SMD components has the same width and height but could be 6mm deep.

David.

Oops. 0.5mm is not too bad to solder. A reader had a FFC with 0.3mm pitch. The only practical method was a FFC connector soldered to an adapter pcb. Your FFC does not need many external connections. It still has to line up correctly on pcb or FFC connector.

The 60x headset helps ALOT with the .3 pitch! I know my profile says newbie, not sure how to change that so misunderstandings don't occur. I built my first radio at 13 and started programming at 16 on teletype machines and baudot tape. :slight_smile:

Go on. You are a lot younger than me. I can remember going to Hatfield Polytech after school with my Maths teacher. Must have been 1967 or so. (I was 16)

Yes, there was punch tape and a monster computer.

By 1978 there would have been the first Apple, Pet, ...
But I suppose Polys would still have punch tape.

Your profile changes with number of messages posted. There are silly names.

David.