Serial Baudrate 115200


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31

    Default Serial Baudrate 115200

    Hi all,
    Could anyone guide me about setting up the serial communication to 115200 baudrate?

    Thanks


    kblim

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I use DEBUG & DEBUGIN. These commands produce much smaller code, and
    you can get higher data-rates like 19200 with a 4MHz osc.
    Code:
    DEFINE OSC 20
    DEFINE DEBUG_REG PORTC
    DEFINE DEBUGIN_REG PORTC
    DEFINE DEBUGIN_BIT 7
    DEFINE DEBUG_BIT 6 
    DEFINE DEBUG_MODE 0 '1 = Inverted, 0 = true
    DEFINE DEBUGIN_MODE 0
    DEFINE DEBUG_BAUD 19200
     
    X VAR BYTE[3]
     
    MAIN:
        DEBUGIN 6000,NoData,[WAIT("A"),str X\3]
        DEBUG "Received:  ",str X\3,13,10
        GOTO MAIN
     
    NoData:
        DEBUG "Nada",13,10
        GOTO Main
     
        END
    This example works with a max232 PIC-PC interface. If you need direct, then
    just change mode to inverted.
    Last edited by Bruce; - 25th July 2010 at 22:39. Reason: baud rate change to 19200 max
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31


    Did you find this post helpful? Yes | No

    Red face

    Hi Bruce,

    Just wonder how to use Serout2, Serin2 with 115200 baudrate.


    From the formula :int(1000000/baudrate)-20,

    if use 115200 i will have int(1000000/115200)-20 = -12


    Please help.


    kblim

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If the baud rate calc doesn't work out to a positive number, then I'm pretty
    sure the data rate you need isn't supported by the command.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    seinfield's Avatar
    seinfield Guest


    Did you find this post helpful? Yes | No

    Default

    Use this:
    DEFINE HSER_SPBRG 21 'Configuración de velocidad de USART
    DEFINE HSER_TXSTA 36 'a 115200 baudios.

    Now you can use hserin and hserout at 115200 bauds

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


    Did you find this post helpful? Yes | No

    Default

    Yeah but in synchronous mode... and all that imply too
    Steve

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

Similar Threads

  1. Replies: 33
    Last Post: - 19th March 2010, 03:02
  2. Dynamic USB Serial Number (PIC18F4550)
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th July 2009, 17:03
  3. 16f88 internal osc 8mhz max serial baudrate ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th December 2008, 23:27
  4. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  5. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35

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