USART Speed

Discussion in 'General Electronics Chat' started by Dritech, Dec 21, 2013.

  1. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Hi all,

    I am using USART on the PIC18F at a baud rate of 9600 (Xtal 20MHz). Should I set BRGH to high speed or to low speed?

    Thanks in advance.
     
    Last edited: Dec 21, 2013
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,553
    2,375
    BRGH =1
    SPBRG = 19h for 9600 at 4mhz
    SPBRG = 81h for 9600 at 20Mhz
    Max.
     
    Dritech likes this.
  3. Dritech

    Thread Starter Well-Known Member

    Sep 21, 2011
    756
    5
    Thanks for the reply. Since the PIC18F has a USB protocol, is there any advantages of using USART over USB?
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,553
    2,375
    USART RS232 is +-9v (generated by the MAX232 etc) or RS485 differential, the USB is 5v, with generally a higher BAUD rate but lower distance capability.
    Max.
     
    Last edited: Dec 21, 2013
Loading...