The Mystery of the RobotDyn 2.8" LCD Touch Screen

Hi

I bought this TFT: TFT 2.8" LCD Touch Screen module, 3.3V, with SD and MicroSD card

The shop provides links to information, and schematics can be found there, but no information about the controller.
I asked for information, but did not get any response after 2 weeks. So I had to find out myself.

The controller of my display is ili9325, the interface is 8bit parallel (upper part), standard pinout for MEGA/DUE shields.
Interface is 3.3V, supply is 5V (LDO) and 5V on LED-A pin, but works also with 3.3V supply.

It works with MCUFRIEND_kbv on Sainsmart TFT LCD Mega Shield V2.2, with forcing ID 0x9325 and

#define USE_MEGA_8BIT_SHIELD

a bit dim with the 3.3V on LED-A.

I confirmed ili9325 on a CTE DUE shield, modified for read.

I still have to investigate with the RobotDyn UNO shield; it seems to use a “nonstandard” pin mapping.

I don’t like to recommend this supplier, but the display is rather inexpensive with its SD-card support.

Jean-Marc

schematics of the display

schematics of the shield

The mystery of the shield resolved:

The shield uses full PORTD for 8bit data to the TFT. And it uses “nonstandard” control pins.

This shield interferes with Serial IO.

Control pins used for TFT:

GxIO_UNO_P8_ROBOTDYN_SHIELD::GxIO_UNO_P8_ROBOTDYN_SHIELD() :
#if defined(UCSRB)
  _ucsrb(&UCSRB)
#elif defined(UCSR0B)
  _ucsrb(&UCSR0B)
#else
  _ucsrb(&_dummy_ucsrb)
#endif
{
  _cs   = A3; // PC3
  _rs   = A5; // PC5
  _rst  = A2; // PC2
  _wr   = A4; // PC4
}

Workaround for conflict with Serial IO:

void GxIO_UNO_P8_ROBOTDYN_SHIELD::writeCommandTransaction(uint8_t c)
{
  uint8_t ucsrb_save = *_ucsrb;
  *_ucsrb = 0;
  PORTC &= ~_BV(3); // CS_L;
  PORTC &= ~_BV(5); // RS_L;
  PORTD = c;
  PORTC &= ~_BV(4); PORTC &= ~_BV(4); PORTC |= _BV(4); // WR_STB;
  PORTC |= _BV(5); // RS_H;
  PORTC |= _BV(3); // CS_H;
  *_ucsrb = ucsrb_save;
}

There is no workaround to avoid garbage output on Serial TX.

I have not yet played with touch function and SD card.

When using the shield, where are you supposed to copy your two code blocks? I can't find any code in any MCUFRIEND, Adafruit or RobotDyn-provided library or file that includes anything close to PORTD, PORTC or UCSRB.

What do PORTD and UCSRB mean?

I attempted to use this shield with Adafruit's TFTLCD library (https://github.com/adafruit/TFTLCD-Library) with no luck, even though that library nominally supports the ILI9325 and I changed the CS, RS, RST and WR to be the same as you stated above under the non-standard control pins.

It is not uncommon for 8-bit write-only displays to use PORTD on a Uno.
It is the default for UTFT and from memory, it is either default or an option for Adafruit_TFTLCD.

The side-effect is garbage on the Serial Terminal.
And the bootloader is unlikely to work. (remove shield to program)

The TFT will work ok (and faster than regular MCUFRIEND_kbv). Obviously you can't use Serial.

Looking at the schematic, the SD should work ok but it will not permit other SPI devices.
So the XPT2046 does not seem to go anywhere on the Shield.

Since it seems to be a regular 20x2 display, you could use TFT for Mega Adapter Shield. These Adapters are widely available and cheap.

IMHO it is more trouble than it is worth trying to get SD, XPT2046 and 8-bit parallel TFT on a Uno.
Buy a Mega2560.

David.

p.s. At least it has a microSD socket. It seems pointless mounting the SD cage for monster SD cards.

fpduino:
When using the shield, where are you supposed to copy your two code blocks? I can't find any code in any MCUFRIEND, Adafruit or RobotDyn-provided library or file that includes anything close to PORTD, PORTC or UCSRB.

What do PORTD and UCSRB mean?

I attempted to use this shield with Adafruit's TFTLCD library (https://github.com/adafruit/TFTLCD-Library) with no luck, even though that library nominally supports the ILI9325 and I changed the CS, RS, RST and WR to be the same as you stated above under the non-standard control pins.

Sorry, I didn't add the link to the library referenced: https://github.com/ZinggJM/GxTFT

PORTD and UCSRB are IO port registers of Atmega328, the processor of Arduino UNO.