Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

C:/Users/piyathil/MPLABXProjects/RS232.X/RS232In.

c
/*
* File:
: RS232In.c
* Author:
: piyathil
*
* Created on November 25, 2022, 1:45 PM
*/

#iinclude <stdio.h>
#iinclude <stdlib.h>
#iinclude <p18f4321.h>
# include <delays.h>
# include <CQU_LCD_Ver_2.h>
# include <usart.h>
# pragma config WDT = OFF
# pragma config LVP = OFF
# pragma config BOR = OFF
# pragma config OSC = INTIO2
void main(void) {
TRISCbits..TRISC0=1; // define SW2 as input
if (PORTCbits.RC0==0)
{
OpenUSART(( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_HIGH,
12);
putrsUSART(("Hello from CQU PIC Development Board \n");
Delay1KTCYx((50);
CloseUSART();
}
return ;
}

1.1 of 6 2022.11.25 15:02:38


C:/Users/piyathil/MPLABXProjects/RS232.X/RS232In.c

1.2 of 6 2022.11.25 15:02:38


C:/Users/piyathil/MPLABXProjects/RS232.X/RS232In.c

1.3 of 6 2022.11.25 15:02:38


C:/Users/piyathil/MPLABXProjects/RS232.X/RS232In.c

2.1 of 6 2022.11.25 15:02:38


C:/Users/piyathil/MPLABXProjects/RS232.X/RS232In.c

2.2 of 6 2022.11.25 15:02:38


C:/Users/piyathil/MPLABXProjects/RS232.X/RS232In.c

2.3 of 6 2022.11.25 15:02:38

You might also like