Bluetooth interaction with mobile phone
Moderator: Benj
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: Bluetooth interaction with mobile phone
Hi Martin
The START Button must wake up the microchip from the SLEEP mode.
After a certian while of inactivity, the microchip will go in the SLEEP mode.
1) If the START button will not been touched, will there any Rx signal on the UART from the bluetooth?
2) If negative, will a Rx signal on UART wake up the microchip from the SLEEP mode ? (interrupt?)
Kind regards
Jan
The START Button must wake up the microchip from the SLEEP mode.
After a certian while of inactivity, the microchip will go in the SLEEP mode.
1) If the START button will not been touched, will there any Rx signal on the UART from the bluetooth?
2) If negative, will a Rx signal on UART wake up the microchip from the SLEEP mode ? (interrupt?)
Kind regards
Jan
-
- 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 interaction with mobile phone
How it works is when you press start an ASCII 's' is sent from the phone to the Bluetooth. The Bluetooth then sends ASCII s to the RX of the microcontroller. When ASCII s is detected by microcontroller it then sends the ADC value from TX into Bluetooth.etc.
If you want to wake the microcontroller up when pressing send then perhaps you can connect timer1 external input to RX?.
If you want to wake the microcontroller up when pressing send then perhaps you can connect timer1 external input to RX?.
Martin
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: Bluetooth interaction with mobile phone
Hi Martin
You told me to use the alternative app buider http://gold.appybuilder.com/ which works better for me. Thanks a lot.
I wanted to use 2 pages/screens with 2 languages (EN and NL). Please find attached an example.
Kind regards
Jan Lichtenbelt
You told me to use the alternative app buider http://gold.appybuilder.com/ which works better for me. Thanks a lot.
I wanted to use 2 pages/screens with 2 languages (EN and NL). Please find attached an example.
Kind regards
Jan Lichtenbelt
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: Bluetooth interaction with mobile phone
I made a small extension to the android aia and apk file:
Kind regards
Jan
PS. Martin it works fine now.
that means directly after the bluetooth has been connected a "s" character will be send to the microchip. Therefor I extended Martin's flowcode file UPF2.fcfx file into UPF_1847_V2.fcfx file with a while loop waiting for this "s"character. If it takes to long, one get a message, else the original program will be started. That means showing the ADC values if pushed on the "START" button of the cellular phone.Kind regards
Jan
PS. Martin it works fine now.
-
- 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 interaction with mobile phone
Hi Jan,
Glad it works as I could not see any issues with your flowchart.
Glad it works as I could not see any issues with your flowchart.
Martin
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: Bluetooth interaction with mobile phone
In the connections of a microchip to a cellular phone, there are two important issues:
1) Connection between the cellular phone and the Bluetooth unit. If not connected the red LED on the Bluetooth unit is flashing. If connected the red LED is continuously on.
2) the connection between the microchip and the Bluetooth unit. UART Rx and Tx is used. The proper working can be checked like shown in the previous posts.
Up to now, the tests have been performed with the 16LF1847 microchip.
But I wanted to use instead the microchip 16LF18857. But without success. What can be the reason? I really don't know.
Kind regards
Jan
1) Connection between the cellular phone and the Bluetooth unit. If not connected the red LED on the Bluetooth unit is flashing. If connected the red LED is continuously on.
2) the connection between the microchip and the Bluetooth unit. UART Rx and Tx is used. The proper working can be checked like shown in the previous posts.
Up to now, the tests have been performed with the 16LF1847 microchip.
But I wanted to use instead the microchip 16LF18857. But without success. What can be the reason? I really don't know.
Kind regards
Jan
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: Bluetooth interaction with mobile phone
I think I get a little bit older. I forgot to exchange the Rx and Tx pins of the microchip and the bluetooth unit. Now it works fine.
Kind regards
Jan
Kind regards
Jan
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: Bluetooth interaction with mobile phone
Hi Martin,
I changed the exchange of information between the microchip and the phone. Now in principal, only data (strings) will be send from the microchip to the phone. But what I see on the phone is that strings are combined together. E.g. I send 100 and sometime later 110. That will be shown on the phone as "100 110". I far as I know the phone clock has been set to 10 (msec), so I changed the time between sending strings from 50 to 250 msec. But I still get something like "240 250" on the phone.
I even made the receiving string on the phone first " ", before reading the bluetooth string.
How can I improve this?
Kind regards
Jan
I changed the exchange of information between the microchip and the phone. Now in principal, only data (strings) will be send from the microchip to the phone. But what I see on the phone is that strings are combined together. E.g. I send 100 and sometime later 110. That will be shown on the phone as "100 110". I far as I know the phone clock has been set to 10 (msec), so I changed the time between sending strings from 50 to 250 msec. But I still get something like "240 250" on the phone.
I even made the receiving string on the phone first " ", before reading the bluetooth string.
How can I improve this?
Kind regards
Jan
-
- 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 interaction with mobile phone
Hi Jan,
Sorry been on a course so have a bit less time than normal.
Hopefully will get a chance this evening to check it out.
Sorry been on a course so have a bit less time than normal.
Hopefully will get a chance this evening to check it out.
Martin
-
- 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 interaction with mobile phone
Hi Jan,
Had a quick look and the rapid chars is confusing it.
Does not know when the last char has been sent or the first char of the next set.
My advice would be to send an invisible end char e.g a Space.
Then when the APP sees a space it knows that the next set is being sent.
It was not set up like this originally as the spec was to display on a press of a button.
I will give it a go when I get a chance.
You could also give it a try.
Had a quick look and the rapid chars is confusing it.
Does not know when the last char has been sent or the first char of the next set.
My advice would be to send an invisible end char e.g a Space.
Then when the APP sees a space it knows that the next set is being sent.
It was not set up like this originally as the spec was to display on a press of a button.
I will give it a go when I get a chance.
You could also give it a try.
Martin
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact: