HSERIN and HSEROUT Pins


Results 1 to 3 of 3

Threaded View

  1. #2


    Did you find this post helpful? Yes | No

    Default Re: HSERIN and HSEROUT Pins

    The following notes are to close out this thread. The findings here are available for future reference.

    I tested the above question with actual hardware. The answer is yes, you can multiplex the hardware serial port pins. The pins can be enabled and disabled inline thus allow multiple usage.

    Code:
     'The following DEFINES are for EUSART at 16 mhz 2400 baud
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_SPBRG 130 ' 2400 Baud @ 16MHz, 0.0%
    SPBRGH = 6
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    
    APFCON0.7 = 0   'rx on rb1 (16f1826)
    APFCON1.0 = 1   'tx on pin rb5 (16f1826) 
    
    'use the hardware serial port in this space. The switches connected to rb1 and 
    'rb5 pins are open, so no effect on communications
    
    RCSTA.7 = 0           'disable hardware serial port (SPEN = 0)
    TRISB = %11100010     'refresh portb register
    
    'no communications needed in this space. The switches are active open and close.
    Last edited by Dick Ivers; - 2nd March 2014 at 00:49.

Similar Threads

  1. Help understanding HSERIN/HSEROUT
    By jmbanales21485 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 9th March 2021, 07:47
  2. need help hserin/hserout cmucam4
    By siyete in forum Serial
    Replies: 3
    Last Post: - 17th December 2012, 22:49
  3. Hserin/Hserout question
    By Philley in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th May 2007, 13:17
  4. Problems with HSERIN HSEROUT
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th September 2005, 17:24
  5. Hserin/hserout ?
    By Scott in forum General
    Replies: 6
    Last Post: - 27th April 2005, 23:46

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