PICDEM™ FS USB DEMONSTRATION BOARD USER’S GUIDE 2004-2013 Microchip Technology Inc.
Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature.
PICDEM™ FS USB USER’S GUIDE Table of Contents Chapter 1. Introduction to the PICDEM™ FS USB Board 1.1 Introduction ................................................................................................... 11 1.2 PICDEM FS USB Demonstration Kit Contents ............................................ 11 1.3 Overview of the PICDEM FS USB Demonstration Board ............................ 11 1.4 PICDEM FS USB Board Hardware Features ............................................... 12 1.
PICDEM™ FS USB User’s Guide NOTES: DS51526C-page 4 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number. This number is located on the bottom of each page, in front of the page number.
PICDEM™ FS USB User’s Guide • Chapter 5. “Using the Microchip USB Firmware Framework” – The board’s preloaded demonstrations, and other demonstrations and projects available in the MCHPFSUSB Framework • Chapter 6. “Reconfiguring the PICDEM™ FS USB Hardware” describes how to tailor the demonstration board’s hardware to your application. • Chapter 7. “Troubleshooting” discusses some common questions about using the demonstration board. • Appendix A.
WARRANTY REGISTRATION Please complete the enclosed Warranty Registration Card and mail it promptly. Sending in the Warranty Registration Card entitles users to receive new product updates. Interim software releases are available at the Microchip web site. RECOMMENDED READING This user’s guide describes how to use the PICDEM™ FS USB Demonstration Board. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources.
PICDEM™ FS USB User’s Guide THE MICROCHIP WEB SITE Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers.
CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • • • • Distributor or Representative Local Sales Office Field Application Engineer (FAE) Technical Support Customers should contact their distributor, representative or field application engineer (FAE) for support. Local sales offices are also available to help customers. Technical support is available through the web site at: http://www.microchip.com/support.
PICDEM™ FS USB User’s Guide NOTES: DS51526C-page 10 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Chapter 1. Introduction to the PICDEM™ FS USB Board 1.1 INTRODUCTION The PICDEM™ FS USB Demonstration Kit is designed as an easy-to-use evaluation and development platform for the PIC18F45K50, PIC18F4550 and similar families of PIC18 USB 2.0 full-speed microcontrollers. Two board variants exist.
PICDEM™ FS USB User’s Guide The PICDEM FS USB Demo Board is intended to be used in conjunction with the MCHPFSUSB Framework, which is a library of USB example projects, source code, PC applications, tools, documentation, and other resources necessary for developing complete USB communication systems.
Introduction to the PICDEM™ FS USB Board 1. Microcontroller: The 44-pin TQFP PIC18F45K50 microcontroller (U2) or 44-pin TQFP PIC18F4550 (U2) is the heart of the demonstration board, and provides all USB functionality on one chip. Refer to the respective device data sheet (DS30684 or DS39632, respectively) for a complete discussion of the microcontroller and its feature set. 2. ICE Interface Riser: The microcontroller is surrounded by a 44-pin pad (U5), arranged as four groups of 11 on each side.
PICDEM™ FS USB User’s Guide 14. Status LED Bank: A bank of four green LEDs are used to show the operational status of the board. Two LEDs (D1 and D2) are used by the application firmware to indicate the status of the USB connection. The other LEDs (D3 and D4) can be defined by the user; they are directly controllable through the Demo Tool software. 15. User-Defined Push Buttons: These two switches (S2 and S3) are provided to simulate digital control inputs.
Introduction to the PICDEM™ FS USB Board FIGURE 1-3: PIC18F45K50 CLOCK SETUP FOR PICDEM™ FS USB PIC18F4550 Oscillator Block Internal Oscillator (configured for 4MHz output) 4 MHz 96 MHz PLL (requires 4 MHz input) 96 MHz 96 MHz Fixed Divide-by-2 1.4.2 Configurable Clock Postscaler (configured as divide-by-2) 48 MHz CPU and Peripherals Clock 48 MHz USB Clock Power The PICDEM FS USB demonstration board operates at 5V. Power can be drawn directly from the USB bus or from an external power supply.
PICDEM™ FS USB User’s Guide TABLE 1-1: PORTA<2:1> STATE COMBINATIONS AND THEIR MEANINGS PORTA<1> PORTA<2> Status 1 1 USB cable and power supply are both connected; board is self-powered, D8 is lit 1 0 USB cable is attached; board is bus-powered, D7 is lit 0 1 Power supply only is attached; board is self-powered, D8 is lit 0 0 N/A 1.4.3 USB Interface The PICDEM FS USB board utilizes the on-chip USB voltage regulator, transceivers and pull-up resistors of the PIC18F45K50 or PIC18F4550.
Introduction to the PICDEM™ FS USB Board 1.5 DEMO TOOL APPLICATION SOFTWARE Included with the demonstration board is the USB Demo Tool software. This simple graphic interface allows users to monitor and control simple board features, and provides the ability to reprogram the PIC18F45K50/PIC18F4550 controller via a bootloader demonstration. The overall operation of the host software, when interfacing with DM163025-based, out-of-box demo firmware, is discussed in Chapter 4.
PICDEM™ FS USB User’s Guide NOTES: DS51526C-page 18 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Chapter 2. Preprogrammed Firmware – DM163025-1 2.1 OVERVIEW Microchip provides a wide variety of USB related example firmware projects, PC application projects, drivers, and other related resources for developing complete USB peripheral and host devices. These resources are included in the MCHPFSUSB Framework distribution package. Note: This chapter is specific to the PICDEM™ FS USB Demo Board DM163025-1, when it is populated with the PIC18F45K50 microcontroller.
PICDEM™ FS USB User’s Guide FIGURE 2-1: Note: DS51526C-page 20 WINDOWS® XP DEVICE MANAGER ENTRIES (DEMO MODE) Lines indicate the new entries that appear because the device has been attached to the PC. 2004-2013 Microchip Technology Inc.
Preprogrammed Firmware 2.2 USING THE COMPOSITE HID+MSD CLASS DEMO FIRMWARE 2.2.1 MSD Interface The MSD (Mass Storage Device) interface displays the PIC18F45K50 in My Computer as a new drive volume, similar to a USB “thumb drive” Flash memory device. Upon successful enumeration in Demo mode, the new drive volume will display Readme.txt, a writable text file stored in the microcontroller’s Flash memory. For additional information, read the text file. 2.2.
PICDEM™ FS USB User’s Guide included in the MCHPFSUSB Framework. Assuming the MCHPFSUSB Framework has been installed in the default location, the source code for both the firmware and PC application are found in the following directory: C:\Microchip Solutions(date of release)\USB\Device - Composite HID + MSD The demo PC application can be used to toggle the LEDs on the demo board, determine the RB2 push button state and measure the analog voltage on the microcontroller’s RA0 I/O pin.
Preprogrammed Firmware 2. Plug the PIC18F45K50 into a free USB port. 3. Place the board in the Bootloader mode by pressing and holding down the S2 push button (RB2 I/O pin). While still holding down the S2 push button, momentarily press and release the MCLR push button (S1) to reset the device, keeping the S2 button depressed until after the device has come out of Reset.
PICDEM™ FS USB User’s Guide Programming a new firmware image using the bootloader does not erase or overwrite the bootloader firmware inside the microcontroller. To execute newly programmed firmware with the bootloader application, reset the microcontroller by pressing the MCLR (S1) push button. DS51526C-page 24 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Chapter 3. Getting Started with the PICDEM™ FS USB Board – DM163025 3.1 HIGHLIGHTS This chapter will cover the following topics: • Host Computer Requirements • Installing the Demonstration Board Note: 3.2 This chapter is specific to the PICDEM™ FS USB Demo Board DM163025, when it is populated with the PIC18F4550 microcontroller. For newer version PICDEM FS USB demo boards, populated with the PIC18F45K50, please refer to Chapter 2. “Preprogrammed Firmware – DM163025-1” instead.
PICDEM™ FS USB User’s Guide 3.3.1 Installing the MCHPFSUSB Software Package The software package that accompanies the PICDEM FS USB board contains all the software required to start using the board immediately. It includes the Demo Tool application, the Microchip general purpose (custom class) USB driver, the reference code projects and related documentation. To begin the installation process, log onto the host PC system with elevated user privileges, insert the CD and run the MCHPFSUSB_Setup_vX.X.
Getting Started with the PICDEM™ FS USB Board – DM163025 3.3.2 Connecting the PICDEM FS USB Board To connect the demonstration board : 1. Unbox and unwrap the board, and set it on a non-conductive surface near the host system. 2. Connect the USB cable (supplied in the kit) to an open USB port on the host system or a USB hub connected to the host system, and to the USB connector on the board. 3. Check the board. The green Power LED D7 should light up (if self-powered D8 should light up instead).
PICDEM™ FS USB User’s Guide After pointing the Found New Hardware Wizard to the .inf file in the MCHPUSB Driver Release directory, the rest of the driver installation process should be automatic. After the wizard completes, the new device should be visible in the device manager, and the hardware should be ready to be used with the PICDEM FS USB Demo Tool application. Figure 3-1 shows an example of how the device may appear in the device manager after driver installation.
Getting Started with the PICDEM™ FS USB Board – DM163025 3.3.4 Confirming Operation If Power LED D7 is lit (or D8, if an external power supply is being used) and the driver installation completed successfully, it can generally be assumed that the demonstration board’s hardware is working correctly. However, it may be useful to verify that the board can actually communicate with the host system using the Demo Tool application. To do this: 1.
PICDEM™ FS USB User’s Guide NOTES: DS51526C-page 30 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Chapter 4. Using the Demo Tool Application – DM163025 4.1 HIGHLIGHTS The items discussed in this chapter are: • • • • Software Overview Starting the Program Demo mode Bootload mode Note: 4.2 This chapter is specific to the PICDEM™ FS USB Demo Board DM163025, when it is populated with the PIC18F4550 microcontroller. For newer version PICDEM FS USB demo boards populated with the PIC18F45K50, please refer to Chapter 2. “Preprogrammed Firmware – DM163025-1” instead.
PICDEM™ FS USB User’s Guide 4.3 STARTING THE PROGRAM The demo board is shipped from the factory with the default demonstration firmware program and the bootloader. In the case that the demonstration program has been overwritten, you can restore the firmware by using the bootloader, or an external programmer, such as MPLAB ICD 3. To run the Demo Tool application, select All Programs > Microchip > MCHPFSUSB vX.X > Demo Executables > PDFSUSB from the Start menu.
Using the Demo Tool Application – DM163025 4.4 DEMO MODE The Demo mode provides a simple interface between the board and the host system to demonstrate USB connectivity. To start using the application, select “PICDEM FS USB 0 (Demo)” from the “Select PICDEM FS USB Board” dropdown box. Click the “Connect” button in the upper right hand corner. When the Demo Tool application successfully connects to the board, the message “USB Demo Firmware Version x.
PICDEM™ FS USB User’s Guide 4.5 BOOTLOAD MODE The Bootload mode provides a simple means of reprogramming the on-board microcontroller without using an external programming device. The PICDEM FS USB board is preprogrammed with a bootload program that allows designers to download and test new code through the Demo Tool application. This section describes the Bootload mode, as well as a brief overview of the architecture of the bootload program.
Using the Demo Tool Application – DM163025 Memory Spaces There are four memory spaces that the bootloader can access and program: • Program Memory (0x0800-0x7FFF) • User ID Memory (0x200000-0x200007) • EEPROM Memory (0x0F0000-0x0F00FF) • Configuration Memory (0x300000-0x30000D) The bootload also reads and displays the read-only Device ID Words at 0x3FFFFE and 0x3FFFFF. Note: The data EEPROM is actually located in a different memory space than shown here.
PICDEM™ FS USB User’s Guide 4.5.3 Using the Bootloader Once the board has been selected in the dropdown list, the bootloader control buttons become active (Figure 4-5). FIGURE 4-5: BOOTLOAD MODE CONTROLS • Load HEX File: This loads a hex file into the memory buffer and displays the content in the message window. The data loaded can be used to program a target device. A valid hex file must conform to the Intel® HEX 32 format. If an invalid file is selected, a warning message, “WARNING - No HEX file data.
Using the Demo Tool Application – DM163025 • Program Device: The program device function programs the target device with the data loaded in the memory buffer. Only the type of memory present in the memory buffer will be programmed. The function automatically erases the program memory (0x0800 to 0x7FFF) and user ID memory (0x200000 to 0x200007) before writing new data to these locations. Memory contents are verified after the write operation.
PICDEM™ FS USB User’s Guide FIGURE 4-6: CONFIGURATION CONFLICT WARNING DIALOG WITH TYPICAL DIAGNOSTIC MESSAGE When a file is loaded, either from a device or a file, the bootloader demo software also parses the file to determine if code is available for the different memory areas. If a device is programmed with that file, only those memory areas with code present are programmed; the other memory areas are left unchanged.
Using the Demo Tool Application – DM163025 EXAMPLE 4-1: ASSEMBLY LINKER SCRIPT FOR USE WITH BOOTLOADER // Sample linker command file for 18F4550 with Bootloader LIBPATH .
PICDEM™ FS USB User’s Guide EXAMPLE 4-3: C18 LINKER SCRIPT FOR USE WITH BOOTLOADER // Sample linker command file for 18F4550 with Bootloader LIBPATH . FILES c018i.o FILES clib.lib FILES p18f4550.
PICDEM™ FS USB USER’S GUIDE Chapter 5. Using the Microchip USB Firmware Framework 5.1 HIGHLIGHTS The items discussed in this chapter are: • Overview of the Framework 5.2 OVERVIEW OF THE FRAMEWORK The example code preprogrammed on the PICDEM™ FS USB Demo Board was created using the Microchip USB framework known as MCHPFSUSB.
PICDEM™ FS USB User’s Guide NOTES: DS51526C-page 42 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Chapter 6. Reconfiguring the PICDEM™ FS USB Hardware 6.1 HIGHLIGHTS This chapter covers the following: • Configuring the Demonstration Board Options • Restoring the PICDEM™ FS USB Firmware 6.2 CONFIGURING THE DEMONSTRATION BOARD OPTIONS The PICDEM FS USB board can be configured to enable or disable its various hardware features. A total of 16 jumper locations are controlled in various places around the board.
PICDEM™ FS USB User’s Guide FIGURE 6-1: 2 JUMPER LOCATIONS (TOP) AND TRACE LOCATIONS (BOTTOM) ON THE DEMONSTRATION BOARD 4 3 6 5 7 8 1 13 10 12 11 14 9 5 6 3 4 2 7 8 1 14 6.2.1 9 11 12 10 13 Serial Port Configuration The RS-232 serial port on the demonstration board incorporates hardware flow control with CTS and RTS for applications that require these control signalizes makes the port useful for developing a wide range of serial to USB translators.
Reconfiguring the PICDEM™ FS USB Hardware 6.2.2 Disabling the Temperature Sensor For the TC77 temperature sensor, each of the three lines that it uses to communicate with the controller are bridged with a separate jumper. Removing all three jumpers (JP10, JP11 and JP12) disables the sensor’s function, and makes all three controller ports available to the user. 6.2.
PICDEM™ FS USB User’s Guide As users develop their own USB applications, it is likely that the controller will be reprogrammed with new firmware. If the original firmware is replaced, the status LEDs and other interactive features of the board may no longer work as previously described. It is even possible that USB connectivity may become disabled.
PICDEM™ FS USB USER’S GUIDE Chapter 7. Troubleshooting 7.1 HIGHLIGHTS This chapter discusses the following: • Common issues with the PICDEM FS USB demonstration board and how to solve them 7.2 COMMON PROBLEMS 1. The Power LED is not lit. Normally, the PICDEM FS USB board behaves by default as a bus-powered device. If it is connected to a functioning USB port, the board will power-up and D7 will light.
PICDEM™ FS USB User’s Guide 3. The board is functioning, but has stopped communicating with the Demo Tool (DM163025). In Demo mode, press and release S1, then reselect the board from the dropdown menu and click on “Connect”. In Bootload mode, press and hold S2 while resetting the board (pressing and releasing S1), then reselect the board from the dropdown menu. 4. After switching from Demo mode to Bootload mode in the Demo Tool, the board is not available for selection in the dropdown list.
PICDEM™ FS USB USER’S GUIDE Appendix A. PICDEM™ FS USB Board Technical Information A.1 HIGHLIGHTS This chapter will cover the following topics: • PICDEM FS USB Block Diagram • PICDEM FS USB Board Schematics A.
PICDEM™ FS USB User’s Guide A.3 PICDEM FS USB BOARD SCHEMATICS FIGURE A-2: DS51526C-page 50 BOARD SCHEMATIC (DM163025), PART 1 (MICROCONTROLLER, VOLTAGE REGULATION AND ASSOCIATED PARTS) 2004-2013 Microchip Technology Inc.
FIGURE A-3: BOARD SCHEMATIC (DM163025), PART 2 (USART, USB INTERFACE, THERMAL SENSOR AND STATUS LEDS) 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB User’s Guide BOARD SCHEMATIC (DM163025), PART 3 (CONFIGURATION JUMPERS, PICkit™ HEADERS AND OPTIONAL MPLAB® ICE HEADER) PICtail™ Interface FIGURE A-4: DS51526C-page 52 2004-2013 Microchip Technology Inc.
FIGURE A-5: BOARD SCHEMATIC (DM163025-1), PART 1 PICkit™ 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB User’s Guide FIGURE A-6: DS51526C-page 54 BOARD SCHEMATIC (DM163025-1), PART 2 2004-2013 Microchip Technology Inc.
TABLE A-1: SIGNALS USED IN THE PICDEM™ FS USB SCHEMATIC Signal Name Function CHP_MCLR Hardware Master Clear signal (direct connection to MCLR pin of microcontroller) ICPGC, ICPGD, ICRST Dedicated ICD port clock, data and chip Reset signals ICD_RB6, ICD_RB7 Legacy ICD port signals (PGC and PGD) MCLR Hardware Master Clear signal OSC1, OSC2 External oscillator input for the microcontroller RESET Generic chip Reset signal (routable to MCLR or ICRST) RXn Bit n of microcontroller PORTx USB_D+, U
PICDEM™ FS USB User’s Guide NOTES: DS51526C-page 56 2004-2013 Microchip Technology Inc.
PICDEM™ FS USB USER’S GUIDE Index B J Block Diagrams PICDEM FS USB Board ................................... 49 Bootload Mode ......................................................... 34 Using................................................................. 36 Bootloader and Writing Application Code ........................... 38 Considerations in Using .................................... 37 Program Memory Map ...................................... 35 Jumper Descriptions and Locations ..................
Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.
Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Microchip: DM163025-1