Usart compile errors 18F4520


Results 1 to 9 of 9

Threaded View

  1. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    SPBRG = 25 is 2400 baud @4MHZ, not 16MHz.

    If you need 2400 baud @16Mhz you should try those settings
    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 103 ' 2400 Baud @ 16MHz, 0.17%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    @9600 bauds
    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 25  ' 9600 Baud @ 16MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    etc etc etc.

    Try my PICMultiCalc for that.

    Download it from there
    http://www.picbasic.co.uk/forum/atta...7&d=1225550328
    Last edited by mister_e; - 7th May 2009 at 00:07.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Unable to pass a variable to LCDOUT without getting compile errors
    By Ferroto Baggins in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th February 2010, 17:43
  2. USB PBPL Compile errors
    By Rob in forum USB
    Replies: 11
    Last Post: - 7th April 2008, 09:18
  3. USB Mpasm Compile errors
    By JBrannan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st December 2007, 19:13
  4. Replies: 2
    Last Post: - 10th July 2006, 02:05
  5. Compile errors within macro....
    By forgie in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th September 2005, 20:08

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