Dual USART, Second USART sends but not receives, PIC18F24K22


Results 1 to 8 of 8

Threaded View

  1. #7
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185

    Default Re: Dual USART, Second USART sends but not receives, PIC18F24K22

    Quote Originally Posted by svjohngalt View Post

    Define OSC 16


    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    define HSER_BAUD 9600
    DEFINE HSER_CLROERR 1


    DEFINE HSER2_RCSTA 90h
    DEFINE HSER2_TXSTA 24h
    define HSER2_BAUD 9600
    DEFINE HSER2_CLROERR 1

    return

    Sinde you say that UART1 is working fine with your config settings, then UART2 should also be working fine with the same config settings.
    Change your lines to

    Code:
    DEFINE OSC 16
    
    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 160 ' 9600 Baud @ 16MHz, -0,08%
    SPBRGH = 1
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    
    DEFINE HSER2_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER2_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER2_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER2_SPBRG 160 ' 9600 Baud @ 16MHz, -0,08%
    SPBRGH2 = 1
    BAUDCON2.3 = 1         ' Enable 16 bit baudrate generator
    Last edited by sayzer; - 12th January 2018 at 15:32.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. My USART problems..
    By Glenn in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 31st July 2009, 01:00
  2. USART to PC
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th October 2008, 00:09
  3. Usart
    By lew247 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd June 2008, 23:41
  4. PIC16F877 sends/receives data to/from a PC
    By ovidiu in forum Serial
    Replies: 1
    Last Post: - 2nd December 2006, 14:09
  5. dual- usart- receive- problem
    By Tomasm in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 1st June 2004, 17:33

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts