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

Thread: Pin 13 Problem on Teensy 4.1

  1. #1
    Junior Member
    Join Date
    Jun 2020
    Posts
    5

    Pin 13 Problem on Teensy 4.1

    Hi! I'm seriously enjoying my 4.1, but I've run into a bit of a conundrum. My pin 13 is very noisy and only goes up a couple millivolts (confirmed via scope) when I set it to HIGH. This is particularly problematic because SCK is on this pin and I need to use both SPIs (as I'm reserving SPI1 to a device that annoyingly isn't tri-state).

    Does anyone have any insight as to why this might be? All the other pins work fine and without issue except fro this one. An acceptable workaround if its even possible would be to use a different pin for SCK on SPI(0), but I don't think that's possible.

    Thanks!

  2. #2
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    335
    Hi,
    Can you show us the code and the hardware connected to the Teensy 4.1 that results in the millivolt output on pin 13?
    When I connect a scope to pin 13 while running the >Examples>Teensy>Tutorial1>Blink sketch, I see a perfect waveform:

    Click image for larger version. 

Name:	SDS00001.png 
Views:	21 
Size:	16.4 KB 
ID:	20658

    Thanks,
    Paul

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,918
    Quote Originally Posted by MeBoop View Post
    My pin 13 is very noisy and only goes up a couple millivolts (confirmed via scope) when I set it to HIGH.
    You cannot manipulate Pin13 after initializing SPI. So you cannot set it to high by digitalWrite or by using pinMode.

  4. #4
    Junior Member
    Join Date
    Jun 2020
    Posts
    5
    Quote Originally Posted by WMXZ View Post
    You cannot manipulate Pin13 after initializing SPI. So you cannot set it to high by digitalWrite or by using pinMode.
    I'm aware -- SPI not functioning is how I figured out this was happening in the first place

    Quote Originally Posted by PaulS View Post
    Hi,
    Can you show us the code and the hardware connected to the Teensy 4.1 that results in the millivolt output on pin 13?
    When I connect a scope to pin 13 while running the >Examples>Teensy>Tutorial1>Blink sketch, I see a perfect waveform:

    Click image for larger version. 

Name:	SDS00001.png 
Views:	21 
Size:	16.4 KB 
ID:	20658

    Thanks,
    Paul
    I'm using the blink sketch here -- look how wonky the signal is.
    Click image for larger version. 

Name:	Screenshot_2020-06-20 Instrument Control.png 
Views:	15 
Size:	66.3 KB 
ID:	20662

    For reference, here's blink on pin 14:
    Click image for larger version. 

Name:	Screenshot_2020-06-20 - Working - Instrument Control.png 
Views:	14 
Size:	14.4 KB 
ID:	20664

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,936
    For what it is worth, here is a capture on a T4.1 with my Saleae Pro Logic 8 digital in white, analog in Blue...

    Click image for larger version. 

Name:	screenshot.jpg 
Views:	20 
Size:	29.0 KB 
ID:	20665

  6. #6
    Junior Member
    Join Date
    Jun 2020
    Posts
    5
    I think my pin may just be foobarred

    So I don't have to wait for a replacement to ship, does anyone have a suggestion on "soft coding" a circumvention for the non tristate SPI board I'm interacting with? For instance, could I do something really dumb like swap my MISO1 pin back and forth from 39/1 depending on if I'm communicating to the device or not? Not sure how that would behave, performance wise, but this isn't a performance critical application (e.g. I'd only render to the display when enough changes happened, etc)

  7. #7
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,936
    In many cases like this, the first thing I try, is to make sure there is a good solder joint and also that there is not a solder bridge to another pin...

    I can probably look it up, but I know @mjs513 has display boards setup to tristate the MISO pin Maybe something like a 74AHC1G125GV

    Other option, might be, I have a FlexIO version of SPI, that is up github, that was working for some stuff, but it does not use the same base class as SPI, so not as easy to drop in.

    You also have SPI2, but those pins are not easy to get to. Either on the SDCard or the bottom memory chips.

  8. #8
    Junior Member
    Join Date
    Jun 2020
    Posts
    5
    Quote Originally Posted by KurtE View Post
    In many cases like this, the first thing I try, is to make sure there is a good solder joint and also that there is not a solder bridge to another pin...

    I can probably look it up, but I know @mjs513 has display boards setup to tristate the MISO pin Maybe something like a 74AHC1G125GV

    Other option, might be, I have a FlexIO version of SPI, that is up github, that was working for some stuff, but it does not use the same base class as SPI, so not as easy to drop in.

    You also have SPI2, but those pins are not easy to get to. Either on the SDCard or the bottom memory chips.
    Aw man, double checked the solder joint and I'm not shorting it, that would've been a huge relief. At this point I might just order another teensy, would prefer that to using an additional chip to babysit the rude display driver -- esp. since I intend on shoving some of the SOIC8 PSRAM to house a framebuffer (which at this point I may should just scrap the RAIO, since its disappointingly slow and flickery, and the text mode is slightly buggy.)

    If I do stick with the RAIO I'll have to see about porting slumdog's library to the 4.1, or writing my own (I'm willing to bet the 4.1 is more than capable enough to handle freetype, for example.)

    Thanks for everyone's help, I think I'll just consider this a defeat for now.

  9. #9
    Junior Member
    Join Date
    Jun 2020
    Posts
    5
    Update since I can't edit my post(?) -- The WINC1500 WiFi module I'm using seems to behave despite the RA8875 not being tristate and there has been no issues after running both in tandem for ~an hour (just outputting WiFi scan results to screen) -- so if anyone else runs into this issue with this particular setup, you should be good to go using SPI1.

Posting Permissions

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