While we are talking about the clock...
Are you using the internal clock and if so is it trimmed?
David
Still confused, you are showing intialisation for UART 1 & 2 , surely we only need to worry about 1 SCI on each device?
Device A uses which one? and B?
Both initialisations only enable the transmitter and not the reciever!
to send data you usually monitor TDRE and to receive it, RDRF.
David
I also tried to use the following to wait for data :
while (SCI2S1_RDRF!=0) {
};
Again, the RDRF was never set to 1 so I didn't get out of the loop. Yes, you are right, if I hook up GB 'A' to the RS232 reader, it is tranmitting fine. Then I hook it to GB 'B', reversing TX/RX to read the UART and I can't seem to read it.
Yes, that is my problem. I initialized my UART with the following:
void UART1(void) {
// Setting is for 38400 baud
SCI1BDH = 0x00;
SCI1BDL = BAUD_38400;
SCI1C1 = 0x00;
SCI1C2 = 0x18;
SCI1C3 = 0x00;
}
void UART2(void) {
// Setting is for 38400 baud
SCI2BDH = 0x00;
SCI2BDL = BAUD_38400;
SCI2C1 = 0x00;
SCI2C2 = 0x18;
SCI2C3 = 0x00;
}
I want to poll for the input data. I guess I really need an example of waiting for the data to be received, then getting the data and clearing the registers.
Hi Bill,
I'm still a little confused as to what you are doing.
Presumably for analysis of the problem we can forget about the radios???
You have two GB's with their SCI ports connected together (crossed over). Yes?
If you tap into the serial connection you can see that "A" GB is sending the data correctly???
But it appears that "B" GB is not receiving this correctly. It just recieves -1's which presumably is FF???
Is this your problem?
Are you recieving the same amount of bytes that you send?
Have you tried different amount of bytes sent to confirm this?
If this is the case the problem would appear to be in your SCI recieve code.
Enough for now as I might be on the wrong track.
Regards David