• AVR Freaks

Hot!UART RX, TX pins pull up or pull down

Author
YixinMa
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2020/04/24 05:55:17
  • Location: 0
  • Status: offline
2020/07/06 11:28:25 (permalink)
0

UART RX, TX pins pull up or pull down

Hi microchip experts,
 
When not using RX and TX pins of PIC16F15345, to avoid floating pin, should I use a pull-up resistor to pull the pins up to logical High?
 
I plan to use the UART (by connecting to the MP2221A eval board) to set the GPIOs and would like to keep the GPIO outputs as it is for a long time. I would like to make sure that RX and TX pins are properly regulated when not in use (after receiving one or two command lines).
 
Thank you for your help in advance and all the best,
 
Yixin
post edited by YixinMa - 2020/07/06 17:47:11
#1

12 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 4071
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 11:34:34 (permalink)
    +2 (2)
    TX: nothing (this is an output, so it won't float).
    RX: pull-up

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    Jerry Messina
    Super Member
    • Total Posts : 589
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 11:49:38 (permalink)
    +1 (1)
    du00000001TX: nothing (this is an output, so it won't float)

    I like to pull up the TX pin since it's floating at pon and reset until the pin/uart is initialized.
     
    #3
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 12032
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 14:04:40 (permalink)
    +2 (2)
    TX: nothing (this is an output, so it won't float).

     
    It's not an output until the PIC's software starts up and makes it one, meanwhile, it's floating from the perspective of the receiver on the other end.
    #4
    YixinMa
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2020/04/24 05:55:17
    • Location: 0
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 15:53:35 (permalink)
    0
    Thank you all for the help. 
     
    Should I also add pull-up resistor for MCLR/Vpp? Is it necessary?
     
    Currently, I have added 0.1uF between VDD and GND, and pull-up resistors for RX, MCLR pins. Is there any thing special rules for GPIO output pins?
     
    Thanks again and all the best,
     
    Yixin
    #5
    upand_at_them
    Super Member
    • Total Posts : 765
    • Reward points : 0
    • Joined: 2005/05/16 07:02:38
    • Location: Pennsylvania
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 17:04:05 (permalink)
    +1 (1)
    YixinMaShould I also add pull-up resistor for MCLR/Vpp? Is it necessary?

     
    In general...If you have MCLR enabled in your configuration as the reset function you will have to have a pullup to prevent the device from resetting.  It then gets pulled low to reset it, such as with a switch to ground, if you so desire.  In general, if you have MCLR disabled then that pin can only function as an input, in which case you would use a pullup to avoid spurious signals on that pin, as you would with any input pin unless weak internal pullups are enabled and sufficient.  Some PICs allow the MCLR pin to function as bidirectional I/O.  No mention of what PIC you are using.
    #6
    YixinMa
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2020/04/24 05:55:17
    • Location: 0
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 17:52:58 (permalink)
    0
    Hi, 
     
    Thank you for your help! I'm using PIC16F15345, I'm not going to use MCLR for my own use, except this pin will be need when programming with PICkit3. I guess I can just disable RESET function.
     
    All the best,
     
    Yixin
    #7
    ric
    Super Member
    • Total Posts : 29435
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: UART RX, TX pins pull up or pull down 2020/07/06 18:17:00 (permalink)
    0
    upand_at_them
    ...
    Some PICs allow the MCLR pin to function as bidirectional I/O.

    Really?
    I've not seen one yet, although I certainly haven't looked at all of them...
     

    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
    upand_at_them
    Super Member
    • Total Posts : 765
    • Reward points : 0
    • Joined: 2005/05/16 07:02:38
    • Location: Pennsylvania
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 19:52:18 (permalink)
    +1 (1)
    ric
    upand_at_them
    ...
    Some PICs allow the MCLR pin to function as bidirectional I/O.

    Really?
    I've not seen one yet, although I certainly haven't looked at all of them...



    One of the recent PIC's I've been using...PIC16F18313.  Haven't tested it, though.
    #9
    dan1138
    Super Member
    • Total Posts : 4162
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 19:55:02 (permalink)
    0
    ric
    upand_at_them
    ...
    Some PICs allow the MCLR pin to function as bidirectional I/O.

    Really?
    I've not seen one yet, although I certainly haven't looked at all of them...

    There is a method of using the MCLR as a pseudo output on controllers that allow control of the weak pull-up in that input. What's required is a buffer transistor with a weak pull-down, about 200 micro-amps, so when the weak-pull up for the MCLR input is enabled the buffer transistor will output a zero, then when the weak-pull up is disabled the buffer transistor will output a one.
     
    Because the current involved is so small the bandwidth is low. I get a switching rate around 20KHz with awful rise and fall times. Unless carefully designed the buffer transistor circuit will interfere with in circuit programming.
    #10
    dan1138
    Super Member
    • Total Posts : 4162
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 20:03:40 (permalink)
    +1 (1)
    upand_at_them
    One of the recent PIC's I've been using...PIC16F18313.  Haven't tested it, though.



    I doubt you will get what you want.

    Attached Image(s)

    #11
    ric
    Super Member
    • Total Posts : 29435
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: UART RX, TX pins pull up or pull down 2020/07/06 20:09:50 (permalink)
    +1 (1)
    upand_at_them
    One of the recent PIC's I've been using...PIC16F18313.  Haven't tested it, though.

    Yeah-nahh
    The only hint that it might is the text in table 1-2, saying it is CMOS output, and describing it as "General purpose I/O."
    The lack of a TRISA3 bit or a LATA3 bit confirms it is input only.
     
    So, it's just your typical "copy and paste" error from a lazy datasheet editor.
     
    post edited by ric - 2020/07/06 20:11:21

    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!
    #12
    upand_at_them
    Super Member
    • Total Posts : 765
    • Reward points : 0
    • Joined: 2005/05/16 07:02:38
    • Location: Pennsylvania
    • Status: offline
    Re: UART RX, TX pins pull up or pull down 2020/07/06 20:11:33 (permalink)
    0
    Yep, just saw that.  My mistake.  I was looking at this:
     
     

    Attached Image(s)

    #13
    Jump to:
    © 2021 APG vNext Commercial Version 4.5