+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Newbie level 5
    Points: 51, Level: 1

    Join Date
    Apr 2019
    Posts
    10
    Helped
    0 / 0
    Points
    51
    Level
    1

    Digital pin as TXD , RXD.

    Can i use the digital pin of microcontroller as serial (TXD, RXD) ??

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 79,829, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,066
    Helped
    4372 / 4372
    Points
    79,829
    Level
    68

    Re: Digital pin as TXD , RXD.

    You can use any pin of a microcontroller to read or send serial data if you program it appropriately. If the microcontroller has a UART module it is usually easier to use it instead of using software but they normally constrain the UART connection to fixed pin numbers.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Newbie level 5
    Points: 51, Level: 1

    Join Date
    Apr 2019
    Posts
    10
    Helped
    0 / 0
    Points
    51
    Level
    1

    Re: Digital pin as TXD , RXD.

    how should i program it. is there a specific flow for making digital pin, a UART.



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 79,829, Level: 68
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,066
    Helped
    4372 / 4372
    Points
    79,829
    Level
    68

    Re: Digital pin as TXD , RXD.

    A UART is a specific device within most microcontrollers, you need to consult the data sheet to see how to use it.
    If you want to use any other pin for serial communication you have to write your own software to do it, we call it a 'software uart' or a 'bit-banged uart'. Your program is responsible for performing all the timing and shifting between serial and parallel streams. How to do it depends on which MCU you are using and to some extent what other things it also has to do. Software UARTs require precise timing so it often isn't feasible to use one if other demands are made on the MCUs resources.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--