AOAA Kit - User’s Guide Copyright 2012 © Embedded Artists AB Android Open Accessory Application (AOAA) Kit User’s Guide Get Up-and-Running Quickly and Start Developing Your Application On Day 1! EA2-USG-1201 Rev A
AOAA Kit - User’s Guide Page 2 Embedded Artists AB Davidshallsgatan 16 211 45 Malmö Sweden info@EmbeddedArtists.com http://www.EmbeddedArtists.com Copyright 2012 © Embedded Artists AB. All rights reserved.
AOAA Kit - User’s Guide Page 3 Table of Contents 1 Document Revision History 5 2 Introduction 6 2.1 6 Features 2.1.1 LPC1769 side features 6 2.1.2 LPC11C24 side features 7 2.2 ESD Precaution 7 2.3 General Handling Care 8 2.4 Code Read Protection 8 2.5 CE Assessment 8 2.6 Other Products from Embedded Artists 8 2.6.1 Design and Production Services 8 2.6.2 OEM / Education / QuickStart Boards and Kits 8 3 Getting Started 9 3.1 Demo Applications 9 3.
AOAA Kit - User’s Guide Page 4 4.9.6 Page 7 32 4.9.7 Page 8 32 4.9.8 Page 9 33 4.9.9 Page 10 33 5 Program Development 5.1 Program Download 34 5.1.1 ISP over UART Program Download 34 5.1.2 SWD/JTAG Program Download 36 Compiling the Demo Application 42 5.2 6 Troubleshooting Copyright 2012 © Embedded Artists AB 34 45 6.1.1 Cannot download/debug 45 6.1.
AOAA Kit - User’s Guide Page 5 1 Document Revision History Revision Date Description PA1 2012-01-28 First version. PA2 2012-02-10 Corrected grammar and smaller updates. A 2012-02-22 Added Android device to confirmed working list. PB1 2012-10-18 Clarified where to find USB connector J16.
AOAA Kit - User’s Guide Page 6 2 Introduction Thank you for buying The Android™ Open Accessory Application Kit from Embedded Artists. For the rest of the document the term Android Open Accessory will be written out as AOA. The kit (hardware and software) will be called The AOAA Kit, for short. When referring to just the hardware the term AOAA Board will be used. The kit has been developed by Embedded Artists in close cooperation with NXP.
AOAA Kit - User’s Guide 32 kbit I2C E2PROM for storing non-volatile parameters Powered via Android device’s normal USB power plug +5V DC external supply can also be connected via standard 2.1mm power jack SWD/JTAG connector 2x5 pos, 50 mil/1.27 mm pitch, standard SWD/JTAG connector Small prototyping area 100 mil pitch matrix of holes, 64 x 23 mm in size Compact size of complete board: 135 x 100 mm (5.4 x 3.9 inch) 2.1.
AOAA Kit - User’s Guide Page 8 Make it a habit always to first touch the metal surface of one of the USB or Ethernet connectors for a few seconds with both hands before touching any other parts of the boards. That way, you will have the same potential as the board and therefore minimize the risk for ESD. Note that Embedded Artists does not replace boards that have been damaged by ESD. 2.3 General Handling Care Handle the AOAA Board with care.
AOAA Kit - User’s Guide Page 9 3 Getting Started This chapter contains information about how to get acquainted with the AOAA Kit. Please read this chapter first before start using the board - it will be well spent time! 3.1 Demo Applications There are three AOA demo application that can be downloaded from the Embedded Artists support page. The AOAA board is not pre-loaded with any of these demo applications.
AOAA Kit - User’s Guide Page 10 A seven step process will follow to get the one of the demo applications up-and-running quickly. 3.2 Step 1: Have Supported Android Devices Make sure to use an Android device that supports AOA. Not all Android devices support Android Open Accessory. A basic version requirement is to have Android version v3.1, or higher. Some v2.3.4 devices support Android Open Accessory but not all since the functionality has been back ported to this version and inclusion is optional.
AOAA Kit - User’s Guide 3.3 Page 11 Step 2: Connect and Power the Board The picture below illustrates the basic setup of the AOAA board. The Android device is connected to the USB Host interface of the AOAA board, using the normal USB charger cable (that came with the Android device). The Android device’s charger is used to power the AOAA board. It actually also powers the Android device via the USB Host interface. The USB cable between the USB charger and the AOAA board is included in this kit.
AOAA Kit - User’s Guide 3.4 Page 12 Step 3: Verify Default Jumper Settings Verify that the default jumper positions on the board are correct, as below. Figure 2 – The AOAA Board Default Jumper Positions 3.5 Step 4: Install USB Driver for Console Output/ISP The AOAA Board contains an USB-to-UART bridge chip (FT232R from FTDI) that connects UART channel #0 on the LPC1769 to a virtual COM port on the PC/laptop (via USB). This UART channel is typically used as the console channel for applications.
AOAA Kit - User’s Guide 3.7 Page 13 Step 6: Prepare Android Device The demo application on the Android side has not been uploaded to Android Market. In order to install the demo from a different source the settings in the Android device must be changed. Go to Settings and then Applications in the device and check “Unknown sources”, see Figure 3 for Nexus One and Figure 4 for Motorola Xoom.
AOAA Kit - User’s Guide Page 14 Development and enable USB debugging, see Figure 5 for Nexus One and Figure 6 for Motorola Xoom.
AOAA Kit - User’s Guide 3.8 Page 15 Step 7: Run the Demo Application 1. Connect the USB cable (USB micro-B to A) between the Android device and J3, if not already done. 2. A dialog will appear indicating that there is no installed application that work with the USB Accessory. Click the View button to download the application from Embedded Artists website. 3. When the application has been downloaded a dialog will appear asking if it is okay to install the application. Select Install. 4.
AOAA Kit - User’s Guide Page 16 4 The AOAA Board Design This chapter describes the design of the AOAA Kit both from a conceptual and hardware perspective. Android Open Accessory allows connecting Accessories to an Android device. The Accessory and Android device communicates over USB. The Accessory has to implement a USB Host interface, while the Android acts as a USB client (also called USB Device). For more information about Android Open Accessory, see [3].
AOAA Kit - User’s Guide Page 17 Ethernet network ZigBee network or other RF network RF RF CAN network RF RF RF Figure 8 – The AOAA Board Network Interfaces A number of very powerful applications open up when the Accessory no longer is an isolated system, but instead a gateway to a networked system. The Android system no longer controls and interacts with just a single device, but a complete network! 4.1.
AOAA Kit - User’s Guide Page 18 The central controller (the AOAA board in this example) is connected to the Internet and can send diagnostic data to a service central, where maintenance is scheduled. A service technician can for example receive a message that immediate maintenance is needed for a specific motor. It can also be that maintenance is scheduled at a later point in time, but still urgent.
AOAA Kit - User’s Guide 4.2 Page 19 CAN Network Expansion The AOA board even contains an on-board CAN network. There is a CAN node built around the LPC11C24 microcontroller, which also contains an integrated CAN transceiver. The LPC1769 and LPC11C24 processors communicates over the CAN network. The CAN node can easily be detached from the main (LPC1769) board. If detaching the CAN node it is recommended to first cut the board connection between the CAN node and the prototype area.
AOAA Kit - User’s Guide Page 20 Figure 12 – CAN Node Detached from AOAA Board There is a possibility to extend the CAN network via either a DSUB9 (J6) or RJ45 (J5) connector. These connectors are not mounted but can easily be soldered, if needed. The connectors follow standard CAN pinning, see tables below. The CAN interface connectors on the LPC11C24 node are overlapping. Only one type of connector at a time can be used.
AOAA Kit - User’s Guide Page 21 Figure 13 – CAN Node via Ethernet Cable It is very simple to connect a CAN analyzer to AOAA board since standard CAN pinning is used on the DSUB9 connector. A standard DB9 F/F cable can be used. The Komodo™ from TotalPhase has been used during the development of the AOAA board with great success, see http://www.totalphase.
AOAA Kit - User’s Guide 4.3 Page 22 RF Network Expansion There are two interfaces on the AOAA board for radio modules. One at a time can be used. Both types of radio modules exist in different (application) versions. This gives the flexibility to create different types of radio node networks, for example pure ZigBee network, proprietary network based on IEEE 802.15.4, WiFi (IEEE802.11abgn) and 6LowPAN with different underlying radio standards.
AOAA Kit - User’s Guide Page 23 There is support for application download into the JN5148 module via a FTDI UART-to-USB cable that is connected to pin header J8. 4.3.2 Digi’s XBee family of radio modules The interface to this module is located on the top/component side of the board. The form factor is simple to use and program and there are many different versions of the module. Note that there are also several radio modules on the market that build upon the same form factor as the Digi’s XBee module.
AOAA Kit - User’s Guide 4.5 Page 24 Experiment Friendly The AOAA board is very experiment and prototype friendly. There are a lot of on-board peripherals and good expansion possibilities on the AOAA board.
AOAA Kit - User’s Guide 4.6 Page 25 Hardware Block Diagram The block diagram in Figure 18 below gives a quick overview of a design. It illustrates the major components in the design. The center of the design is the LPC1769 MCU from NXP. There is a USB Host interface to the Android device as well as several other communication interfaces. The design also contains a CAN node, built around the LPC11C24 MCU from NXP. It contains an integrated CAN transceiver.
AOAA Kit - User’s Guide 4.7 Page 26 Board Overview Figure 19 below illustrates the board structure. The upper part is the LPC1769 side of the design. The lower part contains the LPC11C24 CAN node and a prototype area.
AOAA Kit - User’s Guide J4, Ethernet connector Page 27 J2,USB Device connector J2,USB Host connector J14,USB-B power input J15,power input (alt +5V) RF2,XBee socket RF1,JN5148 pads on bottom side J22,uSD connector JP1/JP2 up (pos1-2)= USB Device down (pos2-3)=USB Host J16, UARTto-USB i/f J8 JP3 J1, SWD i/f for LPC1769 R93, trim.pot. JP4 J13, 8 prot. I/O J7, serial exp.
AOAA Kit - User’s Guide Page 28 Pin 11 (P0_9) P0_10 Connected to protected IO, pin 5 of J13 Pin 13 P0_11 connected to protected IO, pin 6 of J13 Pin 15 P0_15, P0_16 UART#1 connected to RF modules P0_17 Optionally connected to XBee module as CTS signal Pin 17 P0_18 Power control of uSD interface and connected to protected IO, pin 7 of J13 Pin 19 P0_19 Card detect input from uSD interface Pin 21 P0_20 Optionally connected to XBee module as DTR signal Pin 23 P0_21 Not used, free for expa
AOAA Kit - User’s Guide Page 29 P2_0 Connected to red LED in RGB-LED D6 Pin 16 P2_1 Connected to blue LED in RGB-LED D6 Pin 18 P2_2 Connected to green LED in RGB-LED D6 Pin 20 P2_3 Connected to red LED in RGB-LED D7 Pin 22 P2_4 Connected to blue LED in RGB-LED D7 Pin 24 P2_5 Connected to green LED in RGB-LED D7 Pin 26 P2_6 Not used, free for expansion Pin 28 P2_7 Not used, free for expansion Pin 30 P2_8 Not used, free for expansion Pin 32 P2_9 USB Device connection control P2_
AOAA Kit - User’s Guide Page 30 PIO0_7 Connected to LED13 J19, pin 8 PIO0_8 Connected to red LED of RGB-LED D12 J19, pin 9 PIO0_9 Connected to blue LED of RGB-LED D12 J19, pin 10 PIO0_10 Connected to green LED of RGB-LED D12 J19, pin 11 PIO0_11 Not used, free for expansion J19, pin 12 PIO1_0 Not used, free for expansion J19, pin 13 PIO1_1 Not used, free for expansion J19, pin 14 PIO1_2 Not used, free for expansion J19, pin 15 PIO1_3 Not used, free for expansion J19, pin 16 PIO1_
AOAA Kit - User’s Guide 4.9 Page 31 Schematic Walkthrough 4.9.1 Page 2 The center of the AOAA board is the LPC1769 from NXP. It is a MCU based on the ARM Cortex-M3 core. LPC1769 has many communication interfaces, which are used on the AOAA board. The external crystal is 12MHz, which is the recommended value to get standard CAN timing and meeting the USB frequency requirements. The RTC crystal is not mounted since AOAA board is not a low-power design. It will always be powered.
AOAA Kit - User’s Guide Page 32 o All pins of the JN5148 modules are not connected. Only the ones needed to get a UART communication channel with the board. Digi’s XBee family of radio modules The interface to this module is located on the top/component side of the board. There are two 1x10 pos, 2mm pitch sockets for inserting the XBee module. o Only the pins needed for UART communication have been connected to the LPC1769.
AOAA Kit - User’s Guide 4.9.8 Page 33 Page 9 The board is normally powered via J14, a USB-B connector where the Android device’s charger is connected. Alternatively an external +5VDC, 1A supply can be connected via J15, a 2.1mm power jack input. The power supply is very simple, an LDO to create the +3.3V from the +5V input. There is a UART-to-USB bridge based on the FT232RL chip from FTDI. It is connected to UART#0 on the LPC1769.
AOAA Kit - User’s Guide Page 34 5 Program Development This chapter describes how to download code to the AOAA board and how to compile the demo applications – and in the extension, how to develop own demo applications. Details of the demo applications are not described in this document. 5.1 Program Download The AOAA board contains two processors, the LPC1769 and LPC11C24. Both supports program download via SWD/JTAG.
AOAA Kit - User’s Guide Page 35 Some settings must be changed in Flash Magic in order to enable automatic enabling of ISP. Figure 21 illustrates where the Advanced Options selection can be found. Figure 21 – Flash Magic Advance Options Then select the Hardware Config tab end set checkboxes and T1/T2 numbers according to Figure 22.
AOAA Kit - User’s Guide Page 36 After this, Flash Magic is ready to be used. Start by selecting the correct device, LPC1769 in this case. Then select the correct COM port. Note that the AOAA board contains a UART-to-USB bridge. UART#0 of the LPC1769 is connected to this. See section 3.5 how to install the driver for this bridge chip. When the AOAA board is connected via a USB cable (J16, mini-B USB connector) to the PC a (virtual) COM port will be created. It is this COM port that shall be selected.
AOAA Kit - User’s Guide Page 37 LPC-LINK side Target side (shall be disconnected) Connect to USB on PC Resulting SWD/JTAG interface connector Separate either by physically cutting the board, or simpler by removing solder bumps with a soldering iron. Figure 24 – Create an LPC-LINK The pictures below illustrate how to connect the 10-pos SWD/JTAG cable between the LPC-LINK and the AOAA board. Note the orientation of the 10-pos SWD/JTAG cable in both cases.
AOAA Kit - User’s Guide Page 38 Figure 26 – Connect LPC-LINK to the LPC11C24 Below are the steps to perform a program download. Normally the demo projects would be opened in the LPCXpresso IDE and then program download is very simple. The description below assumes no demo project that is active. 1. Make sure that the latest version of the LPCXpresso IDE is installed on the PC. 2. Connect a USB cable between the LPC-LINK and the PC, see Figure 24 above.
AOAA Kit - User’s Guide Page 39 Program Flash Icon Figure 27 – LPCXpresso IDE Program Flash Icon 6. The next step is to select which processor to download to. Select LPC1769 or LPC11C24, depending on which processor to program. Then press OK button. Note that this step is sometimes not needed because the LPCXpresso IDE can itself detect which processor it is connected to. Note that the LPCXpresso is code size limited and the LPC1769 has bigger flash than the 128kByte limit.
AOAA Kit - User’s Guide Figure 28 –LPCXpresso IDE Target Selection 7. The next step is to browse to the file to download. Press the “Browse” button.
AOAA Kit - User’s Guide Page 41 8. Browse to the pre-compiled program images. If it is in fact the demo projects that exist, select the top directory and then “Debug”. In this subfolder there is either a file ending with *.axf or *.bin. Select one of these files. Press the “Open” button. 1) Find workspace and all sample apps. 2) Find project top directory 3) Find “Debug” subdirectory Figure 30 – Browse to File to Download 9. The program will start downloading.
AOAA Kit - User’s Guide Page 42 10. In case flashing fails, an error message like below will be displays. This is an indication that the debugger could not connect to the LPC1769 or LPC11C24. The most common reason is that the microcontroller was in a low-power mode where debug connection is not possible. Make sure the microcontroller is in ISP/bootload mode and try again. Also make sure the small 10-pos flat cable is correctly connected. Figure 32 – LPCXpresso IDE Program Failing to Flash 5.
AOAA Kit - User’s Guide Page 43 1) Select Import and Export 2) Select Import archived projects (zip) Figure 33 – LPCXpresso IDE Import Archived Project Next, browse and select the downloaded zip file containing the archived sample applications. Select the sub-projects to be imported, see figure below (note that the screen shot below is generic and the project names will be different in the AOA demo applications).
AOAA Kit - User’s Guide Page 44 The selected projects are now imported. Click (to select) the project to work with. Browse and edit the project files. Build/clean/debug the project from the Quickstart menu (Start here), see picture below. When debugging a project, make sure the AOAA board is connected via LPC-LINK to the PC because the application will be downloaded to the board via LPC-LINK (SWD debug interface).
AOAA Kit - User’s Guide Page 45 6 Troubleshooting This chapter contains information about how to troubleshoot boards that does not seem to operate properly. It is strongly advised to read through the list of tests and actions that can be done before contacting Embedded Artists support. The different tests can help determine if there is a problem with the board, or not. For return policy, please read Embedded Artists’ General Terms & Conditions document.
AOAA Kit - User’s Guide Page 46 Start a terminal application on the PC. TeraTerm works fine. Use 115200 bps, 8N1 and select the COM port that pops up when the USB cable from the AOAA board is connected to the PC. 3. Press the reset push-button, SW4 and observe the console output in the terminal window on the PC. The following tests will be performed: Copyright 2012 © Embedded Artists AB E2PROM test; an automatic test.
AOAA Kit - User’s Guide Page 47 7 Further Information The LPC1769/11C24 microcontrollers are complex circuits and there exist a number of other documents with a lot more information. The following documents and web pages are recommended as a complement to this document. [1] NXP LPC1769 Information http://ics.nxp.com/products/lpc1000/lpc17xx/ [2] NXP LPC11C24 Information http://ics.nxp.com/products/lpc1000/lpc1100/lpc11cxx/ [3] Android Open Accessory Information http://developer.android.