Hi,
I am using SPP to transmit a large file over Bluetooth from a mobile app to MSP430F5438A (the file is written on an SD card in chunks as data packets are received). BT UART is running at the maximum possible baud rate of 921600 bps (~115.2 kB/s). Due to RAM constraints, the frame (and RX buffer) size is fixed at 800 bytes. As I receive one data packet, I write that data on to the file on SD card, and then send an acknowledgement byte to the mobile app to send the next chunk of data. This way, I am able to send a file of size 600 kB. However, the time it takes to accomplish that is around ~40 seconds, which seems a lot high for a baudrate of 115.2 kB/s, even after considering overhead of acknowledgement bytes. The system clock as well as SPI clock is 20 MHz
Now if I look into the variable SchedulerInformation[0] in debug mode, I see there is a non-null value for SchedulerInformation[0].SchedulerFunction with SchedulerInformation[0].ScheduleExpireCount = 50. My understanding is that there is a function added to the scheduler by default with schedule period of 50 ms (I did not add any function to the scheduler), and this is the function that is being used for polling the RX buffer. This hypothesis also conforms to the math:
Number of data packets = 600*1024 bytes / 800 bytes = 768,
Time to receive those packets = 768 * 0.050 s = 38.4 s (~ 40 s)
Here are my questions:
1. Is my understanding correct? If yes, is it possible to reduce the schedule period of the default function polling RX buffer during data transfer to get faster data rates? Or perhaps have something similar to interrupts for data RX.
2. If my understanding is not correct, why is the data rate so low compared to the actual baud rate, and what are ways to obtain faster data RX/TX?
Thanks.
Ankur Agrawal