18F2520 HSEROUT baud rate oddity


Results 1 to 3 of 3

Threaded View

  1. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: 18F2520 HSEROUT baud rate oddity

    PBP's DEFINE HSER_BAUD is for setting up the baud rate of a USART.
    The compiler has no way of knowing when you set BRG16 (BAUDCON.3) in your code for EUSART 16-bit baudrate mode.

    For 16-bit mode, you must set the baud rate values manually.

    Code:
    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 64  ' 9600 Baud @ 32MHz, 0.04%
    SPBRGH = 3
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    Last edited by Darrel Taylor; - 10th June 2013 at 20:32.
    DT

Similar Threads

  1. How to change baud rate with HSEROUT?
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th November 2011, 02:48
  2. HSERIN HSEROUT - Baud rate help
    By George in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 15th September 2010, 08:05
  3. MCLoader baud rate
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 14th July 2010, 01:41
  4. Rf module baud rate
    By tazntex in forum Serial
    Replies: 4
    Last Post: - 5th August 2008, 18:47
  5. Baud Rate Converter
    By paul.mcallister in forum Serial
    Replies: 3
    Last Post: - 14th June 2008, 23:26

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