Estou tentando fazer a comunicação entre 2 PIC's (18F4550) pela UART1. O pic escravo reconhece que foi enviado 1 Byte, porém seu valor é sempre 0xFF. Alguém já teve algum problema semelhante?
// Recebe Byte - Escravo
void main() {
PortE.f0 = 1; //led
UART1_Init(9600); // Inicializa - 9600 bps
Delay_ms(100);
//
while(1){
if(UART1_Data_Ready()){
byte_read = UART1_Read();
PortE.f0 = 0;//sinaliza byte recebido!!
ByteToStr(Byte_read, txt);
Lcd_Out(2, 10, txt);
Delay_ms(400);}
PortE.f0 = 1;
}//while
//
} //
//** Fim **
//Envia Byte - Mestre
void main() {
//
UART1_Init(9600); // Inicializa - 9600 bps
Delay_ms(100);
//
while(1){
while(!PortC.f0){
if(UART1_Tx_Idle() == 1){
UART1_Write('$');
Delay_ms(50);}
}
while(!PortC.f1){
if(UART1_Tx_Idle() == 1){
UART1_Write('1');
Delay_ms(50);}
}
while(!PortC.f2){
if(UART1_Tx_Idle() == 1){
UART1_Write('2');
Delay_ms(50);}
}
}
//
}
//** Fim **
Agradeço qualquer ajuda.
