• AVR Freaks

Hot!Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices

Author
ArakelTheDragon
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2016/12/11 07:12:00
  • Location: 0
  • Status: offline
2020/04/01 04:05:09 (permalink)
0

Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices

Hi to everyone!
 
1. Details:
I am trying to use an RFID_RC522 module with a PIC16F690 and LCD-016N002L(16x2 lines) display. The display is 5V powered. The RFID_RC522 is 3V powered(3.3V, real is 3V). Now the PIC MCU can take from 1.8V to 5.5V. I am thinking of using 2 power supplies with LM2576 or LM2596. The RFID_RC522 communicates with the PIC through SPI(for some unknown reason this module has both MISO, MOSI and SDA, SDA should be for I2C, not SPI, while the PIC16F690 has SDI and SDA pin at 1 pin).
 
2. Question:
If the PIC16F690 is powered by 5V and the RFID_RC522 is powered by 3.3V, how much will be the tolerance for the SPI pins of the PIC16F690 and for the RFID_RC522? Maybe something like 0.8*VDD for the PIC which is 4V maximum, how much is the minimum? And for the RFID_RC522 I don't expect you to know since its not a Microchip device, but any help is appreciated. I need the maximum and minimum.
#1

10 Replies Related Threads

    ric
    Super Member
    • Total Posts : 26943
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/01 04:19:22 (permalink)
    +2 (2)
    ArakelTheDragon
    If the PIC16F690 is powered by 5V and the RFID_RC522 is powered by 3.3V, how much will be the tolerance for the SPI pins of the PIC16F690 and for the RFID_RC522? Maybe something like 0.8*VDD for the PIC which is 4V maximum, how much is the minimum?

    You're asking the wrong questions.
    You must treat the outputs and the inputs seperately.
    The PIC outputs will drive close to Vdd = 5V, which normally which you MUST not drive directly into a device running at 3V.
    However, luckily for you, the pins on the RFID RC533 are 5V tolerant, so it's ok to drive them directly.
    Your problem is the MISO/SDI signal coming from the RFID module. If the module is running at 3V, it will not drive that signal higher than 3V. Your PIC requires 0.8VDD = 4V minimum voltage to register a high, so 3V is nowhere high enough.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    ArakelTheDragon
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2016/12/11 07:12:00
    • Location: 0
    • Status: offline
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/01 04:24:06 (permalink)
    0
    Thanks for the warning. I did not specify the question correctly but I know that 5V and 3V devices need level transition.
     
    This is RFID_RC522, not RFID_RC533, is it also 5V tolerant? What I need to know is the maximum and minimum voltage for the SPI.
     
    Examle:
    minimum high voltage is 0.8*VDD
    maximum high voltage is VDD
     
    minimum low voltage is 0.4*VDD
    maximum low voltage is 0.6*VDD
     
    Can you please post in this format.
    #3
    ric
    Super Member
    • Total Posts : 26943
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/01 04:46:59 (permalink)
    +1 (1)
    All that info is in the PIC datasheet under "Electrical specifications"

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    ArakelTheDragon
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2016/12/11 07:12:00
    • Location: 0
    • Status: offline
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 00:39:48 (permalink)
    0
    I did not find it on the datasheet and I checked until page 244.
    #5
    ric
    Super Member
    • Total Posts : 26943
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 00:45:26 (permalink)
    +2 (2)
    ArakelTheDragon
    I did not find it on the datasheet and I checked until page 244.


    So you didn't notice the "Input Low Voltage" and "Input High Voltage" specifications on page 231?
    ww1.microchip.com/downloads/en/DeviceDoc/40001262F.pdf#page=231
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #6
    ArakelTheDragon
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2016/12/11 07:12:00
    • Location: 0
    • Status: offline
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 00:48:15 (permalink)
    0
    How do you know that his is valid for SPI?
    #7
    ric
    Super Member
    • Total Posts : 26943
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 01:04:33 (permalink)
    +2 (2)
    It's valid for ALL digital inputs, they all go through the same input buffers.
    There are only two types of buffer, ST or TTL, and the datasheet tells you what each pin is.
     
    post edited by ric - 2020/04/02 01:05:38

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #8
    ArakelTheDragon
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2016/12/11 07:12:00
    • Location: 0
    • Status: offline
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 02:52:14 (permalink)
    0
    So for schmit trigger input buffers, V[SPI] < 1V and V[SPI] > 4V.
    For TTL input/output buffers V[SPI] < 0.8V and V[SPI] > 2V.
     
    Shouldn't there be a difference between input and output voltage levels? Also this means that the PIC will freely take the SPI communication from the 3V3 device without the need of level transitioning? I only need to reduce the MISO(PIC to device) voltage from 5V to 3V?
    #9
    ric
    Super Member
    • Total Posts : 26943
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 03:10:47 (permalink)
    +2 (2)
    ArakelTheDragon
    So for schmit trigger input buffers, V[SPI] < 1V and V[SPI] > 4V.
    For TTL input/output buffers V[SPI] < 0.8V and V[SPI] > 2V.

    Correct, if the supply voltage is 5V.
     

    Shouldn't there be a difference between input and output voltage levels?

    No. they are always CMOS output levels, specified a little further down on the same page.
     

    Also this means that the PIC will freely take the SPI communication from the 3V3 device without the need of level transitioning?

    Ah no.
    I think you missed the fact that SDI uses ST levels, not TTL.
    This is documented on page 22, and again on page 69.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #10
    ArakelTheDragon
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2016/12/11 07:12:00
    • Location: 0
    • Status: offline
    Re: Voltage input clarification for PIC16F690 and SPI, 5V and 3V devices 2020/04/02 06:40:52 (permalink)
    0
    Thank you very much! Bye and have a nice day!
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5