unsigned char PortVal;
void main(void){
//RX micro
TRISC.F6 = 0; //Tx output pin
TRISC.F7 = 1; //Rx input pin
PORTB = 0;
TRISB = 0;
USART_Init(9600); //Initialize USART module at 9600bps
do{
if (USART_Data_Ready()){
PortVal = USART_Read(); //Read value through UART
PORTB = PortVal;
}
}while(1);
}
unsigned char PortVal;
void main(void){
//TX micro
ADCON1 = 7; //Disable comparators
TRISA = 0x3F; //inputs
TRISC.F6 = 0; //TX output pin
TRISC.F7 = 1; //RX input pin
USART_Init(9600); //Initialize USART module at 9600bps
do{
PortVal = PORTA; //Read value off PORTA
USART_Write(PortVal); //Send PORTA value through USART to Rx micro
delay_ms(200); //Wait 200ms before sending next value
}while(1);
}
CMCON = 7;
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?