bluetooth eblock connection

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

bluetooth eblock connection

Post by stephenmccarthy »

Hi all,
I have bought a bluetooth eblock eb024-00-2, and i compiled the example one program from the easy bluetooth bundle to my multiprogrammer board. The only difference is that I am using an 18f448 rather then the suggested 16f877a. the problem i am having is that my computer will not detect the ezurio bluetooth. i'm happy that i have everything connected properly, does anyone have any sugestions to what the problem could be?
Thanks,
Stephen

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: bluetooth eblock connection

Post by Benj »

Hello Stephen,

Have you tried a 1 second flasher program to test if your clock settings and configuration settings are correct for your hardware. If these are not correct then the baud rate for the bluetooth module will be off meaning communications are not working.

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi Ben,
Thanks for your reply, no I have not tried this?
Could you tell me how to please?

Thanks
Stephen

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: bluetooth eblock connection

Post by Benj »

Hi Stephen,

You need to create a loop in your program that will run forever. Inside the loop output 1 to an output pin connected to an LED, delay for a second, output a 0 to the LED, delay for a second.

If the delays on the hardware are 1 second then you know you have your Flowcode clock speed and configuration settings correct. If not then ensure your settings match that of your hardware.

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Thanks again for fast reply,
I'm just leaving college now for work so i will try this tonight and reply with results.
Thanks again
Stephen

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Sorry Ben, it just occured to me that I might not have access to led's again untill the college reopens on monday morning, is there anything else I can do incase of this.
Thanks
Stephen

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi Ben,
I just tried what you suggested, ofcoarse on flowcode the program works perfect when i programmed the chip i touched the anode of an led to the matching flowcode pin and another to the ground. the result was nothing. the led did not blink, but when i toucht its anode with pin 32 vdd it emmitted light. So i will take this as meaning my software and hardware configuration are not matching. can you tell me please how to match them? and sorry for inconvienience im fairly new to flowcode.
Thanks
Stephen

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: bluetooth eblock connection

Post by medelec35 »

Hi Stephen,
I have changed the bluetooth test flowchart from 16f877a to 18f448.
Give that a try.
Attachments
BLUETOOTH_TEST-fc4.FCF
(11 KiB) Downloaded 375 times
Martin

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi medelec35,
Thanks for your reply, i tried your code and it worked. My computer can now discover the eb024 and i have paired it. I have gotten as far as using the hyperterminal but i cannot establish a connection with the bluetooth. Where COM25 is used in the example I am using COM 18, and when i try to make the connection. The LED eblock show that it is trying to ring, but hyperterminal will then display the error "unable to open COM18" and the LED eblock will then display "no carrier", I know this is not flowcode but might ye have any suggestions to troubleshoot this?
Thanks
Stephen

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: bluetooth eblock connection

Post by medelec35 »

Not sure if this will work, as I have not got the bluetooth Eblock myself.
What about changing Com port from 18 to 25 using device manager, Right click on the bulethooth com settings, spelect properties, port settings, then advance.
If that don't work then you may need to wait for a member of matrix staff to help.
Martin

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Thanks again for reply,
I actually solved the problem last night and moved on to example2 code, changed the configuration as you had in example1 code that you posted to me. and..... suddenly i am getting this error again, hoping to get it solved by the end of the night. If not hopefully as you said matrix staff can help me. My overall purpose for doing this is a project, ive designed a sensor to detect a human pulse, a flowcode program to store, update and calculate the bpm and send this to the lcd, all this works. The final part of this projects is to send the information via bluetooth to my laptop and display the updated value from the lcd on the hyperterminal. I dont want to be annoying people with silly questions but I this iss my first time using, flowcode, eblocks and even hyperterminal and I am very eager to get this up and going.
Thanks
Stephen

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: bluetooth eblock connection

Post by medelec35 »

We all have to start somewhere.
If your stuck, then ask the questions...no matter how many you need to ask, no one thinks of them as silly (those that do have forgotten what it was like when they first started :P ). :lol:
If post the 2nd flowchart you modified, I may be able to tell you where the error is.
That way you will be able to correct it, and will know for future reference.
Martin

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: bluetooth eblock connection

Post by Benj »

Hello Stephen,

Have you seen this article I wrote on using the Bluetooth as a wireless serial connection. Hopefully it should explain how to get up and running.

http://www.matrixmultimedia.com/mmforum ... =26&t=7734

Let us know how your getting on and if you run into any problems.

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Thanks for all the replies lads, its good to know there is people out there happy to help. Thanks for that comment medelec35 it makes me feel better about asking questions. I just uploaded the code from exercise2 with my own configuration. I just had a quick read of it now Ben i will read it properly tonight when I am home from work, thanks again for another reply. If i can get the rs232 connecting to the hyper terminal and sending data with the Bluetooth I think I will be fairly set and able to make another jump in progress again, but at the moment it will not make a connection to my COM port with the example 2 program. Very frustrating but I appreciate every one taking time to reply and help me.
Thanks
Stephen
Attachments
Ex2.fcf
(7 KiB) Downloaded 241 times

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi Ben,
I am still having trouble with example2, as far as i can tell i've configured the example correct to suit the 18f448, at no point after the code is compiled to the chip will the lcd display something. When i try to make a connection, at no point am I aked for a pairing key and the connection fails, I am told to check com18's setting, these seem correct although i am not allowed enter the advanced settings. Might you have any idea what the issue is hear?
Thanks
Stephen

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: bluetooth eblock connection

Post by Benj »

Hello Stephen,

Have you tried example 1 first? Example 1 sets up the Bluetooth module and stores the settings into the bluetooth module's firmware.

Example 2 then goes off the setting from the firmware so if these are not already correct then your program isn't going to work.

This manual should detail everything you need to do to get up and running.
http://www.matrixmultimedia.com/Learnin ... -1_Web.pdf

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi ben,
Yes I done the example 1 program, i try to connect and i am asked for a pairing key, once connected i can enter text to hyperterminal that will show on the lcd. However it does not rspond to commands, AT does not return OK for example.
I've actually been working off the link you just posted.
Is there any other way i can check for correct settings.4Thanks
Stephen

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi Ben,
I uninstalled and reinstalled the ezuruio bluetooth device, this changed my COM port to port 7 and the hyper terminal did not ask me for a pairing key this time when i connected example one code, also the LED on board the bluetooth module lit up.
Again I disconnected from hyper terminal, opened example code 2 and changed the target and config to suit the 18F448. Then blew this to the chip.... and again when i try and connect after this code is loaded, i get told to check my port settings.
Sorry for bothering you again with this problem, but do you have any idea where I am going wrong, following the bluetooth bundle document the correct setting should be saved to the firmware when I've installed the ezurio device. But as soon as I start using rs232 macro in the examples, its a no go.

Thanks
Stephen

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: bluetooth eblock connection

Post by Benj »

Hello Stephen,

In your modified version of example 2 have you also updated your clock speed setting to match your hardware? It might also be worth going into the properties of the RS232 component just in case the baud rate has not been updated in the mean time.

Funny thing is that the baud rate should not be effecting you being able to connect in hyperterminal. I wonder if there is a problem with the non-volatile memory on your Bluetooth module where the data is not being saved correctly.

To test this I have added the bluetooth initialisation to the start of the example 2 program. The RS232 component macro calls should still work to allow you to communicate.

Let me know how you get on with this.
Attachments
Ex2.fcf
(8 KiB) Downloaded 270 times

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi Ben,

Yes the baud rate on the rs232 seems to be correct, also the clock speed 19660800hz seems to match the hardware, or I am assuming it does as my other flowcode programs during the year have worked with this clock speed.

I think you may be correct about volatile memory on the bluetooth device, the updated example 2 code you sent me now allows me to connect to hyperterminal, i adjust the "echo typed character locally"in hyper term so i can see what I am typing, it will apear on hyperterminal but not on the LCD display.

I am wondering should the cts and the rts on the bluetooth and rs2323 macro's be set to the same value '5' and '4' ?

Again I appreciate the time your taken to help me.
Thanks,
Stephen

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi ben,
I've been looking at the code and hyperterminal since I came home from work, now it lets me connect exercise2 and lets me alter configuration on the COM port before i connect which it didnt do before, taking this as a positive I went ahead and removed the bluetooth macros in the link you sent me in you last post, blew to the chip and once again I cant connect. If you are correct about the volitile memory, I'm wondering do you think it is possible to do the following, attached is a code i've made to read in a value over 150 counts and calculate the BPM from this, with a button pressed while the count is taken place acting as a pulse. This updated value is then displayed on the LCD.

My plan was to use the rs232 macro via bluetooth to send what is displayed on the LCD to the hyperterminal as in the examples, and update it so the heart rate could be monitored on my laptop accross a room. As the bluetooth is causing such a problem, do you think it is possible to use the bluetooth macro to send commands that will do this without the rs232.

I am not atall familiar with hyperterminal, bluetooth or AT commands untill last friday which is why I ask, what might seem like dumb question.

Thanks again for your time
Stephen
Attachments
smc_FYP_18F488.fcf
(11.5 KiB) Downloaded 226 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: bluetooth eblock connection

Post by Benj »

Hello,

The bluetooth component is capable of sending and receiving data but is not quite as simple to use as the bluetooth component. Simply because you cannot directly read back strings etc. The first program uses the bluetooth receive function but does not send out any data.

To send data you call the CreateCommand macro and pass a byte at a time. You can send multiple bytes at once by passing several bytes to the function.

Then when you are ready to send you call the SendCommand function which allows you to specify if you expect an immediate echo and if you want to append a carriage return to the end of the transmission.

stephenmccarthy
Flowcode V4 User
Posts: 36
Joined: Tue Mar 01, 2011 7:51 am
Has thanked: 7 times
Been thanked: 1 time
Contact:

Re: bluetooth eblock connection

Post by stephenmccarthy »

Hi Ben,
Thanks for the fast reply,
I'm going to try make some progress today and implement the bluetooth macro into my flowcode, I have one question about the macro, do i have to set what port I am going to use it on? and if so how? as in the examples it is used on port C although i cant see where this is set, and in my project I am allready using port C for the LCD. So i will try use the bluetooth device on port A or D.

Thanks,
Stephen

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: bluetooth eblock connection

Post by Benj »

Hello Stephen,

The Bluetooth port is dictated by the location of the hardware UART on your device. The hardware UART is denoted on the chip diagram as RX and TX - normally pins RC6 and RC7.

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: bluetooth eblock connection

Post by DavidA »

Hi Steven,

I think the support has gone on to more Flowcode project related matters, would it be possible for you to start a new topic in the Flowcode V4 forums, or if you want I can move this in there for you.

If you have not got access to the V4 forums, then this is a very simple procedure and a step by step guide is available on our FAQ site, located here:

http://www.matrixmultimedia.com/support ... f=29&t=602

When your account has been upgraded and if you would like me to move the topic, just post here or PM me. Thanks.

Post Reply