which TFF or library with arduino zero ?

I just got the board. I have mcufriend 320 x 480, it is working fine on uno and mega.

When I load the same program on zero it does not work

It should work on the Zero. I only have the M0_Pro. The only difference is swapped D4 and D2.
The Arduino build line detects whether Zero or M0 by the ARDUINO_SAMD_ZERO symbol in the command line.

Please copy-paste the verbose build output and attach as a TXT file.

Or just copy-paste the "compile sketch" or "compile library" command.

David.

this is the board I have

https://www.ebay.com/itm/SAMD21-M0-32-bit-ARM-Cortex-M0-Core-Compatible-With-Arduino-Zero-Arduino-M0/163276771550?hash=item26040dd0de:g:xssAAOSwL4BZuflp:rk:2:pf:1&frcectupt=true

here is the program it loads but nothing happens (it works on uno, mega, due, nucleo F446RE)

#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#define GRAY 0x8410

const char *aspectname = {
“PORTRAIT”, “LANDSCAPE”, “PORTRAIT_REV”, “LANDSCAPE_REV”
};
const char *colorname = { “BLUE”, “GREEN”, “RED”, “GRAY” };
uint16_t colormask = { BLUE, GREEN, RED, GRAY, YELLOW };

int width = 480;
int height = 320;

void setup()
{

uint16_t ID = tft.readID();
tft.begin(ID);
drawScreen();

}

void drawScreen(){

tft.fillScreen(0xF800);
tft.setRotation(3);
tft.drawLine(40, 280, 40, 40, WHITE);
tft.drawLine(40, 280, 440, 280, WHITE);
tft.drawRect(0, 0, 480, 320, WHITE);
tft.drawLine(40,40,30,50,WHITE);
tft.drawLine(40,40,50,50,WHITE);
tft.drawLine(440,280,430,270,WHITE);
tft.drawLine(440,280,430,290,WHITE);
tft.setTextSize(2);
tft.setTextColor(WHITE);
tft.setCursor(35, 20);
tft.print(“Y”);
tft.setCursor(450, 275);
tft.print(“X”);
tft.setCursor(40, 100);
tft.setTextColor(WHITE);
tft.setCursor(40, 130);
}
void loop()
{

}

An Arduino Zero is a SAMD21 with an EDBG chip
An Arduino M0_Pro is a SAMD21 with an EDBG chip (but with D2, D4 swapped)

You have an M0 clone i.e. SAMD21 without a debugger chip.

I possess an M0_Pro and also an M0 clone (same as yours)

In the IDE, I select Arduino M0 Pro (Programming Port) for M0_Pro
Or Arduino M0 for the M0_clone

MCUFRIEND_kbv works fine on both boards.

I was worried that the Mcufriend RM68140 Shield might have timing difficulties with the v2.9.8 Release but it works fine. (the RM68140 was too slow for your F466

Note that your M0 clone uses the SAMD21 to implement SerialUSB
Regular Arduinos use a separate chip to implement Serial

If you want to use a Serial Terminal with a program written for Serial, you should add this to your sketch after your includes

#define Serial SerialUSB

Please let me know how you get on. Or post a message in the "Arduino Zero" topic
The SerialUSB "works" i.e. for Bootloading and Terminal but is not as robust as a separate USB Serial chip.

David.

the only option which works for this board is arduino zero with native USB. When I choose Arduino M0 it does not recognize the board.

There is only one USB port. I tried all the samples for tft, nothing will work.

When I click on the "get board info" it says arduino zero with native USB.

But I do not think it is the same as zero. Zero has two ports native USB and programmers like DUE.

This one has only one port. This is the only "Zero" I see on ebay and aliexpress.

And it is sold out on Arduino Store. I do not see a place the get the real zero

Confession. I think that I "Burned Bootloader" for "Arduino M0"

I seem to remember that the Ebay M0 clone came with a "Arduino Zero" bootloader.

Can you upload regular sketches?
Which "Board" do you select in the IDE?

From a semantic point of view the Ebay board should be called "Arduino M0" to differentiate from "Arduino M0 Pro"
"Arduino Zero" implies the "Pro" version with EDBG chip.

Of course Ebay vendors may feel that they will get more sales by conning punters that the board has EDBG.
At least the text is honest and the photos are honest.

Genuino Zero is currently available.
Arduino Zero is out of stock

Arduino M0 is retired
Arduino M0 Pro is retired

Arduino / Genuino Due seems to fluctuate between available and out of stock.

In practice lots of "Arduinos" are clones. My "M0 Pro" is the only genuine board that I own. (it was early Italian production badges as Zero Pro. Manufactured just before Tweedledum and Tweedledee started their battle)

David.

I do select Arduino/Genuino Zero (Native USB Port)

this is the only selection which works and I can upload program. I got the blinking LED all works after uploading except I cannot get the TFT to work.

It has the same pins as uno and I have no problem to get working TFT on uno.

My M0 clone has digital#2 on PA8 and digital#4 on PA14. Just like my M0_Pro.
My M0 clone looks exactly like your one.

A Zero has digital#2 on PA14 and digital#4 on PA8

I don't know what Bootloader the Chinese put on the board. I seem to remember it said "Zero".
I look at the Symbols in the build command. If you have selected "Zero (native)" I will assume you have PA14 / PA8

Please try forcing M0 wiring by editing utility/mcufriend_shield.h by changing this line

#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_ZERO)   // American ZERO

to

#if defined(___ARDUINO_SAMD_ZERO) || defined(___ARDUINO_SAMD_ZERO)   // Ignore American ZERO

This will ignore genuine American Zero. MCUFRIEND_kbv should work on your board.

Although my M0 clone looks like yours, you can test the digital#2 wiring by connecting a LED and resistor between digital#2 and GND.

void loop()
{
    pinMode(2, OUTPUT);
    digitalWrite(2, HIGH);
    delay(500);
    digitalWrite(2, LOW);
    delay(500);

If the LED does not blink, connect it digital#4 and run the same program. If it blinks, you have M0 wiring.

David.

I did PIN 2 like here

pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
delay(500);
digitalWrite(2, LOW);
delay(500);

and it is blinking on PIN 4

I did change to #if defined(___ARDUINO_SAMD_ZERO) || defined(___ARDUINO_SAMD_ZERO)

and I saw some change the TFT is no longer white but it looks like some static noise covered with small dots forming vertical lines.

It is my bedtime. I will ask a question on the Zero Forum tomorrow.
I suspect that the resident experts know what bootloader is installed on the M0 clone.

My M0 clone works fine (with the proper Board and Bootloader).

Do you own an ATMEL-ICE or SAM-ICE ?

It is wise to wait until we hear from the experts.

David.

I do not have ATMEL-ICE or SAM-ICE

But after changing to

#if defined(___ARDUINO_SAMD_ZERO) || defined(___ARDUINO_SAMD_ZERO)

and plugging today different TFT 0x9486 (320 x 480) it works

It looks like mcufriend but it is blue (mcufriend is red) but I think it has a little different pin layout.

Although on the boards the pins are marked the same way.

this is the one which works

Your link is to a “Mcufriend-style” Uno shield. i.e. the control and data pins are in the same place. It has 74HC245 bidirectional level-shifting buffers.

The ILI9481 version of your shield will work but gets HOT.
Does your ILI9486 shield get warm?

The “edit” that I gave you just ensures that LCD_D2 is on PA8 because that is what your M0 Board expects.
A genuine Zero would expect LCD_D2 on PA14.

Bear in mind that any sketches that use digital#2 or digital#4 will be using the wrong mapping when you specify “Zero” in the IDE.

Which display did not work?

David.

mcufriend does not work on my zero but the other one blue shield works.

so there must be something different,

but they all, both work on everything else, uno, mega, due, F446RE

Which mcufriend display?
i.e. what controller?
i.e. what size/colour pcb?

do you have a link to the Ebay sale?
or a photo of the pcb?

David.

this is the mcufirend I have, which does not work 320 x 480

https://www.ebay.com/itm/3-5-inch-TFT-LCD-Module-Mcufriend-LCD-Controller-Board-Arduino-Compatible/143101645781?hash=item215185d3d5:g:DoMAAOSwh99cSLZi:rk:1:pf:1&frcectupt=true

but the other one worked only after I changed the code you gave me.

Your link shows a Red 3.5 inch board without LDO regulator (and empty Flash footprint).

As I have written earlier, this is WRONG. However I would expect your M0 clone’s 3.3V regulator to be stronger than a Uno/Mega.

I have already tried the RM68140 shield (which takes a massive backlight current)

Most shields that I own have onboard AMS1117-3.3 LDO regulators for the backlight. (and draw sensible currents)

David.

the blue shied has AMS1117-3.3

but the mcufirend will light up and it is bright white screen,

it looks more to me like there is no data processed or not coming through

Identify which shields work and which do not by running on Uno or M0 clone.

Note controller ID, AMS1117, cool/warm/hot screen, success/failure.

If you have a DMM, you could measure Arduino current, and voltage on the 3.3V pin.

In an ideal world the backlight would give a vibrant display at a modest current. And nothing would get even warm.

David.