Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 16 of 16

Thread: Teensy 4.0 with Audio Board and ILI9341 screen wiring

  1. #1
    Member
    Join Date
    Mar 2019
    Location
    Hoboken, New Jersey, USA
    Posts
    77

    Teensy 4.0 with Audio Board and ILI9341 screen wiring

    Did somebody already wire the ILI9341 screen to Teensy 4.0 stacked with the new Audio Board? Ideally, without using the bottom connectors.
    Just trying to save myself some time figuring it out.
    Thank you.

  2. #2
    Member
    Join Date
    Mar 2019
    Location
    Hoboken, New Jersey, USA
    Posts
    77
    Sorry, forgot to ask what SD card reader will fit on Teensy 4.0 (bottom side) ? I've never done it and they all look so different.
    Can somebody point out one for me on Amazon, preferably?
    Thanks again.

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,369
    Quote Originally Posted by Andy Belov View Post
    Sorry, forgot to ask what SD card reader will fit on Teensy 4.0 (bottom side) ? I've never done it and they all look so different.
    Can somebody point out one for me on Amazon, preferably?
    Thanks again.
    Note, I haven't done it yet, but I suspect that there isn't room to solder a micro SD card directly to the Teensy. There are 2 or 3 bumps in the back of the Teensy that looks like they would be where the card reader would go. Even if the card reader clears those bumps, you might not be able to get a card into the reader.

    Instead what Paul did in the breakout board during the beta test and loglow looks like he is doing in his breakout board was you attach a FFC 1mm 8 position connector to the Teensy, and then use a 1mm 8 position FFC cable to connect those 8 pins to another FFC 1mm 8 position connector to the PCB, and from there on route the pins.


    Blackketter has a different approach to use a castlelated PCB with the center cut out, Then you connect it by making a solder bridge between the cutout register and the Teensy. There he just brings out the pins to the side of the Teensy that you can connect to a normal through hole solder micro SD card reader.

  4. #4
    Senior Member
    Join Date
    May 2016
    Posts
    228
    I've run the T4 with the ILI9341 Display, and the T4 with the Audio Board, but not all three together.
    That's my job for tomorrow. To be honest I'm still a bit confused as to whether they will play nice on the same SPI bus... I'll let you know how it works out.
    Do you have any suggestions on the pins to try?

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,097
    Quote Originally Posted by Andy Belov View Post
    Did somebody already wire the ILI9341 screen to Teensy 4.0 stacked with the new Audio Board? Ideally, without using the bottom connectors.
    Just trying to save myself some time figuring it out.
    Thank you.
    Looking at the Audio Adapter page for the New Rev D board : pjrc.com/store/teensy3_audio.html

    The SPI pins are in the 'normal' spots

    SCK 13
    MISO 12
    MOSI 11
    Just need to find an open CS pin for the display.

    Just soldered up a new Rev D board for Teensy 4. Did testing against the First Audio Tutorial and Pot and button pins worked - and the beep tone to headphones - then tested A Winbond 16 MB flash chip I soldered on to work as well as the SD Socket on the Audio board - including putting files on the SD card and transferring them to the Flash chip with the SerialFlash example.

  6. #6
    Senior Member
    Join Date
    May 2016
    Posts
    228
    From defragster: J
    ust need to find an open CS pin for the display.
    and that is where I'm totally confused!

    The T3.6 had a bunch of alternate pins for the SPI bus and it was necessary to use those alternates to have the TFT and audio board connected at the same time.
    The T4.0 hsa a bunch of SPI buses, and no alternate pins (that I can find),

    I have loglow's excellent pinout sheet - no CS alternates are there. So, the question is: can I steal any CS pin from another SPI port, or do I have to connect the display to its own dedicated SPI bus?

    A second question is: can I choose any available pin for D/C on the display?

    Aside: I'm wiring up a new general prototyping T4 board as we speak... To start with it will have the Audio board, display, a 16 channel port expander, rotary encoder, tactile switches, and one or two pots. I'm using my beta Loglow breakout board. It works, but pins 35 and 36 are wonky, (I hope he doesn't change the format on the next go-around)

  7. #7
    Member
    Join Date
    Mar 2019
    Location
    Hoboken, New Jersey, USA
    Posts
    77
    Hi Derek,
    Good to know that I'm not alone in this. I'm making a compact (big pocket size) musical instrument which needs a screen, the Audio Board, about 30 capacitive sensors, bluetooth with A2DP, USB host (for MIDI keyboards), gutar preamp (got this working yesterday), fast SD writer (for recording).
    And I need Teensy 4.0 for all this, because I need every bit of power for real-time pitch recognition from microphone and/or guitar.

    I know we'll do it. Today I have all Sunday to my self and I'm going to breadboard T4, the Audio Board and the screen.
    Let's see who wins (today).

  8. #8
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,238
    Quote Originally Posted by defragster View Post

    Just soldered up a new Rev D board for Teensy 4. Did testing against the First Audio Tutorial and Pot and button pins worked - and the beep tone to headphones - then tested A Winbond 16 MB flash chip I soldered on to work as well as the SD Socket on the Audio board - including putting files on the SD card and transferring them to the Flash chip with the SerialFlash example.
    FWIW, i too just soldered up Rev D audio board for T4. Soldered volume pot and teensy microphone. Mounted on T4 with female headers. Tested with WavFilePlayer with volume control and WAV files from uSD on shield. mic tests were good too.

    https://www.pjrc.com/store/teensy3_audio.html

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,097
    Quote Originally Posted by DerekR View Post
    From defragster: J
    and that is where I'm totally confused!

    The T3.6 had a bunch of alternate pins for the SPI bus and it was necessary to use those alternates to have the TFT and audio board connected at the same time.
    The T4.0 hsa a bunch of SPI buses, and no alternate pins (that I can find),

    I have loglow's excellent pinout sheet - no CS alternates are there. So, the question is: can I steal any CS pin from another SPI port, or do I have to connect the display to its own dedicated SPI bus?

    A second question is: can I choose any available pin for D/C on the display?

    Aside: I'm wiring up a new general prototyping T4 board as we speak... To start with it will have the Audio board, display, a 16 channel port expander, rotary encoder, tactile switches, and one or two pots. I'm using my beta Loglow breakout board. It works, but pins 35 and 36 are wonky, (I hope he doesn't change the format on the next go-around)
    On Teensy_4 the SPI doesn't have the ability to use hardware specific CS pins in the same special T_3.x way - so any available digital pin can be used for CS AFAIK based on watching KurtE work and making it work the best it can in that fashion.

    @KurtE might chime in - but the D/C pin is the same - or check the updated ILI9341 thread where the T4 was made to work - I haven't gotten back to that yet with this new setup.

    I was hoping to do a full build with a fresh T_4 using the OSH Blackketter breakout - but alas that didn't yield a usable board so I'm using another T4 instead for now - and distracted by doing my neglected outdoor 'summer chores' that need to be done for winter with fall here.


    @manitou - with the RevD board … got and installed a MIC and POT and full Audio Tutorial wire kit in addition to putting on the DigiKey Winbond flash. Tested enough to see that all work ( except MIC )

  10. #10
    Member
    Join Date
    Mar 2019
    Location
    Hoboken, New Jersey, USA
    Posts
    77
    I got it working, both the Audio Board and the screen, but only as long as I keep the SD card out of the Audio Board.
    As soon as I just stick the SD card back into the slot, the screen doesn't show the "Touched..." message in this test: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\XPT204 6_Touchscreen\examples\ILI9341Test
    Maybe it's because I don't initialize the SD library? Well, I was going to use Teensy on-board SD card anyway.

    I tried the guitar and peak meter for the microphone, all works.

    Here is my connection pins for the screen (the numbers are the Teensy pins):

    // Touch ---
    #define T_IRQ 16
    // T_DO: connected to TFT_SDO on the screen
    // T_DIN: connected to TFT_MOSI on the screen
    #define T_CS 9
    // T_CLK: connected to TFT_SCK on the screen
    // Screen ---
    #define TFT_SDO 12 // * (MISO), connected to T_DO on the screen
    #define TFT_LED 5 // 100 Ohm resistor
    #define TFT_SCK 13
    #define TFT_MOSI 11
    #define TFT_DC 5
    #define TFT_RST 255 // RESET: +3.3V, connected on the screen
    #define TFT_CS 14
    // GND
    // VCC: +3.3V


    Here is the modified ILI9341Test test:

    #define CS_PIN 9
    #define TFT_DC 5
    #define TFT_CS 14
    // MOSI=11, MISO=12, SCK=13

    #define TIRQ_PIN 16
    XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN);
    //XPT2046_Touchscreen ts(CS_PIN); // Param 2 - NULL - No interrupts
    //XPT2046_Touchscreen ts(CS_PIN, 255); // Param 2 - 255 - No interrupts
    //XPT2046_Touchscreen ts(CS_PIN, TIRQ_PIN); // Param 2 - Touch IRQ Pin - interrupt enabled polling

    ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
    ... the rest is as it was

  11. #11
    Senior Member
    Join Date
    May 2016
    Posts
    228
    Andy - You beat me!!! I didn't get very far at all today, I could find my plastic bag of female headers We have a local electronics parts store that's closed on Sundays, so I'll be able to get some in the morning...

    Anyway, It's great to hear of your success!

    @defragster - if you can use any pin as CS, do you know if there's a reason why specific pins are listed on the T4 card, and loglow's sheet? That's what's been confusing my tiny brain.

  12. #12
    Junior Member
    Join Date
    Jul 2018
    Posts
    10
    Thanks Andy!

    Your information helped me wiring the Teensy 4.0 and the TFT & Touch with the Audio Shield.

  13. #13
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,369
    Quote Originally Posted by DerekR View Post
    Andy - You beat me!!! I didn't get very far at all today, I could find my plastic bag of female headers We have a local electronics parts store that's closed on Sundays, so I'll be able to get some in the morning...

    Anyway, It's great to hear of your success!

    @defragster - if you can use any pin as CS, do you know if there's a reason why specific pins are listed on the T4 card, and loglow's sheet? That's what's been confusing my tiny brain.
    The hardware has some optimizations for the main CS pin (10 for the first SPI bus), but unlike the Teensy 3.x processors (with 5 pins), the optimizations don't seem to help as much. I'll let the display/SPI experts weigh in on this one.

    If you have multiple devices on the same SPI bus, here are some things you can do to make it better:


    The simplest is putting pull-up resistors in parallel for the CS and DC pins for each device. I'm not sure how you would go about providing tri-state relief on devices with more than one SPI device (i.e. the display/touch screen, and the audio shield with both micro SD card and soldered flash memory).

    I vaguely recall there have been discussions about the touchscreen not being properly tri-stated, but I haven't actually tried it yet.

  14. #14
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,097
    Quote Originally Posted by DerekR View Post
    Andy - You beat me!!! I didn't get very far at all today, I could find my plastic bag of female headers We have a local electronics parts store that's closed on Sundays, so I'll be able to get some in the morning...

    Anyway, It's great to hear of your success!

    @defragster - if you can use any pin as CS, do you know if there's a reason why specific pins are listed on the T4 card, and loglow's sheet? That's what's been confusing my tiny brain.
    Just seeing this. Loglow card is just a copy of relevant pin functions to match the PJRC card - where the underlying function is fixed on the T4.

    There are pins associated with the T4's SPI hardware it seems, but the design of the SPI engine doesn't allow the same integration into queued events of the CS pin so it has to be manipulated manually - in which case the pin used doesn't matter.

  15. #15
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,097
    Quote Originally Posted by MichaelMeissner View Post
    ...
    I vaguely recall there have been discussions about the touchscreen not being properly tri-stated, but I haven't actually tried it yet.
    There are some touchscreens - the problem is actually the display controller MISO pin not being tri-stated - and it was only observed (at least here) so far on some ILI9488 displays. Touch worked when the MISO pin was not routed - though I didn't have a second SPI device online - it is possible the Touch MISO is the same.

  16. #16
    Member
    Join Date
    Mar 2019
    Location
    Hoboken, New Jersey, USA
    Posts
    77
    Finished KiCAD PCB today and found all parts on DigiKey for this.
    Looks like something from Star Wars.

    Click image for larger version. 

Name:	Pedal.jpg 
Views:	11 
Size:	78.0 KB 
ID:	18239

    Teensy 4.0
    Guitar input (preamp buffer)
    Line in, out, phone out.
    Bluetooth.
    LiPo charger with load sharing, 500mAH battery.
    "Audio Board" re-flowed on-board.
    SD-card with 4 data lines from Teensy's bottom.
    USB host.
    The screen is on the back. Power and reset buttons, 3 LED's for charger.

    The board is 90x62mm. Going to order 3-5 sets to test next week. This is how I spent my week of vacation.
    The case in FreeCAD is next. Got a 3D printer already.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •