I've tried this with no result... I'm using two PIC18F452 with 10MHZ crystals. Powerup timer is on and WDT is off...
Code: Select all
//this is the sending pic
unsigned short send;
main()
{
ADCON1 = 0x80;
TRISA = 0xff; //input
Usart_Init(9600);
do {
send = Adc_Read(0);
Usart_Write(send);
} while (1);
}
Code: Select all
//this is the recieving pic
unsigned short recieve;
main()
{
TRISB = 0x0; //output
Usart_Init(9600);
do {
if (Usart_Data_Ready()) { // If data is received
recieve = Usart_Read(); // Read the received data
if (recieve > 10) PORTB = 0xff; // PORTB = 1
}
} while (1);
}
/Peter