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

Thread: What type of cable to use

  1. #1

    What type of cable to use

    Hi

    Maby a dumb question but I'm just an newbie on this, but could anyone recommend me a specific cable to use for my Teensy to connect via SPI an so on?

    I've tried to search for a web shop in Europe to order from but without success, mainly do to my lack of knowledge...

    /Hans

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,935
    Sorry, not sure what you are asking?

    SPI to connect to what? At least for experimenting, I will often start off with my Teensy plugged into a breadboard, and then use some form of breadboard wires to connect it to whatever devices I am experimenting with.

    My last set of different breadboard connections was with some of these: https://smile.amazon.com/gp/product/B089FZ79CS/

    Not sure how good they are yet, but at least I try to get some fresh ones from time to time.

    But for SPI on my Teensy boards connect to pins 11-13 plus at least one other pin for chip select and of course a ground and most devices will want some form of power.

  3. #3
    Senior Member
    Join Date
    Jul 2020
    Posts
    477
    SPI is for short distances only, same PCB or a nearby module. Thus there's no connector standard for it.

  4. #4
    If you are trying to use an SPI display over a wire, i'm doing the same. I'm using Cat5 ethernet cable and have been able to use cable distance of 20 feet--however my standard setup is around 4 feet in an electrically noisy electric race car. The remote display PCB has a few push buttons for menus and such. i've implemented a Teensy 3.2, an ILI9341 2.4 inch display, custom printed PCB board RJ45 connectors

    A few tricks I'm doing

    1. gnd and MOSI are on one twisted pair -- an absolute must
    2. SCK and Vcc are on another twisted pair -- pretty sure this is a must (I'm mainly trying to wrap key lines around some type of barrier)
    3. inline 100 ohm resistors on the MOSI and SCK lines at the MCU side--I found not really needed but many claim it helps counteract wire capacitance
    4. 4K7 pullups on SCK and MOSI located at the display side
    5. periodically i'll call display.begin() to reset display if any screen anomalies appear

  5. #5
    Hi

    Yes, having some weird issues when running FT5206_touchScreen.ino from the Teensuino library.

    Sometimes the screen work properly but if restarted it don't work. I think the connections are ok and now I suspect the poor cable I'm using between the Teensy and the display.

    The display is the ER-TFTM070-5. Have measured all connection also with a multimeter.

  6. #6
    If you could be more specific on what doesn't work we might be able to help you out.

  7. #7
    Oh sorry, it's the touch that's the problem. It wont work intermittently. I'm soldering in new cable as you suggested right know.

    Have connected as https://github.com/sumotoy/RA8875/wi...ion-and-wiring.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,080
    Normally SPI isn't used over cables. It's really meant for connecting chips together on a circuit board over relatively short distance.

  9. #9
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,887
    Note, if the touch system uses the same SPI bus as the display, you might need to add pull-up resistors on the two CS pins (display & touch):


    Particularly if you are running a Teensy 4.0 or 4.1, you might also need to adjust the SPI bus speed, since the faster Teensys might run too fast for the display. I've had two displays on the same SPI bus (running the uncanny eyes program) that initially I needed to dial down the speed to prevent glitching when I moved from a Teensy 3.2 to a Teensy 3.6. Adding the pull-up resistors allowed me to increase the SPI clock speed, but there was a point where I couldn't run it any faster. I have several displays from different vendors, and the speeds were slightly different for each manufacturer. Once I did the testing, I just set the speed to match the slowest display I had on hand.

  10. #10
    Thank you all for your valuable input!


    @Paul
    I really want to use my Teensy in my little project with a display, so do you have any other suggestions?
    I would gladly pay someone to do a circuit board that connects to my display and Teensy like buydisplay.com seems to have for Arduino. Looks like plug and play.
    I'm more into the coding than build electrinics part together.

    Again, many thanks for your fast respons.

  11. #11
    Junior Member
    Join Date
    Sep 2020
    Posts
    8
    I'm using Cat5 ethernet cable and have been able to use cable distance of 20 feet--however my standard setup is around 4 feet in an electrically noisy electric race car. The remote display PCB has a few push buttons for menus and such. i've implemented a Teensy 3.2, an ILI9341 2.4 inch display, custom printed PCB board RJ45 connectors
    @ KrisKasprzak
    About your solution with the RJ45 connectors, any chance you have it online to look at it? I think That is the sort of thing I need, Im also with a ILI9341 but with ribbon cable, and works sometimes... hope to fix it using all your recommendations... in fact, counting cables, following what you say, I get the 13 connections without IRQ pin to 9, what do you do with the +1 on the 8 lines on the ethernet cable? Im gonna do MOSI-GND, SCK-Vin, 3.3-CS, MISO-T-CS, but the DC?
    Last edited by leacolumbi; 11-27-2020 at 08:47 PM.

  12. #12
    @leacolumbi

    yea see attached partial schematic.

    The environment my display is in, is a telemetry system for an electric race--brushed DC motor, relays, buzzers, nasty EMI and noise. I've tried everything, but displays with 4 foot cords seemed to lock up the MCU. I came across a post where someone suggested to use cat5 and make sure data lines were twisted with ground. When we layed out the schematic, we messed up and twisted DC with MOSI, and GND with SCK. However the display works. However, due to the noise I do restart the display (.init()) on every draw (init() every second that is). that way any EMI that does creep through and draw glitches on the screen, get erased with the Display.init() on every screen redraw. I know some are laughing and cringing, but put a sensitive wire on a steel frame with a brushed DC motor pulling 60 amps, and suggest a better way

    Hope this helps.


    Click image for larger version. 

Name:	rj_pins.JPG 
Views:	12 
Size:	143.0 KB 
ID:	22678

  13. #13
    Junior Member
    Join Date
    Sep 2020
    Posts
    8
    Quote Originally Posted by KrisKasprzak View Post
    @leacolumbi

    yea see attached partial schematic.

    The environment my display is in, is a telemetry system for an electric race--brushed DC motor, relays, buzzers, nasty EMI and noise. I've tried everything, but displays with 4 foot cords seemed to lock up the MCU. I came across a post where someone suggested to use cat5 and make sure data lines were twisted with ground. When we layed out the schematic, we messed up and twisted DC with MOSI, and GND with SCK. However the display works. However, due to the noise I do restart the display (.init()) on every draw (init() every second that is). that way any EMI that does creep through and draw glitches on the screen, get erased with the Display.init() on every screen redraw. I know some are laughing and cringing, but put a sensitive wire on a steel frame with a brushed DC motor pulling 60 amps, and suggest a better way

    Hope this helps.


    Click image for larger version. 

Name:	rj_pins.JPG 
Views:	12 
Size:	143.0 KB 
ID:	22678
    Oh I see, your 9341 isnt with touch, so you dont need the 8 cables... 60amps, that is rough!!! I get a good feeling using your approach will work for me if it has worked on your extreme conditions... I dont know what to do with the 9th cable... have to do tests...
    although, the 4.7k of SCK and MISO on the display side go to GND or 3.3 as the CS? do you think pulling up the CS on the Display side is a good approach?
    and do you state on setup CS pin INPUT_PULLUP? or just physical? As all the 9341 libs deal internally with the pins, I dont know if it has any meaning to state the pins on setup, or how to make it matter if it is needed...

    thank you for the schematic!!
    Last edited by leacolumbi; 11-30-2020 at 06:43 PM.

  14. #14
    9the cable? Do you mean the cable shielding? If CAT5 had 9 cables, i would have include touch capability. Now I do plan on exploring a touch display and only using T_CS and MISO lines (attempt to ignore T_INT) , but i've got to find a display with tri-state MISO. I have tried ground the shielding and all hell broke lose, I guess it acted like a giant antenna conducting noise to my boards. I tried 1M resistors and caps on shielding--no luck. so i leave shielding totally unconnected. Since I can't use touch, i use push buttons--consuming the other 2 lines.

    Attached is my schematic for the display

    1. pullup (connected to 3v3) on CS is a real resistor on the MCU side of the cable--no need for INPUT_PULLUP
    2. pullups (connected to 3v3) on SCK and MOSI are on the display side
    3. note how i'm handling RESET. To save a cable (that I don't have) sometimes RESET connected directly to 3v3 will white screen the display. This "low pass" filter slows the change to RESET and is very reliable in firing up the display.
    4. Hard wired LED, but you can alwasy connect to pot for varying the brightness
    5. also some caps to help filter incoming power (caps on pushbuttons are my version of hardware debouncing--I still have software debouncing as well)


    Click image for larger version. 

Name:	display.JPG 
Views:	9 
Size:	143.7 KB 
ID:	22700

  15. #15
    Junior Member
    Join Date
    Sep 2020
    Posts
    8

    Lightbulb

    Quote Originally Posted by KrisKasprzak View Post
    9the cable? Do you mean the cable shielding? If CAT5 had 9 cables, i would have include touch capability. Now I do plan on exploring a touch display and only using T_CS and MISO lines (attempt to ignore T_INT) , but i've got to find a display with tri-state MISO. I have tried ground the shielding and all hell broke lose, I guess it acted like a giant antenna conducting noise to my boards. I tried 1M resistors and caps on shielding--no luck. so i leave shielding totally unconnected. Since I can't use touch, i use push buttons--consuming the other 2 lines.

    Attached is my schematic for the display

    1. pullup (connected to 3v3) on CS is a real resistor on the MCU side of the cable--no need for INPUT_PULLUP
    2. pullups (connected to 3v3) on SCK and MOSI are on the display side
    3. note how i'm handling RESET. To save a cable (that I don't have) sometimes RESET connected directly to 3v3 will white screen the display. This "low pass" filter slows the change to RESET and is very reliable in firing up the display.
    4. Hard wired LED, but you can alwasy connect to pot for varying the brightness
    5. also some caps to help filter incoming power (caps on pushbuttons are my version of hardware debouncing--I still have software debouncing as well)


    Click image for larger version. 

Name:	display.JPG 
Views:	9 
Size:	143.7 KB 
ID:	22700
    Thank you again, Ive been using your schematics to put up my solution... and so, I got some questions, allright with 1 and 2, but on 3 your approach to RESET, I got a little confused with the 1K0, you mean 1000 ohms or 10 000ohms? and as I see, C1 and C4 are the only caps of 10uF the rest are 1uF, am I seeing correctly? I was just driving RESET through a 10K to 3.3v, guess with the GND connection your "low-pass" must be nice!
    About 4, Your TFT does have a 100R ? mine doesnt, so I'm going as the Paul S page recommended https://www.pjrc.com/store/display_ili9341_touch.html , would be nice a pot, but not my priority now.

    And about the "giant antenna" I've been reading this post on "termination" and SPI and as user3624 point out, seems the shielding should go to another path, not normal GND, halved. From my understanding maybe the same but after the MCUS with a diode? they point it should only connect on the exit point, allowing to collect waves on the upper part in any way... umm sorry, think I'm mixing with some other forum I found about manually shielding... but it gets me to other thing I researched about FTP ethernet cable, it has 9 cables and a metal jacket, ofcourse we dont have access to the 9th because it is with the metaljacket... thinking you could try that way...

    Im doing a 5 twisted pair with double GND and all the 9 connections from the display, will report how it works!!
    Thanks again

  16. #16
    Regarding RESET the resistor is 1000 ohm, and the cap is a 10 uF--yea sounds huge, but the 2.2 TFT's used here were very finicky. You may have to adjust these values, hence, pushing 3v3 through a 10K may work as well. The other 10 uF is just for power supply stabilizing--not sure it really helps, but makes me feel better.

    I just push 3v3 right to LED, maybe better to have a 100R resistor, i'll look at that.

    Yea let me know what you do around grounding the shield.

Posting Permissions

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