areeckal
Member level 2
I need to establish RF communication between two pic 16f877a. I need to transmit a bit according to the sensor output. How to configure pic for this? I studied USART and I have written the following code:
Code:
#include <htc.h>
#include "usart.h"
unsigned int data;
void delay()
{
for(int i=0;i<100;i++)
{}
}
void main(void)
{
INTCON=0; // purpose of disabling the interrupts.
init_comms(); // set up the USART - settings defined in usart.h
data=PORTC;
putch(data);
delay();
data=getch();
PORTD=data;
}