Interfacing to a PIC Microcontroller

by Jay » Mon, 28 Sep 2009 00:18:57 GMT

Sponsored Links
 I am looking into to Interfacing an Android Phone with a PIC
Microcontoller and retrieve data via the USB port.  How would I go
about doing this?  What API calls do I need to make to retrieve data
from the PIC?  And will it be easier if I were to do this via
BlueTooth instead of USB by adding a BlueTooth module to my PIC?



Interfacing to a PIC Microcontroller

by Chris Stratton » Tue, 29 Sep 2009 00:00:05 GMT


The current  android phones are  USB devices only, they do not
function as USB  hosts.  So to do this with USB, you would need a PIC
that can be a USB host.

Bluetooth probably is more practical as some progress has been made on
getting rfcom working (see the unofficial bluetooth api community

There also is/was a debug serial port on the extusb connector that
might be an option, though may require a custom kernel?

Anyone you cut it, this is a quite advanced project - not to say that
you shouldn't tackle it, but you will end up learning a lot about the
internals of android before you get it working.



Sponsored Links

Interfacing to a PIC Microcontroller

by -chew- » Fri, 09 Oct 2009 00:00:20 GMT

 Also trying to accomplish the same objective. I've been trying to
investigate other possibilities of capturing incoming USB (maybe hook
the URB's) data in Android. I know that kernel build in Android does
not support the "Enable Loadable Module Support" kernel config and it
has no USB host or OTG capabilities; just client. If possible, I don't
want to do it in kernel mode (to avoid kernel recompilation). Maybe
just a daemon to do the capturing but still no idea how.

The idea of the project is that Android phone will be attached to a
microcontroller (USB host/OTG capable). This controller will be
sending data to Android phone via USB (I still have to write USB host
controller driver for the microcontroller, though). Android phone will
the USB client. Still investigating if this could be done in adb.
Don't want to modify adb itself. Maybe just a filter to capture USB
data traffic in adb. Been scanning the codes in adb. Seems that adb is
also doing the functionality of a typical USB driver, though running
as a daemon/service. Am I right?

@Jay: Do you have any progress so far? Could you please share also
some ideas?



Interfacing to a PIC Microcontroller

by -chew- » Fri, 09 Oct 2009 14:19:34 GMT

 adb implementation seems capable of addressing this requirement. But I
guess the porting the adb host side to the controller requires a lot
of work on the Android phone's side (adb device). I'm planning to
maybe make a separate daemon that would behave like adb (maybe on the
communication protocol used), only a simpler one. I'm not sure though
whether its coexistence with adb will result to other issues.



Other Threads

1. ColorPicker Query

Hi All,

Hi Folks ,

I have 2 questions :-

1. When I use the ColorPickerDialog.OnColorChangedListener I make sure
that  the colorChanged sets the selected color on the paint object I
am using. That being said, I see that on my screen say I am painting
it with red color and then I choose blue the things I previously
painted also turns blue instead I want what would be painted from now
on on the screen to turn blue. What would I be missing.

2. When I call erase from the menu options  I use the follow code

mPaint.setXfermode(new PorterDuffXfermode(

it clears the whole screen fine but I cant draw anymore.



2. Monkey Patching?

I am having difficulties accomplishing a monkey patch.  Is this even

My goal.

make org.apache.http.messaging.HeaderGroup implement Serializable
(really just use the 4.1 version)
so that it could be passed to an ObjectOutputStream.

Is there a way to do this?

Currently, I am getting a SerilazationException when passing an
HttpEntry to ObjectOutputStream because the version of HeaderGroup
that is packaged with android does not implement the Serializable

Is what I want possible?

What i am trying is putting the implementation of
org.apache.http.message.HeaderGroup in my compilable source tree.  The
code compiles, but when packaging it to be installed on an emulator /
device the Dex target is causing a failure.  Not sure what to do from
here, or how else to get my results, with out writing my own

Thanks in advance for any help.


3. Problems writing a C2DM service (InstantiationException).

4. Problem

5. apple group

6. Need to rotate Activity in 3D.

7. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.keyStatus/com.keyStatus.keyStatus}: java.lang.SecurityException: No active admin owned by uid 10031 for poli