I'm making an application that communicates to the world wirelessly over a UART. specifically, I'm using the HM-TRP module with an AT89C4051 micro with a 22Mhz clock and an LCD.
I'm trying to run the module at 38Kbps and have the results show in 16-byte fragments on an LCD. I tested the modules in other setups and they work correctly, but when I'm trying to record real-time data and display it on the LCD, I run into trouble.
The best case I had was using a fixed (non-ring) buffer for both transmission and reception, but that caused loss of characters (particularly when printing characters on the LCD). I tried storing a character in the buffer until the buffer has 16 received characters then I disable the reception until I spit them all out on the LCD and start the buffer all over again and re-enable reception.
I feel that between the buffering, I'm losing characters because what happens in between is that I print the characters to the LCD all at once. This means roughly 57uS per LCD write times 16 = ~900uS. Each byte at 38Kbps takes around 200uS So every now and then I lose a character.
I was thinking of lowering my buffer size but is that a good idea? I want to avoid lowering the baud rate.
I'm trying to run the module at 38Kbps and have the results show in 16-byte fragments on an LCD. I tested the modules in other setups and they work correctly, but when I'm trying to record real-time data and display it on the LCD, I run into trouble.
The best case I had was using a fixed (non-ring) buffer for both transmission and reception, but that caused loss of characters (particularly when printing characters on the LCD). I tried storing a character in the buffer until the buffer has 16 received characters then I disable the reception until I spit them all out on the LCD and start the buffer all over again and re-enable reception.
I feel that between the buffering, I'm losing characters because what happens in between is that I print the characters to the LCD all at once. This means roughly 57uS per LCD write times 16 = ~900uS. Each byte at 38Kbps takes around 200uS So every now and then I lose a character.
I was thinking of lowering my buffer size but is that a good idea? I want to avoid lowering the baud rate.