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?
slow Bluetooth
Moderator: Benj
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 4
- Joined: Mon Mar 21, 2016 8:04 am
Re: slow Bluetooth
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?
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?
- 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
Hello,
Please can you post your program and I will see if I can make it run faster for you.
Please can you post your program and I will see if I can make it run faster for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 4
- Joined: Mon Mar 21, 2016 8:04 am
-
- Posts: 4
- Joined: Mon Mar 21, 2016 8:04 am
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: slow Bluetooth
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"?