fork download
  1. #include <xc.h>
  2. #define _XTAL_FREQ 4000000
  3.  
  4. void UART_Init()
  5. {
  6. TRISCbits.TRISC6 = 1;
  7. TRISCbits.TRISC7 = 1;
  8.  
  9. SPBRG = 25;
  10. TXSTA = 0x24;
  11. RCSTA = 0x90;
  12. }
  13.  
  14. void UART_TxChar(char data)
  15. {
  16. while(!PIR1bits.TXIF);
  17. TXREG = data;
  18. }
  19.  
  20. void main()
  21. {
  22. UART_Init();
  23.  
  24. while(1)
  25. {
  26. UART_TxChar('A');
  27. __delay_ms(500);
  28. }
  29. }
Success #stdin #stdout 0.02s 25840KB
stdin
Standard input is empty
stdout
#include <xc.h>
#define _XTAL_FREQ 4000000

void UART_Init()
{
    TRISCbits.TRISC6 = 1;   
    TRISCbits.TRISC7 = 1;   

    SPBRG = 25;            
    TXSTA = 0x24;          
    RCSTA = 0x90;          
}

void UART_TxChar(char data)
{
    while(!PIR1bits.TXIF);
    TXREG = data;
}

void main()
{
    UART_Init();

    while(1)
    {
        UART_TxChar('A');
        __delay_ms(500);
    }
}