RS232 comms - need help with datasheet


Results 1 to 14 of 14

Threaded View

  1. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Hi, Malc

    There's an error somewhere on your side ...

    - OR your Xtal is 20 Mhz and you run the HS Osc ... and you have to declare 20 Mhz as a define

    - OR your Xtal is a 12 Mhz and you run the HS PLL Osc ... then you get real 48 Mhz as a clock frequency

    a 20 Mhz Xtal with HS PLL would give 80 Mhz ... if the clock could run those frequencies ( I only reached 64 Mhz ... but hardly !!! )

    (so, I do hope it's just a typo from yours ...)

    Just try

    - a 12Mhz Xtal in HS PLL mode with 48 Mhz as a DEFINE
    OR
    - a 10 Mhz Xtal .... With 40 Mhz as a DEFINE.

    of course, the UART values have to be set accordingly to the DEFINEd freq. ...

    looks Mr E's calculator does not agree with you ...

    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_SPBRG 25  ' 115200 Baud @ 48MHz, 0.16%
    SPBRGH = 0
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    OR
    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 86  ' 115200 Baud @ 40MHz, -0.22%
    SPBRGH = 0
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    Aheum ....

    Alain
    Last edited by Acetronics2; - 6th August 2010 at 13:26. Reason: PBP Defines ...
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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