DM240415 Microchip Technology, DM240415 Datasheet - Page 22

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)
4.2.3
4.2.4
Device
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 spent in an interrupt context and helps limit context related
issues. This means that in order to keep the USB host stack running, the USBTasks() function needs to be called
periodically in order to keep processing these events.
int
{
}
The rate at which USBTasks() is called will contribute to determining the throughput that the stack is able to get, the
timeliness of the data reception, and the accuracy and latency of the events thrown from the stack.
The USB Host stack notifies users of attachment and detachment events through an event handler call back function. The
name of this function is configurable in source code projects. In pre-compiled projects, this function is named
USB_ApplicationEventHandler().
The Android client driver uses this same event handler function to notify the user of the attachment or detachment of Android
devices.
EVENT_ANDROID_DETACH (
device. The data field of the attach event provides the handle to the Android device. This handle must be passed to all of
the read/write functions to it is important to save this information when it is received. Similarly the detach event specifies the
handle of the device that detached so that the application knows which device detached (if multiple devices are attached).
void* device_handle = NULL;
static
int
{
main(void)
//Initialize the USB stack
USBInitialize(0);
//Pass my accessory information to the Android client driver
AndroidAppStart(&myDeviceInfo);
while(1)
{
}
main(void)
//Initialize the USB stack
USBInitialize(0);
//Send the accessory information to the Android client driver
AndroidAppStart(&myDeviceInfo);
while(1)
{
Keeping the Stack Running
Detecting a Connection/Disconnection to an Android
BOOL device_attached = FALSE;
//Keep the USB stack running
USBTasks();
//Do my application specific stuff here
//...
//Keep the USB stack running
USBTasks();
//If the device isn't attached yet,
The
Android
client
see page 30) events. These two events are key to interfacing to the attached Android
driver
adds
the
EVENT_ANDROID_ATTACH
(
see
page
30)
and
17
17
4

Related parts for DM240415