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

Thread: Can you confirm Im ok with this?

  1. #1

    Can you confirm Im ok with this?

    Hello!

    Im thinking about buying this screen (320x240 TFT Touchscreen, ILI9341) because im tired of having a mess of wires, multiplexers and leds.
    The thing is I would like to send my PCB design to print, so I would like to be sure that my connections are ok.
    Also Im not from the USA, so buying will take a few weeks to arrive to me. So if I buy the screen to test it and then I send the PCB it will delay my project at least three weeks... and Im pretty anxious to build it

    So im attaching the design that I built following what I saw in the website. I just follow the connections that are in the table. If someone can confirm me this is ok I will be very grateful.

    Click image for larger version. 

Name:	teensy and screen.PNG 
Views:	24 
Size:	28.5 KB 
ID:	28423

  2. #2
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    791
    Did you on purpose connect SCK/T_CLK to pin 14 of the T3.2?
    The table states pin 13 [when not using the Audio adapter]:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	2 
Size:	58.4 KB 
ID:	28426

    Paul

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,188
    To amplify what PaulS said, on the Teensy 3.x microprocessors, you can choose two sets of pins for the 3 SPI pins:
    • Pin 11 or pin 7 for DIN/MOSI;
    • Pin 12 or pin 8 for DOUT/MISO; (and)
    • Pin 13 or pin 14 for SCK/SCLK.


    If you use the default pins (11, 12, 13), the code should work fine. If you use the alternate pins, you will need to tell the SPI library that the alternate pins are used. If you use the audio shield (revisions A through C), you have to use some of the alternate pins because the I2S pins use some of the SPI pins.

    On the other hand, if you ever use a Teensy 4.0 or 4.1, you have to use the standard pins (11-13). The Teensy 4.0/4.1 do not support using alternate pins for SPI. The I2S pins used by the Teensy and the revision D audio shield for the Teensy 4.x series are on different pins than in the Teensy 3.x series.

  4. #4
    Quote Originally Posted by PaulS View Post
    Did you on purpose connect SCK/T_CLK to pin 14 of the T3.2?
    The table states pin 13 [when not using the Audio adapter]:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	2 
Size:	58.4 KB 
ID:	28426

    Paul
    Yes, I've connected using the second column (Teensy 3.x Audio Board) because I plan to use the Audio Board. Is that Ok?


    Quote Originally Posted by MichaelMeissner View Post
    To amplify what PaulS said, on the Teensy 3.x microprocessors, you can choose two sets of pins for the 3 SPI pins:
    • Pin 11 or pin 7 for DIN/MOSI;
    • Pin 12 or pin 8 for DOUT/MISO; (and)
    • Pin 13 or pin 14 for SCK/SCLK.


    If you use the default pins (11, 12, 13), the code should work fine. If you use the alternate pins, you will need to tell the SPI library that the alternate pins are used. If you use the audio shield (revisions A through C), you have to use some of the alternate pins because the I2S pins use some of the SPI pins.

    On the other hand, if you ever use a Teensy 4.0 or 4.1, you have to use the standard pins (11-13). The Teensy 4.0/4.1 do not support using alternate pins for SPI. The I2S pins used by the Teensy and the revision D audio shield for the Teensy 4.x series are on different pins than in the Teensy 3.x series.
    So is it easy to "tell the SPI library that the alternate pins are used"?

    Sorry if these are noob questions but well... I'm a noob

    Thank you for your time!

  5. #5
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,188

    Cool

    Quote Originally Posted by young.javier View Post
    Yes, I've connected using the second column (Teensy 3.x Audio Board) because I plan to use the Audio Board. Is that Ok?

    So is it easy to "tell the SPI library that the alternate pins are used"?

    Sorry if these are noob questions but well... I'm a noob

    Thank you for your time!
    In general, if you go over to https://www.pjrc.com/teensy/td_libs.html, it has all of the pages for documentation about the Teensy libraries.

    From there, go to the SPI page, https://www.pjrc.com/teensy/td_libs_SPI.html. It has the following text:

    Alternate SPI pins
    Sometimes, the SPI pins are already in use for other tasks when an SPI device is added to a project. If that task is simply a digital pin, or an analog input, it is usually better to move that to another pin so that the hardware SPI can be used. Sometimes though, the conflicting pin cannot be moved. The Audio Adapter, for example, uses some of the SPI pins to talk to the Audio DAC over I2S. For this case, Teensy 3.x provides an alternate set of SPI pins.

    The main SPI pins are enabled by default. SPI pins can be moved to their alternate position with SPI.setMOSI(pin), SPI.setMISO(pin), and SPI.setSCK(pin). You can move all of them, or just the ones that conflict, as you prefer. The pin must be the actual alternate pin supported by the hardware, see the table above; you can't just assign any random pin.

    You should be aware that libraries sometimes have to move SPI pins. (The Audio Library is an example). If you add an SPI device yto your project and it does not work, check whether the library has moved the pins and if so, use the same pins the library does.

    If all else fails, the SPI protocol can be emulated ("bit-banged") in software. This has the advantage that any convenient pins can be used, and the disadvantage that it is much, much slower and prevents your sketch from doing useful work meanwhile.

Posting Permissions

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