• Hello Guest, welcome to the initial stages of our new platform!
    You can find some additional information about where we are in the process of migrating the board and setting up our new software here

    Thank you for being a part of our community!

Working on an iOS to MS Tuning/Logging App

BabyBlue240

New member
Joined
Jun 14, 2005
Location
Mountain View, CA
Howdy,

I thought I'd post to let everyone know of an iOS app/hardware solution I've been working on for logging AND tuning Megasquirt using an iPad 3, iPhone 4S, or iPhone 5. I totally get the, "Why? a $50 notebook works fine" argument, but I'm a geek and I think it's cool. The app is unreleased, but it's going to be called blueTune, and it leverages the above listed devices' Bluetooth Low Energy (BLE) support. Long story short, BLE is a totally different bluetooth protocol (not backwards compatible) that is very cool for iOS developers because it's the first time we've been able to make external devices that talk to iOS devices without having to pay globs of money (~$30k) to Apple in order to get the special permissions to use the "normal" bluetooth capabilities that have always been in iOS devices. Here's a demo of my progress:

<object width="853" height="480"><param name="movie" value="http://www.youtube.com/v/IwNZK93HS9M?version=3&hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IwNZK93HS9M?version=3&hl=en_US" type="application/x-shockwave-flash" width="853" height="480" allowscriptaccess="always" allowfullscreen="true"></embed></object>

If you'd be interested, let me know. I'm trying to get some buzz going so I can get a first run of the hardware going.
 
That's ****ing awesome. Great job! I would love to hear more about the board. Can you put code on that bluetooth chip or is the smaller DIP package some kind of micro? I'm not much of an ObjC programmer, but if you need any help with the embedded design or the board layout, let me know!
 
That's ****ing awesome. Great job! I would love to hear more about the board. Can you put code on that bluetooth chip or is the smaller DIP package some kind of micro? I'm not much of an ObjC programmer, but if you need any help with the embedded design or the board layout, let me know!

Thanks! So the BLE chip there is a whole SoC with an 8051 micro, UART, SPI, 8 channels of ADC and and digital GPIO's on pretty much any pin you don't tie up with other things. The BLE stack basically gives you a way to send and receive 20 byte packets back and forth, so my firmware pretty much just manages the UART and fragments/defragments/buffers all communications between iOS and MS. The smaller DIP is an SPI interface SRAM module with 32kB. I'm not even using it now, but I might need it in the future since I'm using almost all the 8kB of RAM in the 8051. The bigger DIP is just the standard MAX232 you need to convert RS232 line levels to UART levels. I'll definitely let you know f I need board layout help, it's not my specialty, that's for sure.

That's balls to the wall awesome. Are you spamming MSEFI with info yet?

Sure am, although the response here has been way better.
 
good for android too?

The hardware could be used but someone else would have to write the android app to use it. My app wouldn't carry over or anything like that. But with android, you guys can already use the regular BT with the Serial Port Profile (which is what the Android MS logging apps use) so there's not really a good reason to use BLE. According to the EFI Analytics, Shadow Logger is going to have tuning capability soon.
 
Thanks! So the BLE chip there is a whole SoC with an 8051 micro, UART, SPI, 8 channels of ADC and and digital GPIO's on pretty much any pin you don't tie up with other things. The BLE stack basically gives you a way to send and receive 20 byte packets back and forth, so my firmware pretty much just manages the UART and fragments/defragments/buffers all communications between iOS and MS. The smaller DIP is an SPI interface SRAM module with 32kB. I'm not even using it now, but I might need it in the future since I'm using almost all the 8kB of RAM in the 8051. The bigger DIP is just the standard MAX232 you need to convert RS232 line levels to UART levels. I'll definitely let you know f I need board layout help, it's not my specialty, that's for sure.

That embedded micro is pretty slick. Does the 8k include the BT stack?
 
2kB of SRAM should be plenty for what you're doing though. How much data are you buffering in between transmits? I do almost all my projects on AVRs that have 1kB of SRAM or less and I've only hit that limit once when I was buffering several 256kbit data blocks for SD card writes.
 
2kB of SRAM should be plenty for what you're doing though. How much data are you buffering in between transmits? I do almost all my projects on AVRs that have 1kB of SRAM or less and I've only hit that limit once when I was buffering several 256kbit data blocks for SD card writes.

Yup, it's no problem for MS. The largest thing I have to buffer is in the initial connection stuff where it gets an MS RAM page at a time (which are no bigger than about 1.3kB depending on the MS version). In fact, I could probably omit it for MS (just not sure about the layout of MS3). My thought was that **eventually**, I want to write an iOS SDK/firmware package for my board that would let developers use it like a normal serial port (as long as the data being sent back and forth was no larger than the size of the SPI ram). That could open up a new door for iOS developers interfacing with existing RS-232 hardware.
 
Yup, it's no problem for MS. The largest thing I have to buffer is in the initial connection stuff where it gets an MS RAM page at a time (which are no bigger than about 1.3kB depending on the MS version). In fact, I could probably omit it for MS (just not sure about the layout of MS3). My thought was that **eventually**, I want to write an iOS SDK/firmware package for my board that would let developers use it like a normal serial port (as long as the data being sent back and forth was no larger than the size of the SPI ram). That could open up a new door for iOS developers interfacing with existing RS-232 hardware.

Do you really need to buffer an entire page like that though? What data rate does the bluetooth link operate at? Even with the "faster" MS versions (2 and 3), you're only moving at a UART baud of 115kbit/s.
 
Do you really need to buffer an entire page like that though? What data rate does the bluetooth link operate at? Even with the "faster" MS versions (2 and 3), you're only moving at a UART baud of 115kbit/s.

Max throughput is about 3.2 kB/s with BLE to iOS. So the serial Rx into the chip fills up about 4x faster than it can send the data over the air if the baudrate is 115kbit/s. I don't have to read in a page at a time, I could read a byte at a time if I wanted, but that's only because the MS serial protocol lets you read in different ways. In general, some RS-232 device might send out 20kB in one go with no way to stop it, so that was my thinking with the external RAM. It was totally based on my general-purpose serial port SDK idea.
 
Back
Top