slow Bluetooth

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
ammaralroz
Posts: 4
Joined: Mon Mar 21, 2016 8:04 am

slow Bluetooth

Post by ammaralroz »

Dear All
I have Bluetooth module connected to PIC16f628A with internal clock 4Mhz using flow code (demo)
when I send command 'a' to turn the led on; it takes 7 seconds
and off also takes 7 seconds
even I write a short program as you can see below . it works really fast on "Flowcode simulation". but on the real microcontroller it is slow
anyone know why?


flowcode.png
(25.22 KiB) Downloaded 1320 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: slow Bluetooth

Post by Benj »

Hello,

The string receive function waits for "\n\r" or "\r\n" carriage return and line feed otherwise it has a timeout feature. My guess is that it is the timeout that is causing the long delay.

You could instead use the Read_Byte function and this will return the value 255 if there is no data or it will return the data byte directly without waiting.

ammaralroz
Posts: 4
Joined: Mon Mar 21, 2016 8:04 am

Re: slow Bluetooth

Post by ammaralroz »

Thank you Benj for your fast response
yes I did my test and discover that the slow comes from "StringReceive" function
i tried "\n\r" or "\r\n" but it didn't work
any ideas?
flowcode.png
(58.99 KiB) Downloaded 1296 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: slow Bluetooth

Post by Benj »

Hello,

Please can you post your program and I will see if I can make it run faster for you.

ammaralroz
Posts: 4
Joined: Mon Mar 21, 2016 8:04 am

Re: slow Bluetooth

Post by ammaralroz »

Hi
In attached as requested
Thank you
Ex1_v6.fcfx
(9.12 KiB) Downloaded 279 times

ammaralroz
Posts: 4
Joined: Mon Mar 21, 2016 8:04 am

Re: slow Bluetooth

Post by ammaralroz »

Dear All.
Still no one have any solution?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: slow Bluetooth

Post by Benj »

Hello,

I have replaced the Bluetooth component with the RS232 component which provides you some better functions for low level communications.

Have a go with this and it should be much better.
Ex1_v6_mod.fcfx
(7.62 KiB) Downloaded 340 times

paridhi
Posts: 16
Joined: Tue Mar 29, 2016 6:16 pm
Has thanked: 7 times

Re: slow Bluetooth

Post by paridhi »

I am making a program to send text messages from my mobile through bluetooth Hc 05 to control operations by ECIO 40P. Though I was able to send strings to and fro, the speed is really slow. It takes 6-7 secs to go though. Can you suggest a way to make it faster without using RS232? Is there an internal delay in the macro of "send command"?

Post Reply