Teensy 4.0 First Beta Test

Status
Not open for further replies.
Hi @WMXZ - the board has the USBHost adapter on it like the T3.6 has. With the last beta Teensyduino install (msg #2), @Paul was able to get the USBHost_T36 library to work... Some of us have verified that at least most of the stuff we had working on T3.6 here is working on the T4 here as well, like mice, keyboards, serial adapters, Maybe joysticks (I have not tried these yet). Some of us are now playing with enhancing the support to add some Bluetooth stuff....

Another side question I have on this adapter. Does this require additional hardware to work? That is does the two pogo pins connect directly up to USB Host connector or is there some support hardware needed? (But that is more to do with, what do I need to add on my own T4 boards to be able to use USB Host...)
 
OK,
I have a trivial question:
I just got a breaoutboard for T4. (thank you at PJRC)
I note a new usb connector.
I see that the data lines are connected with pogo pins with the USB connector that we use to download programs.
I assume the new USB connector is for testing USB host.
How does it work?
Can I keep both usb cables connected, or must I disconnect the one I'm not using?

Nope. You can keep them connected as far as I can tell.

EDIT: @KurtE
Good question :)
 
Last edited:
Serial.read Not Working?
Know this was discussed but not sure there was a resolution for in beta9. But, it does seem to be working. Here is the code snippet, just to be sure:
Code:
  if (Serial.available()) {
    int ch = Serial.read(); // get the first char.
    while (Serial.read() != -1) ;
    if ((ch == 'b') || (ch == 'B')) {
      Serial.println("Only notify on Basic Axis changes");
      for (int joystick_index = 0; joystick_index < COUNT_JOYSTICKS; joystick_index++)
        joysticks[joystick_index].axisChangeNotifyMask(0x3ff);
    } else if ((ch == 'f') || (ch == 'F')) {
      Serial.println("Only notify on Full Axis changes");
      for (int joystick_index = 0; joystick_index < COUNT_JOYSTICKS; joystick_index++)
        joysticks[joystick_index].axisChangeNotifyMask(joystick_full_notify_mask);

    } else {
      if (show_changed_only) {
        show_changed_only = false;
        Serial.println("\n*** Show All fields mode ***");
      } else {
        show_changed_only = true;
        Serial.println("\n*** Show only changed fields mode ***");
      }
    }
  }
 
Arrived early, and I made it into town this morning...

So looking at the back of this board it appears like it was configured for 3 wire SPI and Capacitive touch... Wondering if I should try to reconfigure to 4 wire SPI?

Probably won't touch the touch stuff at first, but would be nice to get something displayed

EDIT: Should mention I don't believe the 40 pin connector is setup for RPI... It has a male connector... I think it is to allow for multiple of different ways to interface this display.
1-GND, 2-VCC,
3-20 DB0-DB18 (18 bit parallel mode)
21 reset

SPI:
23 CS
24 SCL
25 DC
27 SDI
28 SDO

29 back light control
30,31 SCL/SDA - I2C for Capacitive touch
32-35 (SDO, SCL, SDI) for other stuff
35 CS for SD
36 CS for font(none installed)
37 CS for Flash (none installed)
...

Update: I started playing with this one. Changed the solder jumpers and removed a 0res to convert to 4 wire SPI...

Found a library https://github.com/jaretburkett/ILI9488
Which has some Teensy support, but for some reason ;) their version of graphic test does not compile:
Code:
#define TFT_CS         PA1
#define TFT_DC         PB3
#define TFT_LED        PB0
#define TFT_RST PB4

Edited to real pin numbers, and does not compile on T4 as it has the normal issues, we see like:
Code:
C:\Users\kurte\Documents\Arduino\libraries\ILI9488\ILI9488.cpp:215:13: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

   dcport    = portOutputRegister(digitalPinToPort(_dc));

So to start off, I tried it on T3.6. Was able to get it to work, but the display does freeze up...

Next up I may make a version of my ili9341_t3n library to try it out... I noticed on the site: https://www.instructables.com/id/Arduino-and-35-Inch-320x480-TFT-LCD-ILI9488-SPI-In/
That they recommend starting off with the Adafruit_ili9341 library and make a few changes to make it work...

Will have to double check all of the stuff for storing pixels and the like are similar enough.

The thing that made me concerned was comment in readme of the library I am playing with:
I have made some heavy modifications, as the typical Adafruit TFT libraries are designed to work with 16bit color (RGB565), and the ILI9488 can only do 24bit (RGB888) color in 4 wire SPI mode.
But I am not sure that is true as section 4.7.2 of the ILI9488 PDF I have) 4-Line Serial Interface, implies that they have the following data formats:
8 colors, RGG 1,1,1 bit input
65K color 565
262K color 6,6,6 input format...

But their subsections only show the 8 color and the 262K color data...
 
Hi @WMXZ - the board has the USBHost adapter on it like the T3.6 has. With the last beta Teensyduino install (msg #2), @Paul was able to get the USBHost_T36 library to work... Some of us have verified that at least most of the stuff we had working on T3.6 here is working on the T4 here as well, like mice, keyboards, serial adapters, Maybe joysticks (I have not tried these yet). Some of us are now playing with enhancing the support to add some Bluetooth stuff....
I knew that a lot of USB-host work is going on and I could not imagine that one has to be a cable-jokey in order to do all this work.
So I try to start what is surely over my head, to access an usb disk.
the usb-disk io is trivial as already existing in the NXP SDK, but I have no clue yet on the usb-device level, but that is part of the fun.

@mjs513, thanks for info
 
@WMXZ, The POGO pins pull the HOST USB lines it seems as both can be used at once

opps - I'm a whole page behind … with our winter storms my 13 mile WIFi/Dish to a tower on that mountain must be snowed/iced over … giving them a call now re: my fitfully slow and intermittent connection.
 
@mjs513: it seems you already solved the mass-storage problem
So only to be correct, with the USBhost2.0 (and added SW) I can use T4 and access an USB stick in the usb-host socket, right?
 
Update: I started playing with this one. Changed the solder jumpers and removed a 0res to convert to 4 wire SPI...

Found a library https://github.com/jaretburkett/ILI9488
Which has some Teensy support, but for some reason ;) their version of graphic test does not compile:
Code:
#define TFT_CS         PA1
#define TFT_DC         PB3
#define TFT_LED        PB0
#define TFT_RST PB4

Edited to real pin numbers, and does not compile on T4 as it has the normal issues, we see like:
Code:
C:\Users\kurte\Documents\Arduino\libraries\ILI9488\ILI9488.cpp:215:13: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

   dcport    = portOutputRegister(digitalPinToPort(_dc));

So to start off, I tried it on T3.6. Was able to get it to work, but the display does freeze up...

Next up I may make a version of my ili9341_t3n library to try it out... I noticed on the site: https://www.instructables.com/id/Arduino-and-35-Inch-320x480-TFT-LCD-ILI9488-SPI-In/
That they recommend starting off with the Adafruit_ili9341 library and make a few changes to make it work...

Will have to double check all of the stuff for storing pixels and the like are similar enough.

The thing that made me concerned was comment in readme of the library I am playing with:

But I am not sure that is true as section 4.7.2 of the ILI9488 PDF I have) 4-Line Serial Interface, implies that they have the following data formats:
8 colors, RGG 1,1,1 bit input
65K color 565
262K color 6,6,6 input format...

But their subsections only show the 8 color and the 262K color data...

I have this version but it is missing something I am trying to figure connections:
Code:
24--GPIO7 --------> TP_CS
26--GPIO8 --------> LCD_CS
22--GPIO25 --------> TP_irq
23--GPIO11 --------> SPI_CLK
21--GPIO9 ---------> SPI_MISO
19--GPIO10 ---------> SPI_MOSI
5V ---------> 5V
GND ---------> GND

Came across the same library, https://github.com/jaretburkett/ILI9488, and saw the same errors. Was going to see if I could work around the issues. The display I have actually can work at 32Mhz and is 320x480.

I looked at the instructable but the changes they recommend to begin I don't see any compatible lines to change
 
@mjs513: it seems you already solved the mass-storage problem
So only to be correct, with the USBhost2.0 (and added SW) I can use T4 and access an USB stick in the usb-host socket, right?

Unfortunately you can't use the USB socket on the breakout board. UHS2.0 is only designed to be used with the USB Host Shield, I typically use the Mini Shield. What KurtE has been doing to try to get Bluetooth working with USBHost_t36. To get a memory stick working with the USB direct on the T4 you are going to have to right the driver. You might be able to start with UHS2.0 library as a start, or USH3.0 which is the latest but don't know if it works with a memory stick, never looked.
 
Kurt - my 3.5" rPi ILI9488 arrived on time today. If you can share any added details on edits, docs/links and connects and share your WIP I'll get mine hooked up.

24 bit on ILI9488 seems odd - the silkscreen says 16 or 18 bit at 480x320. It should be from the same batch and place as yours Kurt. Silkscreen: Ver 6.3 2018/4/9.

They upped the xmit power on my remote tower - and it was better for a bit - but now there is snow falling - so using phone as a hot spot ...
 
@KurtE
I got the ILI9488 library to compile and run. Got the following results but nothing displayed:
Code:
Display Power Mode: 0x7
MADCTL Mode: 0x7
Pixel Format: 0x3
Image Format: 0x3
Self Diagnostic: 0x3
Benchmark                Time (microseconds)
Screen fill              1474714
Text                     36788
Lines                    713037
Horiz/Vert Lines         119988
Rectangles (outline)     66842
Rectangles (filled)      3595085
Circles (filled)         348542
Circles (outline)        305704
Triangles (outline)      142497
Triangles (filled)       1151052
Rounded rects (outline)  132732
Rounded rects (filled)   3568766
Done!

I'll put it on my WIP page in case you want to play, https://github.com/mjs513/WIP/tree/master/ILI9488-master
 
Tim,
That sounds like exactly the same board as I have. It has a 8pin header and a 4pin header for 5v power?
 
Well don’t I feel late to the party :)

Making plans for testing things - nice to see frank is working on the audio library :)
 
@defragster, @mjs513 - I have had it running on T3.6 with the library mentioned, also have it edited to build for T4...

But wanted to try out ILI9341 library with the changes mentioned and nothing displays... I then looked at the differences in the init code...
And there is a reasonable amount of differences... Was wondering where he got his init functions from...

So went to this page: https://www.buydisplay.com/default/arduino-3-5-tft-lcd-touch-shield-serial-spi-example-for-mega-due
Actually indirectly from the page mine https://www.buydisplay.com/default/...lay-module-optl-touch-screen-w-breakout-board

In there is link to download file for Arduino mega example library... Which I downloaded and in there is a initlcd.h file...
Which has:
Code:
case ILI9488_16:
    LCD_Write_COM(0x11);
    delay(20);

    LCD_Write_COM(0xE0);
    LCD_Write_DATA(0x00);
    LCD_Write_DATA(0x03);
    LCD_Write_DATA(0x09);
    LCD_Write_DATA(0x08);
    LCD_Write_DATA(0x16);
    LCD_Write_DATA(0x0A);
    LCD_Write_DATA(0x3F);
    LCD_Write_DATA(0x78);
    LCD_Write_DATA(0x4C);
    LCD_Write_DATA(0x09);
    LCD_Write_DATA(0x0A);
    LCD_Write_DATA(0x08);
    LCD_Write_DATA(0x16);
    LCD_Write_DATA(0x1A);
    LCD_Write_DATA(0x0F);
    

    LCD_Write_COM(0XE1);
    LCD_Write_DATA(0x00);
    LCD_Write_DATA(0x16);
    LCD_Write_DATA(0x19);
    LCD_Write_DATA(0x03);
    LCD_Write_DATA(0x0F);
    LCD_Write_DATA(0x05);
    LCD_Write_DATA(0x32);
    LCD_Write_DATA(0x45);
    LCD_Write_DATA(0x46);
    LCD_Write_DATA(0x04);
    LCD_Write_DATA(0x0E);
    LCD_Write_DATA(0x0D);
    LCD_Write_DATA(0x35);
    LCD_Write_DATA(0x37);
    LCD_Write_DATA(0x0F);
      
    
    
     
    LCD_Write_COM(0XC0);      //Power Control 1 
    LCD_Write_DATA(0x17);    //Vreg1out 
    LCD_Write_DATA(0x15);    //Verg2out 
     
    LCD_Write_COM(0xC1);      //Power Control 2     
    LCD_Write_DATA(0x41);    //VGH,VGL 
     
    LCD_Write_COM(0xC5);      //Power Control 3 
    LCD_Write_DATA(0x00); 
    LCD_Write_DATA(0x12);    //Vcom 
    LCD_Write_DATA(0x80);
     
    LCD_Write_COM(0x36);      //Memory Access 
    LCD_Write_DATA(0x48); 
     
    LCD_Write_COM(0x3A);      // Interface Pixel Format 
[COLOR="#FF0000"]    LCD_Write_DATA(0x55); 	  //16 bit    [/COLOR]
     
    LCD_Write_COM(0XB0);      // Interface Mode Control 
    LCD_Write_DATA(0x00);     
     
    LCD_Write_COM(0xB1);      //Frame rate 
    LCD_Write_DATA(0xA0);    //60Hz 
     
    LCD_Write_COM(0xB4);      //Display Inversion Control 
    LCD_Write_DATA(0x02);    //2-dot 
     
    LCD_Write_COM(0XB6);      //Display Function Control  RGB/MCU Interface Control 	
    LCD_Write_DATA(0x02);    //MCU 
    LCD_Write_DATA(0x02);    //Source,Gate scan dieection 
      
    LCD_Write_COM(0XE9);      // Set Image Functio
    LCD_Write_DATA(0x00);    // Disable 24 bit data
     
    LCD_Write_COM(0xF7);      // Adjust Control 
    LCD_Write_DATA(0xA9);     
    LCD_Write_DATA(0x51);     
    LCD_Write_DATA(0x2C);     
    LCD_Write_DATA(0x82);    // D7 stream, loose 

    LCD_Write_COM(0x11); //Sleep out
	delay(120);
	LCD_Write_COM(0x29);
Which is what his library had, with the exception, he changed the 0x55 to 0x66 (16 bit mode to 18 bit mode)...
So now will try these inits in the Adafruit... library code (a copy that I renamed everthing to adafruit_ili9488...

If that works, will copy my ili9341_t3n library and try it at a faster speed...
 
Mike: Cool - I just got your WIP\ili9488 lib. Nice it gives numbers - if only there was some photon emission with that :(

Yes, and the 4 pin 5V header is labelled with 2 as NC. Did youd have it or order from Kurts Link like I did.

Any board edits like Kurt notes?
 
Mike: Cool - I just got your WIP\ili9488 lib. Nice it gives numbers - if only there was some photon emission with that :(

Yes, and the 4 pin 5V header is labelled with 2 as NC. Did youd have it or order from Kurts Link like I did.

Any board edits like Kurt notes?

I am thinking it has something to do with SPI Settings - have to take another look at that. I got mine off of EBAY, there is a RPi kernel for it but haven't got into that.

No board edits - didn't get that far. Kurt is a lot faster than me :). Had to take wife to PT and then got home and started looking around the web for stuff on the display.
 
Mike: Cool - I just got your WIP\ili9488 lib. Nice it gives numbers - if only there was some photon emission with that :(

Yes, and the 4 pin 5V header is labelled with 2 as NC. Did youd have it or order from Kurts Link like I did.

Any board edits like Kurt notes?
Mike is yours the same one as mine is?

If so I had to do some modifications to it... It came hardware configured for 3 wire SPI and I wanted 4 wire SPI...
If you go to previous post... There was the page for the display, and in it links to data sheets: https://www.buydisplay.com/download/manual/ER-TFTM035-6_Datasheet.pdf

If you look at Page 13 of this data sheet you will see 3 wire SPI has J1, 3, 5 Shorted and 2,4,6 open... Which mine was
If you look at the needed configuration, you need J1,2,3 shorted and J4,5,6 Open...
Also you need to remove R17
 
Looks like different units... as I mentioned, mine has 20 pin connector...

So not sure how yours might be configured
 
@KurtE - @defragster

Yes there are different units - been trying to find a schematic on it but not much luck. If I look at the diagnostics printed they are all zero. Maybe I have a connection wrong again
 
Status
Not open for further replies.
Back
Top