This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to connect an android Tablet with OTG usb with EK-TM4C1294XL?

Other Parts Discussed in Thread: EK-TM4C1294XL

Hi All,

I have a project to make an android app that can comunicate with TM4C1294 via USB.

So, to start with, I bought EK-TM4C1294XL board and a Samsung tablet.

Anyway, now it looks like both has micro USB.

Anyone have any idea of how to connect them and any sample code to start with?

thanks in advance.

  • That's a reasonable request - yet to my knowledge - not too much has "landed here" in that regard.

    Might the Android community provide a listing of, "successfully supporting" MCUs?  (and perhaps even Samsung)

    Likely makes sense for you to determine which USB "class and/or mode" is most "welcomed" by your tablet - and then see (if & how) your MCU can adapt/support...

  • There is something called the Android Open Accessory (AOA) Protocol, which defines how Android apps are able to connect to external devices via USB. See

    www.ftdichip.com/.../WP_001_Connecting_%20Peripherals_to_an_Android_%20Platform.pdf

    for a brief description of the protocol.

    A few things to keep in mind:

    1) AOA requires that the tablet operate as a USB device, which means that your eval kit code must function as a USB host. You would plug the A side of an OTG cable into the dev kit, and B side into the tablet.

    2) The TivaWare USB library does not support AOA mode, so you will be on your own regarding implementing the protocol.

    3) Even if you get AOA working, depending on the device class you want to support, you may also need to develop your own driver. For example, the TivaWare library does not support host mode CDC.

    There are ways to get around the AOA protocol. It is possible to write non-AOA USB drivers for the tablet, and there is a CDC driver available on GitHub. However, this requires rooting the device, which would typically invalidate your warranty.

    Another option is to use a host bridge chip from FTDI. They have a couple of chips (FT311D and FT312D, ~$4 in single quantities) that implement the AOA protocol and interface to your processor via UART, SPI or I2C. This, of course, would require some hardware work on your end to connect the chip to your board.

    Hope this helps!

    Regards,

    Dave
  • @ Dave,

    May I say, "Great & detailed job" - thank you!

    Have you read of any "success" w/that FTDI device? (i.e. actually establishing (meaningful) command/control over the tablet w/a reasonably "basic" MCU?) If such proves true - the speed & ease of transactions w/the tablet would be of great interest.

    Being able to "capture" a nearby tablet - and employ it (more directly) for engineering, scientific, industrial purposes - via "mainstream MCUs" (such as those here/elsewhere) seems a most desirable objective.
  • Hi, cb1-,

    I have not actually used that particular FTDI device. We were looking into it, but decided to go a different route, since the chip will not work with non-Android devices, and we need to keep our options open.

    Regards,

    Dave
  • If anyone does have experience with AOA or the FTDI chip I'd like to hear about it as well.

    Robert
  • Hi Robert,

    Please check this out.

    This is FTDI board/IC that can work with AOA mode. It is a good example.

    Anyway, for my project, I will not introduce more H/W.

    I think the TI Tiva board/library has the USB connection capability.

    I will  probably need to go deep to root it out.

    thanks.

     

  • Mon ami,

    Usually - but not always - when one, "Will not introduce more HW" - one will not (then) introduce a completed project or product!

    Our small tech firm adopts just the opposite - do any/everything to "accomplish the mission!"   Only then - as/if profit potential (still) exists/remains - does "cost/size cutting" enter our consideration.

    Even an "inefficient" circuit implementation (not saying the FTDI chip so qualifies) most always "casts off" much of value.   Digging deep - to "root out" (that which may not actually be there) - not so much...

  • Understand your point.

    I actually make it to work. We go very deep to root.

    Android as a host and TI board as a device.

    We use USB bulk mode on TI board.

    Anyway, one requirement I forgot is charging the android at the same time which cannot be done as it is a host right now.

    We use a smartcharger on this purpose but it cannot charge. The communication is OK.

    I will try more. I think it have to work the other way around. Android should be device and TI board should be Host.

    Worst case is the FTDI solution but ultimately try to avoid it.

  • Thana Sithanant said:
    I actually make it to work. We go very deep to root.

    I'm happy for you - and surprised.   That's quite an accomplishment - and surely would prove of great interest/value to MANY here!

    Might you (bit) detail what, "make it work" includes?   Can you read & write to the tablet's screen, can you input different size/type text, and graphics?   (especially JPG files)

    Devil in such detail.   Unknown is the degree of "accommodation" your MCU offers to such Android devices & Apps - and whether (other) MCUs may provide meaningful advantage.   (we always try to perform a "broad device survey" so as to maximize the odds of, "best tool for the task."

    Surrendering (some) of your Android "secrets" here may result in some valued "discoveries" by the masses - which prove to your advantage...

  • Well, the 1st step is just text communication back and forth from a Samsung android to TI evaluation board.

    In the attachment, there is the whole project (code for Android and code for TI board) and a picture.

    The only thing needed to connect between the 2 are the cables as the picture shown. 

    Note that Samsung Tablet has OTG micro usb and also TI has micro usb.

    Anyway, this is not working for charging the Tablet yet.DemoSCM.zip usb_dev_bulk.zip

    We are working on it. (Android to be AOA and TI to be host).

    I will update more status later.

  • Thank you - that's appreciated.   While the "exchange" of text is an "achievement" the ability to "exploit (command) the Tablet's superb color screen" would seem of key/critical importance.   Text transfer alone may not fully unlock that objective.

    I'd bet that "FTDI/similar others" - (likely) having invested more time/energy than your group - may prove helpful to your efforts.   (I'd seek a list of capabilities, and info on speeding & enhancing the (external) command/control of the tablet.)

    Myself/others here would benefit if you'd briefly describe how you "know" that your MCU's text output was successfully received by the tablet.   And the reverse - how you manipulated the tablet to "send text" to your MCU - would also be welcome.

    If you can incite enough interest & participation here - I'd bet that some would offer most constructive findings and techniques/methods - which are likely to prove of interest & value to your group.

    Might you note the exact model number of your Samsung tablet?   As meaningful tablet info arrives - I'll have my firm survey the general/equivalent ARM MCU field - to see if any devices offer wider and/or superior management of this MCU <-> Tablet "marriage."

    Again thanks - text sent via your MCU - resident (observable) on the tablet's screen - would register as a far more memorable picture...