DM240415 Microchip Technology, DM240415 Datasheet

Accessory Development Starter Kit For Android General Purpose

DM240415

Manufacturer Part Number
DM240415
Description
Accessory Development Starter Kit For Android General Purpose
Manufacturer
Microchip Technology
Series
-r
Datasheet

Specifications of DM240415

Processor To Be Evaluated
PIC24FJ256GB110-I/PT
Processor Series
PIC24F
Data Bus Width
16 bit
Interface Type
USB
Operating Supply Voltage
3.3 V
Design Resources
PIC24F ADK Schematic
Main Purpose
Reference Design, Tablet
Embedded
Yes, MCU, 16-Bit
Utilized Ic / Part
PIC24F
Primary Attributes
Android OS, Development Platform for Accessories, Arduino Compatible
Secondary Attributes
Royalty Free, No Fee Licensed Software Library
Lead Free Status / Rohs Status
 Details

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM240415
Manufacturer:
MICROCHIP
Quantity:
12 000
Microchip's Accessory
Framework for Android(tm)

Related parts for DM240415

DM240415 Summary of contents

Page 1

Microchip's Accessory Framework for Android(tm) ...

Page 2

... Microchip Technology Inc. Copyright (c) 2011. All rights reserved. Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. ...

Page 3

Microchip's Accessory Framework for Android(tm) Introduction SW License Agreement Release Notes Terms and Definitions Supported Demo Boards Requirements, Limitations, and Potential Issues Getting the Source Code What's Next? Using the Library Library Architecture How the Library Works Configuring the Library ...

Page 4

Microchip's Accessory Framework for Android(tm) USB_ERROR_BUFFER_TOO_SMALL Macro Configuration Definitions NUM_ANDROID_DEVICES_SUPPORTED Macro Configuration Functions AndroidAppDataEventHandler Function AndroidAppEventHandler Function AndroidAppInitialize Function Events EVENT_ANDROID_ATTACH Macro EVENT_ANDROID_DETACH Macro Type Definitions ANDROID_ACCESSORY_INFORMATION Structure Running the Demos Creating the Setup New to Microchip Getting the Tools ...

Page 5

Microchip's Accessory Framework for Android(tm) How do I debug without access to ADB? What if I need design assistance creating my accessory? The firmware stops working when I hit a breakpoint hit the "Home" or "Back" buttons while ...

Page 6

Microchip's Accessory Framework for Android(tm) 1 Introduction The Microchip's Accessory Framework for Android for Android provides a mechanism to transfer data to and from an Android application through the USB of the microcontroller. Microchip's Accessory Framework for Android for Microchip ...

Page 7

... IMPORTANT - READ CAREFULLY. This Nonexclusive Software License Agreement (“Agreement” contract between you, your heirs, successors and assigns (“Licensee”) and Microchip Technology Incorporated, a Delaware corporation, with a principal place of business at 2355 W. Chandler Blvd., Chandler, AZ 85224-6199, and its subsidiary, Microchip Technology (Barbados) Incorporated (collectively, “ ...

Page 8

... PC programs are used with Microchip products, and (y) the following conditions are met when Licensee redistributes any PC programs: “Copyright (c) Microchip Technology Inc. All rights reserved. Microchip PC programs are provided for your use with Microchip products only. ...

Page 9

Microchip's Accessory Framework for Android(tm) * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and ...

Page 10

Microchip's Accessory Framework for Android(tm) (4) Use the Software to develop and/or manufacture Third Party Products where either: (x) the sublicensed Software contains Source Code modified or otherwise optimized by Licensee for integration into Third Party Products; and/or (y) the ...

Page 11

Microchip's Accessory Framework for Android(tm) Components will be no less broad than the license granted in Section 1. To the extent the terms of the licenses applicable to Open Source Components prohibit any of the restrictions in this Agreement with ...

Page 12

Microchip's Accessory Framework for Android(tm) EXCLUSIVE LIABILITY OF THE PARTIES FOR INTELLECTUAL PROPERTY INFRINGEMENT. 4. Confidentiality. (a) Licensee agrees that the Software (including but not limited to the Source Code, Object Code and library files) and its derivatives, Documentation and ...

Page 13

Microchip's Accessory Framework for Android(tm) 7. Warranties and Disclaimers. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR ...

Page 14

... NASA FAR Supplement. Contractor/manufacturer is Microchip Technology Inc., 2355 W. Chandler Blvd., Chandler, AZ 85225-6199. If Licensee has any questions about this Agreement, please write to Microchip Technology Inc., 2355 W. Chandler Blvd., Chandler, AZ 85224-6199 USA. ATTN: Marketing. Copyright © 2010 Microchip Technology Inc. All rights reserved. ...

Page 15

... Supported Demo Boards The following demo boards are supported in this release: • Accessory Development Starter Kit for Android (PIC24F Version) (DM240415) • Explorer 16 (DM240001) with USB PICtail+ Board (AC164131) with any of the following Processor Modules: • PIC24FJ256GB110 PIM (MA240014) • PIC24FJ64GB004 PIM (MA240019) • ...

Page 16

Microchip's Accessory Framework for Android(tm) 3.3 Requirements, Limitations, and Potential Issues This section describes the limitations and requirements for using the Microchip's Accessory Framework for Android. Requirements: The Microchip's Accessory Framework for Android requires Android versions v2.3.4 or v3.1 or ...

Page 17

Microchip's Accessory Framework for Android(tm) 4 Using the Library 4.1 Library Architecture The Android Accessory driver when in host mode is just a client driver on top on top of the Microchip USB host stack as seen in the below ...

Page 18

Microchip's Accessory Framework for Android(tm) USB_ApplicationDataEventHandler() and USB_ApplicationEventHandler() for the pre-compiled example. For the source example the function names are configurable through the usb_config.h ( see page 14) file (see the usb_config.h ( see page 14) section for more information). ...

Page 19

Microchip's Accessory Framework for Android(tm) 4.2.1.2 HardwareProfile.h HardwareProfile.h provides configuration information to the source version of the library. This tells the library and demo code information about the hardware that it needs to know for configuration, such as the system ...

Page 20

Microchip's Accessory Framework for Android(tm) #define USB_SUPPORT_BULK_TRANSFERS #define USB_NUM_INTERRUPT_NAKS 3 #define USB_INITIAL_VBUS_CURRENT (100/2) #define USB_INSERT_TIME (250+1) #define USB_HOST_APP_EVENT_HANDLER USB_ApplicationEventHandler #define USBTasks() { USBHostTasks(); AndroidTasks(); } #define USBInitialize(x) { USBHostInit(x); } For more information about the usb_config.h file, please refer to ...

Page 21

... Android device when attached. This is done through the AndroidAppStart ( see ANDROID_ACCESSORY_INFORMATION ( accessory. An example is seen below: //Define all of my string information here char manufacturer[] = "Microchip Technology Inc."; char model[] = "Basic Accessory Demo"; char description[] = "ADK - Accessory Development Starter Kit for Android (PIC24F)"; char version[] = "1.0"; char uri[] = " ...

Page 22

Microchip's Accessory Framework for Android(tm) 4.2.3 Keeping the Stack Running The Microchip USB host stack receives and logs events via an interrupt handler, but processes them as the USBTasks() (or USBHostTasks()) function is called. This limits the amount of time ...

Page 23

Microchip's Accessory Framework for Android(tm) if(device_attached == FALSE) { //Continue to the top of the while loop to start the check over again. continue; } //If the accessory is ready, then this is where we run all of the demo ...

Page 24

Microchip's Accessory Framework for Android(tm) if(AndroidAppIsWriteComplete(device_handle, &errorCode, &size) == TRUE) { writeInProgress = FALSE; if(errorCode != USB_SUCCESS) { //Error DEBUG_ERROR("Error trying to complete write"); } } } if((buttonsNeedUpdate == TRUE) && (writeInProgress == FALSE)) { response_packet.command = COMMAND_UPDATE_PUSHBUTTONS; response_packet.data = ...

Page 25

Microchip's Accessory Framework for Android(tm) if( errorCode != USB_SUCCESS) { //Error DEBUG_ERROR("Error trying to start read"); } else { readInProgress = TRUE if(AndroidAppIsReadComplete(device_handle, &errorCode, &size) == TRUE) { readInProgress = FALSE; //We've received a command over the USB ...

Page 26

Microchip's Accessory Framework for Android(tm) 5 Firmware API This section covers the API routines available in this distribution. These descriptions cover more of the interface of these functions. For example usages and more details about how to use these functions ...

Page 27

Microchip's Accessory Framework for Android(tm) • USB_ENDPOINT_ERROR_BIT_STUFF • USB_ENDPOINT_ERROR_DMA • USB_ENDPOINT_ERROR_TIMEOUT • USB_ENDPOINT_ERROR_DATA_FIELD • USB_ENDPOINT_ERROR_CRC16 • USB_ENDPOINT_ERROR_END_OF_FRAME • USB_ENDPOINT_ERROR_PID_CHECK • USB_ENDPOINT_ERROR - Other error Preconditions Transfer has previously been requested from an Android device. Parameters Parameters void* handle BYTE* errorCode ...

Page 28

Microchip's Accessory Framework for Android(tm) • USB_ENDPOINT_ERROR_BIT_STUFF • USB_ENDPOINT_ERROR_DMA • USB_ENDPOINT_ERROR_TIMEOUT • USB_ENDPOINT_ERROR_DATA_FIELD • USB_ENDPOINT_ERROR_CRC16 • USB_ENDPOINT_ERROR_END_OF_FRAME • USB_ENDPOINT_ERROR_PID_CHECK • USB_ENDPOINT_ERROR - Other error Preconditions Transfer has previously been sent to Android device. Parameters Parameters void* handle BYTE* errorCode DWORD* ...

Page 29

Microchip's Accessory Framework for Android(tm) Parameters Parameters void* handle BYTE* data DWORD size Return Values Return Values USB_SUCCESS USB_UNKNOWN_DEVICE USB_INVALID_STATE USB_ENDPOINT_ILLEGAL_TYPE USB_ENDPOINT_ILLEGAL_DIRECTION Must read from an IN endpoint. USB_ENDPOINT_STALLED USB_ENDPOINT_ERROR USB_ENDPOINT_BUSY USB_ENDPOINT_NOT_FOUND USB_ERROR_BUFFER_TOO_SMALL ( see page 26) Function BYTE AndroidAppRead(void* ...

Page 30

Microchip's Accessory Framework for Android(tm) Function void AndroidAppStart( ANDROID_ACCESSORY_INFORMATION ( see page 31) *info) 5.1.5 AndroidAppWrite Function Sends data to the Android device specified by the passed in handle. File usb_host_android.h C BYTE AndroidAppWrite( void* handle, BYTE* data, DWORD size ...

Page 31

Microchip's Accessory Framework for Android(tm) File usb_host_android.h C void AndroidTasks(); Description Tasks function that keeps the Android client driver moving. Keeps the driver processing requests and handling events. This function should be called periodically (the same frequency as USBHostTasks() would ...

Page 32

Microchip's Accessory Framework for Android(tm) 5.3 Configuration Definitions Macros Name NUM_ANDROID_DEVICES_SUPPORTED ( see page 27) 5.3.1 NUM_ANDROID_DEVICES_SUPPORTED Macro File usb_host_android.h C #define NUM_ANDROID_DEVICES_SUPPORTED 1 Description Defines the number of concurrent Android devices this implementation is allowed to talk to. This ...

Page 33

Microchip's Accessory Framework for Android(tm) File usb_host_android.h C BOOL AndroidAppDataEventHandler( BYTE address, USB_EVENT event, void * data, DWORD size ); Description Handles data events from the host stack Remarks This is a internal API only. This should not be called ...

Page 34

Microchip's Accessory Framework for Android(tm) Preconditions None Parameters Parameters BYTE address USB_EVENT event void* data DWORD size Return Values Return Values TRUE FALSE Function BOOL AndroidAppEventHandler( BYTE address, USB_EVENT event, void *data, DWORD size ) 5.4.3 AndroidAppInitialize Function Per instance ...

Page 35

Microchip's Accessory Framework for Android(tm) Function BOOL AndroidAppInitialize( BYTE address, DWORD flags, BYTE clientDriverID ) 5.5 Events Macros Name EVENT_ANDROID_ATTACH ( see page 30) EVENT_ANDROID_DETACH ( see page 30) 5.5.1 EVENT_ANDROID_ATTACH Macro File usb_host_android.h C #define EVENT_ANDROID_ATTACH ANDROID_EVENT_BASE + 0 ...

Page 36

Microchip's Accessory Framework for Android(tm) 5.6 Type Definitions Structures Name ANDROID_ACCESSORY_INFORMATION ( see page 31) 5.6.1 ANDROID_ACCESSORY_INFORMATION Structure File usb_host_android.h C typedef struct { char* manufacturer; BYTE manufacturer_size; char* model; BYTE model_size; char* description; BYTE description_size; char* version; BYTE version_size; ...

Page 37

Microchip's Accessory Framework for Android(tm) the Android application to access the device. An instance of this structure should be passed into the AndroidAppStart ( see page 24)() at initialization ...

Page 38

Microchip's Accessory Framework for Android(tm) 6 Running the Demos 6.1 Creating the Setup 6.1.1 New to Microchip This section covers where to find Microchip tools and how to set those tools up for those that are new to Microchip. 6.1.1.1 ...

Page 39

Microchip's Accessory Framework for Android(tm) Open Accessory project: • http://developer.android.com/guide/index.html • http://developer.android.com/guide/topics/fundamentals.html • http://developer.android.com/resources/tutorials/hello-world.html 6.1.3 Updating the Android OS Description This section describes how to update the Android device to the versions required for use with the Open Accessory framework. ...

Page 40

Microchip's Accessory Framework for Android(tm) 17. Press and hold the power button. While still holding the power button, press the up volume button. 18. You will now see a system recovery menu. From this menu use the volume down button ...

Page 41

Microchip's Accessory Framework for Android(tm) 6.1.4.1.2 Version v3.x To enable development for the Honeycomb OS line, versions v3.x and later, you will need to get the API level 12 add-on for the Eclipse IDE. 1. Launch the "Android SDK and ...

Page 42

Microchip's Accessory Framework for Android(tm) 6.2 Basic Accessory Demo This is the basic accessory demo that shows simple bi-directional communication from the Android device to the attached accessory. 6.2.1 Getting the Android Application There are several methods for getting the ...

Page 43

Microchip's Accessory Framework for Android(tm) 6.2.2 Preparing the Hardware Before attempting to run the demo application, insure that the correct firmware for the demo application has been loaded into the target firmware. The firmware for this example can be found ...

Page 44

Microchip's Accessory Framework for Android(tm) • LED Controls – Pressing any of the 8 buttons on the Android screen sends a command from the Android device to the accessory, indicating that the LED status has changed and provides the new ...

Page 45

Microchip's Accessory Framework for Android(tm) 7 Creating an Android Accessory Application using the Open Accessory Framework 7.1 Creating the Project When creating a new Android application that is going to be using the Open Accessory framework important to ...

Page 46

Microchip's Accessory Framework for Android(tm) For Honeycomb devices (v3.1 or later), select any of the API 12 versions (seen below ...

Page 47

Microchip's Accessory Framework for Android(tm) This is the only special requirement for developing an application for Android accessories. 7.2 Accessing the Accessory From the Application There are several steps that are required in order to gain access to the accessory ...

Page 48

Microchip's Accessory Framework for Android(tm) 8 FAQs, Tips, and Troubleshooting 8.1 My PIC32 project gets a run time exception. What could be wrong? There are several issues that could be causing the runtime exceptions in a PIC32 project. Here are ...

Page 49

Microchip's Accessory Framework for Android(tm) 8.3 What if I need design assistance creating my accessory? If you have questions about the library, our parts, or any of our reference codes/boards, please feel free to contact Microchip for support (What if ...

Page 50

Microchip's Accessory Framework for Android(tm) some other reason. Please see the Requirements, Limitations, and Potential Issues ( see page 11) section for other known issues or limitations. 8.6 Why don't all of the features of the demo work? The demo ...

Page 51

Microchip's Accessory Framework for Android(tm) Index A Accessing the Accessory From the Application 42 ANDROID_ACCESSORY_INFORMATION structure 31 AndroidAppDataEventHandler function 27 AndroidAppEventHandler function 28 AndroidAppInitialize function 29 AndroidAppIsReadComplete function 21 AndroidAppIsWriteComplete function 22 AndroidAppRead function 23 AndroidAppStart function 24 AndroidAppWrite function ...

Page 52

Microchip's Accessory Framework for Android(tm) Release Notes 10 Required USB callbacks 12 Requirements, Limitations, and Potential Issues 11 Running the demo 38 Running the Demos 33 S Sending Data 18 Supported Demo Boards 10 SW License Agreement 2 T Terms ...

Related keywords