Electronic – Communication between Microchip PIC24F & Android device

androidmicrochipusb

I am working on Microchip with Android Application via Android USB framework.

Currently, I have written a while loop to generate the random number continually.

It is possible to retrieve the random value that the Microchip generate through writing an Android application but do anyone knows how to do it?

I had research on-line but the information are very limited due to new technology!

The software I am using:

MPLAB IDE on Windows Version 8.73 MPLAB C Compiler for PIC24 and dsPIC v3.30

Eclipse on Ubuntu

The device/tools I am using:

DM240415 – PIC24F Accessory Development Starter Kit for Android

Best Answer

You may implement a interrupt service routine in order to answer a request from the android and return the last generated value. Just make sure that you have a global variable with the last value, that should be updated each time inside the loop.

Another alternative is to make a pooling on the request on every loop, but this may increase latency on the response.

Microchip provide a good example on how to implement the basic functions on the board. You should make the code to provide the random number in a similar way the demo provide the analog input value from the potentiometer.

Related Topic