chipKIT® Development Platform

Inspired by Arduino™

chipKIT Android Library

Created Fri, 11 Nov 2011 21:22:50 +0000 by cobbj


cobbj

Fri, 11 Nov 2011 21:22:50 +0000

I've gotten the Microchip Android Accessories library working with the chipKIT MAX + Networking Shield + I/O Shield... it was fairly easy with only two edits required. In the near future I'll check out the Arduino ADK library to get something up and running on the chipKITs that can be used through MPIDE. In the meantime, if anyone else wants to make some Android Accessories with the same setup I used:

--Download the Microchip Application Library (the Android Accessory Library is inside) at [url]microchip.com/mal[/url] --Work off of the PIC32MX795F512L PIM Project File --Replace the HardwareProfile.h file with the attached --In Main.c, at the end of the file, replace the #elifdefined(PIC32MX460F512L_PIM... with the following code (to get the pot working):

#elif defined(PIC32MX460F512L_PIM) || defined(PIC32MX795F512L_PIM)
            AD1PCFG = 0xFFFE; // PORTB = Digital; RB2 = analog
            AD1CON1 = 0x0000; // SAMP bit = 0 ends sampling ...
            // and starts converting
            AD1CHS = 0x00000000; // Connect RB2/AN2 as CH0 input ..
            // in this example RB2/AN2 is the input
            AD1CSSL = 0;
            AD1CON3 = 0x0002; // Manual Sample, Tad = internal 6 TPB
            AD1CON2 = 0;
            AD1CON1SET = 0x8000; // turn ADC ON

            AD1CON1SET = 0x0002; // start sampling ... from 0x0002
            for(w.Val=0;w.Val<1000;w.Val++); //Sample delay, conversion start automatically
            AD1CON1CLR = 0x0002; // start Converting from 0x0002
            while (!(AD1CON1 & 0x0001));// conversion done?

            temp = (DWORD)ADC1BUF0;
            temp = temp * 100;
            temp = temp/1023;

Compile and program! We shot a quick video that I'll include once it's done. There is still some consideration on how much time is going to be spent on Android based activities - whoever reads this post that is interested in chipKIT for Android Accessories let us know if you're interested in more!


settorezero

Sat, 12 Nov 2011 18:08:52 +0000

I'd like to give a try but I've a question: I've a Samsung Galaxy tablet with Android 2.3.3. This version supports only ADB mode. Is ADB supported in this code?


cobbj

Mon, 14 Nov 2011 15:25:32 +0000

I'm new to this, but will take a shot...

From my understanding this code doesn't need to support ADB... to debug the demo board's code, you keep the link open between it an MPLAB. To use ADB for debugging the accessory, there is an article here: [url]http://developer.android.com/guide/topics/usb/index.html[/url] about opening an ADB over network connections while the Android device is running.

I could be way off in that explanation but... does that make sense?


ulfziemann

Mon, 28 Nov 2011 13:34:05 +0000

Hi,

I'm using the "Basic Communication Demo - OpenAccessory Framework" from the "Microchip Solutions v2011-10-18" . Is it possible to use the chipKit bootloader or did I have to reflash the bootloader after this project?

Thanks, Ulf


settorezero

Wed, 10 Oct 2012 22:35:22 +0000

I've downloaded the new MAL. I've a folder named "Android Accessories". In this folder, which project I must use? I suppose the "Basic Communication Demo - OpenAccessory Framework".

Now... There are no documents on how I must upload the app on the device, I see only the source for the app but I've no idea on how to use it.


thlockler

Mon, 22 Jul 2013 14:36:23 +0000

I know this is rather long after this topic has died but I just registered with the forum and am responding to your inquiry to how much we will want to be using the chipkit for android. I am designing a prototype that will specifically be using the chipkit Max32 to interface with a webcam via usb and write to an Android device. If any progress since the basic communication demo has been made could you reference me to that progress?

Thanks in advance for all Microchip has done to simplify the process.