Implementing a software UART in PIC18F2585

Discussion in 'Embedded Systems and Microcontrollers' started by 101, Jul 4, 2008.

  1. 101

    Thread Starter New Member

    Mar 8, 2008
    5
    0
    Please I need help on how to implement a software UART in PIC18F2585. Presently I'm using the hardware USART as my control and I need to use the software UART to send the data to the PC. I've gone through the software UART in the C18 Library but it doesnt output the data received on the hardware USART. I've tested with a scope and confirmed that the data gets to the hardware USART only. Please find below a section of my code that calls the software UART:

    OpenUART(); // Initializes the software UART
    {do
    {
    char X
    while(!DataRdyUSART()); //Checks for data in Hardware USART
    x=ReadUSART();
    WriteUART(x); // Outputs the data read from the Hardwrae USART
    }
    while(1);
    }

    I will be grateful if anyone can send me a sample code or advice on how I can go about this.
    Thank you very much.

    101
     
  2. lezlit

    New Member

    Jul 25, 2008
    2
    0
    • UART.zip
      File size:
      48.8 KB
      Views:
      295
Loading...