- Thu Nov 30, 2006 7:54 pm
#22809
Hey guys,
I am having a lot of trouble getting my RF-KLP-315 modules to work correctly. It's driving me nuts and I need help! I have searched the forum high and low and it seems that a lot of people are having this problem but no one seems to have a fix. What I have is 2 pics setup as a transmitter and receiver. Basically it seems that if I hard wire my pic's together everything is fine but if I replace the wire with the wireless modules I get nothing. I am using the receiver pic as a relay; once it receives data it will forward it back to the serial output and into my PC's serial port for debugging.
Here is my transmitter code:
void main( void )
{
// configure USART for a 48MHz fosc
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,
2499
);
baudUSART( BAUD_IDLE_CLK_HIGH &
BAUD_16_BIT_RATE &
BAUD_WAKEUP_OFF &
BAUD_AUTO_OFF
);
TRISAbits.TRISA0 = 0;
while(1) {
while(BusyUSART());
putcUSART('h');
Delay10KTCYx(250);
};
CloseUSART();
}
and here is my receiver/relay code:
void main(void) {
// configure USART for 48MHz fosc
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,
2499
);
baudUSART( BAUD_IDLE_CLK_HIGH &
BAUD_16_BIT_RATE &
BAUD_WAKEUP_OFF &
BAUD_AUTO_OFF
);
TRISAbits.TRISA0 = 0;
while(1) {
unsigned char c;
if (DataRdyUSART()) // check USART read buffer
{
c = getcUSART(); // read character
putcUSART(c); // echo it back
while (BusyUSART()); // wait until complete
Delay1KTCYx(4); // wait some more
}
};
CloseUSART();
}
Does anyone have any ideas of what I am doing wrong?
I am having a lot of trouble getting my RF-KLP-315 modules to work correctly. It's driving me nuts and I need help! I have searched the forum high and low and it seems that a lot of people are having this problem but no one seems to have a fix. What I have is 2 pics setup as a transmitter and receiver. Basically it seems that if I hard wire my pic's together everything is fine but if I replace the wire with the wireless modules I get nothing. I am using the receiver pic as a relay; once it receives data it will forward it back to the serial output and into my PC's serial port for debugging.
Here is my transmitter code:
void main( void )
{
// configure USART for a 48MHz fosc
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,
2499
);
baudUSART( BAUD_IDLE_CLK_HIGH &
BAUD_16_BIT_RATE &
BAUD_WAKEUP_OFF &
BAUD_AUTO_OFF
);
TRISAbits.TRISA0 = 0;
while(1) {
while(BusyUSART());
putcUSART('h');
Delay10KTCYx(250);
};
CloseUSART();
}
and here is my receiver/relay code:
void main(void) {
// configure USART for 48MHz fosc
OpenUSART( USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &
USART_BRGH_LOW,
2499
);
baudUSART( BAUD_IDLE_CLK_HIGH &
BAUD_16_BIT_RATE &
BAUD_WAKEUP_OFF &
BAUD_AUTO_OFF
);
TRISAbits.TRISA0 = 0;
while(1) {
unsigned char c;
if (DataRdyUSART()) // check USART read buffer
{
c = getcUSART(); // read character
putcUSART(c); // echo it back
while (BusyUSART()); // wait until complete
Delay1KTCYx(4); // wait some more
}
};
CloseUSART();
}
Does anyone have any ideas of what I am doing wrong?