/*******************************************************************************
Program for PC Based Load Control
Program Written by_ Engr. Mithun K. Das
Email: [email]mithun060@gmail.com[/email] Cell: +8801722448270;
MCU: PIC16F73; X_Tal: 8MHz;
Date: 28/10/2013;
*******************************************************************************/
unsigned char uart_rd; // read the received data,
void main()
{
//Initialize the USART
UART1_Init(9600);
//Write Some lines of TEXT
UART1_Write_Text(" ");
UART1_Write_Text(" PC Based LOAD Control");
UART1_Write_Text(" ");
Delay_ms(1000);
TRISB = 0x00;//all out
PORTB = 0x00;
while (1)
{
if (UART1_Data_Ready())
{ // If data has been received
uart_rd = UART1_Read(); // read the received data,
if(uart_rd=='1') RB0_bit = ~RB0_bit;
if(uart_rd=='2') RB1_bit = ~RB1_bit;
if(uart_rd=='3') RB2_bit = ~RB2_bit;
if(uart_rd=='4') RB3_bit = ~RB3_bit;
}
Delay_ms(100);
}
}