This is one of those questions that is hard (at least for me) to research simply due to phrasing the question correctly. This is also more of a USART/UART question, rather than strictly RF.
I am working on a project for school that uses, among a multitude of other modules, an RN-42 Bluetooth module and an ATmega328. I am currently trying to send a string from the Android to the AVR system, however I can only receive about 3 bytes before the transmission seems to die. So, far me and one of my teammates have narrowed down the possibilities to one main theme, the Android/Bluetooth combo is trying to give the information to the microcontroller much too quickly.
Right now, the PCB I designed has RTS and CTS tied together and it works just fine for BlueTerm in the Android to send bytes, one by one, to the ATmega, and for sending strings from the ATmega to the Android device. However, when I attempt to receive information from an app that has pre-built strings, only the first three bytes appear. From the android app to a computer, the output is read just fine. I think handshaking is where the problem lies, but I really don’t want to have to implement a fix for CTS and RTS since the end of the semester is coming up pretty quickly. My hope is that I might be doing something wrong within my code to receive a string from the module.
Here is my interrupt-driven receive code (the print function is a self-baked output to bluetooth).
ISR(USART_RX_vect)
{
/* Wait for data to be received */
/* Get and return received data from buffer
uint8_t i = 0;
unsigned char received = 0;
while ( !(UCSR0A & (1<<RXC0)) );
received = UDR0;
while(received != ';')
{
if( received != 10)
{
command[i] = received;
i++;
while ( !(UCSR0A & (1<<RXC0)) );
received = UDR0;
}
}
command[i] = '\0';
print(command);
}