Bluetooth Bulk Data Transfer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KaBh_4706866
Level 1
Level 1
First like given

Hello,

I have a device with PSoC 5LP interfaced with a microSD Card and a Bluetooth module. I am using a Class10 microSD Card and Microchip RN4871 Bluetooth (BLE) module. The UART Communication baud rate between the Bluetooth module and PSoC is set to 230,400 bps.

I am trying to send a relatively big file from this device to other devices like for instance, my phone, over Bluetooth. But on receiving, I find that a lot of data is lost.

The file is a binary data file of around 60kBytes. I tried to replace it with a similar-sized text file and found similar results of data being missed. I have also tried to give a delay of 2ms to 10ms between every 100 bytes of data, but no improvements.

But when I send 200bytes hardcoded data, I don't see it being lost. To view the data being received on my phone, I've been using this app - Serial Bluetooth Terminal

Any suggestions to fix this? Let me know if you need any other information.

0 Likes
2 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

KaBh,

I'm familiar with the PSoC5LP but not with your Microchip BLE device. I'll try to make some guesses as best I can.

I have looked at the Microchip link you provided.  It is the datasheet for the BLE device.

Assumptions:

  • You are using the available UART comm on the RN4871.
  • You are NOT using the RN4871 pin P0_0 as UART_CTS.

A few items should be noted:

  • The maximum UART data rate is 10Kbps.   Therefore the maximum Byte rate is 1KBps (10Kbps, 8N1). 
    pastedImage_6.png
    Make sure the baud rate on the RN4871 (however that is accomplished) matches the PSoC5LP baud rate to less than +/- 4%.
    Here's the baud rate chart provided in the datasheet.
    pastedImage_5.png

  • I recommend that you connect the RN4871 pin P0_0 output as an input to a PSoC5LP GPIO pin.  This pin on the RN4871 is UART_CTS by reset default.   It is possible that you might be blindly sending data from the PSoC5LP Tx port without flow control.   The UART_CTS pin is intended to signal from the RN4871 that its UART Rx buffer is full.  When full, stop transmitting from the host (PSoC5LP) side.

pastedImage_2.png

I recommend before you make any changes to the wiring of your system, put a scope probe on the P0_0 and watch what is does when you are trying to send 200 bytes of data.

Len

PS:  To get more expert eyes on this post, you might want to move this discussion to the PSoC5 discussion forum.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Len,

Thanks for your suggestions!

Yes, I have not been using the UART_CTS - without the flow control. I will have a look into this as you mentioned.

Will keep you posted further.

Thanks once again!

0 Likes