Using a smartphone as a picaxe display

julianE

Senior Member
I have been using the bluetooth display on my mobile devices for a while now and it works well. Have had a niggling issue, it's trivial but I thought I'd ask after seen this old thread.

Have had the issue on multiple chips, I encountered it last on a battery charging circuit, thinking it might be due to using a very old 20M chip i tried it on an 08M2 and same issue came up.

here is the test program on 08M2

#picaxe 08M2
setfreq M8
pause 14000 'allow time for pairing

main:
for b1=1 to 5
Serout C.0,T9600_8,("Batt Voltage ", #b1,CR, LF)
pause 1000
next b1
pause 10000
goto main


and here is the output from hyperterminal,

Øtt Voltage 1
Batt Voltage 2
Batt Voltage 3
Batt Voltage 4
Batt Voltage 5
Batt Voltage 1
Batt Voltage 2
Batt Voltage 3
Batt Voltage 4
Batt Voltage 5
Batt Voltage 1
Batt Voltage 2
Batt Voltage 3
Batt Voltage 4
Batt Voltage 5

notice the first line,

Øtt Voltage 1


it should read Batt Voltage 1 but for some reason it mangles the first two characters.

I have tried sending a blank line in advance but it still gets mangled. In the case of the attached program after the initial garbling it runs clean.
I tried it on my windows phone and on an android device and the issue is consistent across devices.

I have not tried it with hserout yet, will give that a try eventually.

any ideas?

thanks in advance.
 

hippy

Ex-Staff (retired)
You need to take the pin high and pause before using a Txxxx baud rate. It's the change from the pin being idle low / active high to idle high / active low when the first character is sent with a Txxxx baud rate which causes the corruption.

From "Manual 2 Basic Commands" under the SEROUT command ...

"A 'T' baud rate idles high, with data pulses going low. When using a T baud rate the very first byte may become corrupt if the output pin was low before the serout command (the pin will be automatically left high after the serout command). To avoid this issue place the line high (via a 'high' command) a few milliseconds before the very first serout command."
 
Last edited:

julianE

Senior Member
Thank you Hippy, I do remember reading that in the manual but my memory is not what it used to be.

All is working now, this forum is the best!!!
 

geezer88

Senior Member
This thread is 10 years old from it's start, and 8 years from last post. But with 2G and 3G cell service coming to an end, I would think there will be a bunch of smart phones being taken from service.

So, that makes me wonder if there have been any new developments in Android VT-100 emulation, and connections to a picaxe?

tom
 

inglewoodpete

Senior Member
I have successfully used Kewlsoft's "Bluetooth Electronics v1.3" Android App to communicate with a microcontroller. While I didn't use a PICAXE, the app uses 9600 baud, so is do-able with a PICAXE, although possibly best using background serial in an X2 version. https://www.keuwl.com/apps/bluetoothelectronics/

The implementation is a very clever implementation of a BT interface. Aside from the usual terminal emulator, it app has a wide range of switches, gauges and charts that can be used quite simply. The clever part is that you only have to load the App into the Android Smartphone - the screen layout with controls etc is coded into the (PICAXE) microcontroller and transmitted via an HC-06 Bluetooth module. The microcontroller periodically transmitts the screen layout in ASCII. When the smartphone app connects to the HC05, it receives the screen layout and draws the screen. The app can send instructions to the microcontroller and receive screen updates.

The attached image is a screen shot from a BT project (in edit mode) that I developed in 2019 for a sports ground. The sportsground had an LED lighting artwork that had a number of themes. The team colours for the two teams could be configured into the lighting display, using the app. The user would only see the panel on the top left (witout the alignment dots). It gives a very 'professional' appearance.

25339
 

geezer88

Senior Member
Wow, thanks for the reply! Lots of neat stuff to learn about. Now I know how I will be spending my evenings for awhile.

tom
 
Top