5V to 3.3V communication


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219

    Default 5V to 3.3V communication

    I’m trying to use SHIFTIN between a 16f1936 at 5V and a 3.3V MAX31855 T-type TC to digital converter.

    Question: What is the most common method for communication interface of a 5V device with a 3.3V device? There are three lines between the PIC and the converter. I didn't think about the problem until I could not communicate with two MAX31655 which means I may have smoked 'em.

    Select 5V from PIC needs to be 3.3V I think
    CLK 5V from PIC needs to be 3.3V I think
    Data 3.3V from MAX should be OK

    The PIC drives the Select line from high to low enabling the converter serial output. The PIC supplies the clock and the converter drives the data line as communication is only one way from the converter to the PIC. Will a 1k ohm resistor in the CLK line create any problems? Will a 1k ohm resistor in the Select line cause any problems? The Data line is being driven by the 3.3V converter and should not have any problems, PIC should be able to read 3.3V and lose no data.
    Comments please!

    Wayne

  2. #2
    Join Date
    Aug 2011
    Posts
    443


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Select 5V from PIC needs to be 3.3V I think
    CLK 5V from PIC needs to be 3.3V I think
    Yup. You should use more than just a series 1K resistor, though.
    You could use a voltage divider on the 5V PIC outputs...say 2K series/3K shunt to gnd. That should work ok at slow speeds.
    You could also use a pullup resistor to 3.3V and drive the outputs as open-drain, but that's not compatible with SHIFTIN.

    Data 3.3V from MAX should be OK
    For the input pin be sure to pick a pin that has TTL level inputs (PORTA and PORTB) and not ST levels, otherwise the 3.3V output from the MAX won't meet the input Vih spec.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,569


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Hi,
    There are bidirectional level shifter ICs available and you can do it with small MOSFETs and such but for a one-off I'd just use a voltage divider on the 5V to 3.3V signal and nothing on the 3.3V to 5V signal. (Doing that right now in my desk (PIC is 3.3V, device is 5V).

    The MAX31855 logic high is min Vcc-0.4 so if you run it at 3.3V it'll put out 2.9V which is well above the 2.0V threshold of the PIC if you run that at 5V and using a non Schmitt trigger input...

    /Henrik.

  4. #4
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Thanks guys,
    I will take that and run with it. I think I'll bread board with the 2k/3k then look at a level shifter IC's' on the finial board work.
    Thanks again!
    Wayne

  5. #5
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Posts
    67


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Check out at Adafruit's breakout board. They have a nice solution: https://github.com/adafruit/Adafruit...breakout-board

    Why not powering your PIC with 3.3V? That saves a lot of trouble.

    Name:  Adafruit-MAX31855.png
Views: 733
Size:  22.0 KB

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Rather than buying expensive chips why not make your own with this app note:
    Attached Images Attached Images
    Dave Purola,
    N8NTA
    EN82fn

  7. #7
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Posts
    67


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Quote Originally Posted by Dave View Post
    Rather than buying expensive chips why not make your own with this app note:
    The Adafruit board is quite pricey but look how they did the level shifting. I did use this trick with an ESP8266, worked fine.

  8. #8
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    I also used it for interfacing to some LINX RFM-433 receivers and LINX TFM-433 transmitters in my Hopps moisture monitoring system.
    Dave Purola,
    N8NTA
    EN82fn

  9. #9
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    I've used THIS on a couple of projects and love 'em.
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

  10. #10
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Posts
    67


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Quote Originally Posted by andywpg View Post
    I've used THIS on a couple of projects and love 'em.
    Yes, works fine for me too. Do you want a second source?

  11. #11
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Thanks guys for all the tips. Yesterday I ordered an Adafruit breakout board with the MAX31855 on board with level shifting. I will see how well this works and follow their techniques. Looks like I could have saved a few bucks if I had checked this thread yesterday. Michel, if I power the f1936 at 3.3 I will have to buy a 3.3 LCD. Andy, the Sparkfun looks like the good solution to have in your toolbox for quick setups and they supply the schematic with part numbers, I’ll pick up a couple at that price!
    Thanks,
    Wayne

  12. #12
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Quote Originally Posted by MichelJasmin View Post
    Yes, works fine for me too. Do you want a second source?
    Thanks - good price.
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

  13. #13
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Any reason to not just run the PIC at 3.3V?

  14. #14
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: 5V to 3.3V communication

    Quote Originally Posted by Charlie View Post
    Any reason to not just run the PIC at 3.3V?
    In my case, some of the ic's I was using can ONLY run at 5V. The only thing that could only run at 3.3V was the XBee radio. So it was simpler to run everything at 5V and convert to talk to the XBee.
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

Similar Threads

  1. icd communication
    By jcleaver in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th July 2008, 16:36
  2. Wireless communication
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 17th April 2008, 19:21
  3. GPRS communication
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 9th April 2008, 21:02
  4. Help with 2 way communication
    By jessey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd April 2007, 10:11
  5. 18F458 to PC communication Help
    By shawn in forum Serial
    Replies: 4
    Last Post: - 11th February 2007, 20:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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