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

Thread: MISO pin conflict

  1. #1
    Junior Member
    Join Date
    Nov 2016
    Posts
    10

    MISO pin conflict

    Hello,

    I am working with wireless audio transmission between 2 Teensy 3.6 both using the Audioboard SGTL5000 for audio input in the Tx and output in the Rx. I am using this pinout:

    MOSI pin 7
    MISO pin 12
    SCK pin 14
    CE pin 28
    CS pin 39

    However, we are having many conflicts regarding MISO pin. The code is getting stuck when it is connected, and when we unwire it, the code seems to work. We have tried with all the alternate pins but still no solution. We are using these libraries:

    #include <Audio.h>
    #include <SPI.h>
    #include <nRF24L01.h>
    #include <RF24.h>
    #include <Arduino.h>

    Do you have any idea of what could be the solution?

  2. #2
    Junior Member
    Join Date
    Feb 2019
    Posts
    2
    Hello,

    Pin 39 is labelled as a MISO pin, not a CS pin.

    I had a similar issuing using the nRF24 modules. I put 10K pull-up resistors on the CS Line and it worked.

    https://www.pjrc.com/better-spi-bus-design-in-3-steps/

    John

  3. #3
    Junior Member
    Join Date
    Nov 2016
    Posts
    10
    Hello John. Thanks for the reply! I put 10K pull-up resistors on the CS line but it is still not working. I moved CS from pin 39 to pin 15. Still if I disconnect MISO pin, the code seems to work but if I reconnect it, the execution stops.

  4. #4
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,146
    Quote Originally Posted by jdriedger View Post
    Pin 39 is labelled as a MISO pin, not a CS pin.
    If not using implicit CS, you can use ANY digital pin as CS.
    AFAIK, implicit CS is only used by a few libraries (display library?)

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Maybe try the 2-resistor MISO test, to check if any of your chips lack tri-state.

    https://www.pjrc.com/better-spi-bus-design-in-3-steps/

    Scroll down to "Step 2: Proper MISO Tri-State Behavior"

  6. #6
    Junior Member
    Join Date
    Nov 2016
    Posts
    10
    Doing the 2-resistor MISO test, the results we got were these:

    When CS is LOW (active), MISO was 1.5V
    When CS is HIGH (disconnected from nRF module), MISO was 1.65V

    These results seem to be weird since MISO is never Vcc (3.3V) or GND (0V).

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Quote Originally Posted by opauly View Post
    These results seem to be weird since MISO is never Vcc (3.3V) or GND (0V).
    Maybe the MISO wire is loose or not soldered or connected to the wrong place?

  8. #8
    Junior Member
    Join Date
    Nov 2016
    Posts
    10
    We are using female jumpers, but they are connected rightly. Maybe soldering the wires could help?

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Just a sanity check... you used 10K resistors, right?

    If somehow much lower resistance was used in this test, then 1.5V would make sense, if the MISO driver was trying to drive an output, but couldn't overcome such a strong drive from the resistors.

  10. #10
    Junior Member
    Join Date
    Nov 2016
    Posts
    10
    Yes, 2 10k resistors in a voltage divider. Do you know any basic SPI code we can test with the nRF20L01 so we can make sure it is a software issue and not a hardware one?

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Just remove the Teensy completely and use a switch or wire to connect CS high or low.

    If the chip drives MISO when CS is high, that's a hardware issue. It has nothing to do with Teensy or any software. You can do this test without the Teensy connected at all. You only need those 2 resistors and a way to control the CS signal.

  12. #12
    Junior Member
    Join Date
    Nov 2016
    Posts
    10
    Well, doing this test you suggested, it seems the nRF module is working fine.

    CS: High -> MISO: 1.65v
    CS: Low -> MISO: 0.1v

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,914
    Start adding stuff and redo the test, until you discover which thing is preventing MISO from working as it should. Maybe first add Teensy, but have it run a do-nothing program so all its pins are floating.

  14. #14
    Junior Member
    Join Date
    Nov 2016
    Posts
    10
    I think the issue was that we were trying to declare a variable too big inside the update function, so the program was crashing. It seems to be working now. Thanks!

Posting Permissions

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