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

Thread: Teensy 3.3v SPI to 5v digital pot - write only. Do I need to worry about voltage?

  1. #1
    Junior Member
    Join Date
    Mar 2021
    Posts
    5

    Teensy 3.3v SPI to 5v digital pot - write only. Do I need to worry about voltage?

    I'm a new electronics hobbyist learning the basics. I'm controlling a 5v MCP42100 digital potentiometer from a Teensy 4.1 via SPI.
    My Teensy 4.1 is 3.3v and not 5v tolerant. I have to run the MCP42100 at 5v.

    What do I need to worry about if the SPI connection is write-only, using just CS, MOSI and SCK?

    In what cases is not being 5v tolerant a problem?
    5v connected to a pin in input mode is the main example I read about.
    What about 5v connected to an output pin set low?
    anything else?

    Thank you for any insight you can give me.

  2. #2
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    Hi Andy,
    In what cases is not being 5v tolerant a problem?
    Only in case a peripheral wants to drive a signal higher than 3V3 to the Teensy.
    For your application, CS, MOSI and SCK are all outputted by the Teensy at 3V3 max so no problem in that respect.

    What do I need to worry about
    You need to worry about the MCP42100 not being able to correctly recognize a HIGH signal from the Teensy, since the minimum VIH of the MCP42100 is 0.7*VDD [=3.5V]:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	4 
Size:	15.5 KB 
ID:	23971

    Probably 3V3 from the Teensy will be recognized as a HIGH by the MCP42100, but it's not guaranteed. So it's strongly recommended to use a level-shifter in your application to avoid potential problems.

    Hope this helps.

    Regards,
    Paul

  3. #3
    Junior Member
    Join Date
    Mar 2021
    Posts
    5
    Quote Originally Posted by PaulS View Post
    Hi Andy,
    Only in case a peripheral wants to drive a signal higher than 3V3 to the Teensy.
    For your application, CS, MOSI and SCK are all outputted by the Teensy at 3V3 max so no problem in that respect.
    Hi Paul, thank you for this info, it's very helpful.
    I have a couple more questions about the 5v intolerance and ground. I attached a drawing to illustrate.
    The Device has buttons. Normally they are closed by connecting a line to ground. I am doing it on the Teensy by connecting the line to an output pin. Setting the output low grounds the line and "presses the button". Putting it high causes the button to be released. Is this OK as far as 5v tolerance goes? Would the question be, does the 5v Device recognize 3v3 as "not grounded"?

    As for ground - is it all the same if it is in the same circuit? For instance, if device 2 had another ground pin, would that be the same as the first device's ground, even though device 1 is 5v and Device 2 is 3v3? I'm talking about low current signaling, not for running a high current device.
    Click image for larger version. 

Name:	20210308_220332.jpg 
Views:	11 
Size:	163.0 KB 
ID:	23984

  4. #4
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    533
    The Device has buttons. Normally they are closed by connecting a line to ground.
    This strongly suggests that the button input pins on the 5V Device are pulled up to 5V and that an external button [or a Teensy pin in your case] pulls that line low. Problem is that this 5V pullup voltage will kill your Teensy.
    Best way to check whether the button input pins on the 5V Device are indeed pulled up to 5V, is to separately power the 5V Device and check the voltage on the open button pin with a DVM [with everything, including Teensy, disconnected].
    Can you share more info on the circuitry of the 5V Device?

    As for ground - is it all the same if it is in the same circuit?
    Yes, in your application it is the same.

    Regards,
    Paul

Posting Permissions

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