Share My Creation Android Tablet GUI example to AVR Embedded System via Bluetooth

This is a screen shot of my B4A application. It serves as the graphical interface for an automotive ignition controller using an AVR ATmega128. I developed the controller years ago, and used RS232 with VB6. The communications is done using Bluetooth at 115,200 baud. I used a few examples to get started, and wrote other parts. I appreciate the ease of use of B4A. I am finally saying goodbye to VB6.

A 6.5 minute video presentation may be found on YouTube.

Android GUI for Electronic Ignition System via Bluetooth - YouTube
 

Attachments

  • Screenshot_2013-03-18-12-49-49.png
    Screenshot_2013-03-18-12-49-49.png
    79.2 KB · Views: 4,259
Last edited:

KitCarlson

Active Member
Licensed User
Longtime User
NJDude,
Sorry about your neck. I am new to all this, I tried to rotate with the Windows Movie Maker and all went black. I made a landscape screen for the app last night, might try to post that sometime. Sure wish there was a way to capture screen video on tablet.

Thanks all for the comments. I answer questions too.

My next work will be on a boot loader, then on to 3D tables and more complexity for fuel injection. I have all that on VB6 rs232 application.
 

walterf25

Expert
Licensed User
Longtime User
Bluetooth

Very nice, :icon_clap::icon_clap::icon_clap::icon_clap:
Are you using the ELM327 bluetooth Module with this, i started working on a similar projects last year, but as many of my other projects I start i never finish. :D
What language did you use to program the µController, I started using Bascom AVR which turned out to be a great program just like B4A but for embedded systems.
I'd like to know more about the protocol you used to communicate between the Bluetooth module and the AVR, i'm currently working on a project which involves a bluetooth module but am having issues with the communication part, I'd like to implement the prefix mode but don't really understand how to use it.
Anyhow again great work on this, excellent!

Walter
 

spcw1234

Member
Licensed User
Longtime User
Very nice, :icon_clap::icon_clap::icon_clap::icon_clap:
Are you using the ELM327 bluetooth Module with this, i started working on a similar projects last year, but as many of my other projects I start i never finish. :D
What language did you use to program the µController, I started using Bascom AVR which turned out to be a great program just like B4A but for embedded systems.
I'd like to know more about the protocol you used to communicate between the Bluetooth module and the AVR, i'm currently working on a project which involves a bluetooth module but am having issues with the communication part, I'd like to implement the prefix mode but don't really understand how to use it.
Anyhow again great work on this, excellent!

Walter

I too am very interested in this. I am currently playing with this using the same method as Walter, but it seems to miss data pretty often, and doesn't like to be run very fast. I can't get the prefix stuff to work AT ALL :(
 

KitCarlson

Active Member
Licensed User
Longtime User
I developed my own engine controller using an ATmega128 in 2003. I added a KCwirefree KC21 Bluetooth module to go wireless. Prior to that I interfaced via rs232 with a VB6 application. In car action is very hard on note book hinges. The tablet is what will work. I did use Palm m105 with terminal emulator but very slow.

I wrote the mega128 code using CodeVisionAVR. It is a C compiler that is easy to use. Just a few days ago I changed a few string defines to migrate from the VB6 version to the Android method, I came up with. It worked quickly with minimal debug. It is a simple protocol with start and end, the first character after the start is the type. The type is used by the command processor called from newdata. The type, controls how received data is handled. When I developed on the android, I emulated the AVR using a PC and VB6. It took less than an hour to make a simple program using forms to show data registers and display send and receive strings with MSCOMM and BT module on USB port. The result much more visual, than an AVR without LCD.

I have worked with serial communications for years, so I know that. Think of newdata as a receive isr, however the byte array converted to string needs to be parsed. By that, look for start and end. It is necessary to consider that, the end did not arrive yet, so the keep what was received in global variable, and add in next receive. When the end is received then process packet, remove from buffer, keep the rest. It may also be necessary to consider if two packets arrive in a single newdata. For me the communications has been very reliable. No prefix mode used.

I hope this helps.
 
Last edited:
Top