DEMO9RS08KA8 Demonstration Board for Freescale MC9RS08KA8 User's Manual DEMO9RS08KA8 Demonstration Board for Freescale MC9RS08KA8 (20-Pin DIP) User's Manual Revision 1.1 Copyright (c) 2007 SofTec Microsystems(R) DC01491 We want your feedback! SofTec Microsystems is always on the look-out for new ways to improve its Products and Services. For this reason feedback, comments, suggestions or criticisms, however small, are always welcome. Our policy at SofTec Microsystems is to comply with all applicable worldwide safety and EMC/EMI regulations. Our products are certified to comply to the European New Approach Directives and the CE mark is applied on all our products. This product as shipped from the factory has been verified to meet with requirements FCC as a CLASS A product. This product is designed and intended for use as a development platform for hardware or software in an educational or professional laboratory. In a domestic environment, this product may cause radio interference in which case the user may be required to take adequate prevention measures. Attaching additional wiring to this product or modifying the product operation from the factory default as shipped may effect its performance and cause interference with other apparatus in the immediate vicinity. If such interference is detected, suitable mitigating measures should be taken. SofTec Microsystems E-mail (general information): info@softecmicro.com E-mail (technical support): support@softecmicro.com Web: http://www.softecmicro.com Important SofTec Microsystems reserves the right to make improvements to this product, its documentation and software routines, without notice. Information in this manual is intended to be accurate and reliable. However, SofTec Microsystems assumes no responsibility for its use; nor for any infringements of rights of third parties which may result from its use. SOFTEC MICROSYSTEMS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. Trademarks SofTec Microsystems is a registered trademark of SofTec Microsystems. FreescaleTM and the Freescale logo are trademarks of Freescale Semiconductor, Inc. Microsoft and Windows are trademarks or registered trademarks of Microsoft Corporation. PC is a registered trademark of International Business Machines Corporation. Other products and company names listed are trademarks or trade names of their respective companies. DEMO9RS08KA8 User's Manual Contents 1 2 Introduction 5 1.1 Overview 5 1.2 Package Contents 5 1.3 Supported Devices 5 1.4 Recommended Reading 5 Hardware Features 7 2.1 3 4 5 6 7 8 Demonstration Board Features 7 Software Setup 9 3.1 Overview 9 3.2 Host System Requirements 9 3.3 Installing CodeWarrior Development Studio 9 3.4 Installing SofTec Microsystems Additional Components 10 Hardware Setup 11 4.1 First Connection 11 4.2 Power Supply 13 Operating Modes 15 5.1 Overview 15 5.2 Standalone Mode 15 5.3 Host Mode 15 Application Tutorial 17 6.1 Overview 17 6.2 Step-by-Step Tutorial 17 Summary of Jumper and Connector Settings 19 7.1 Jumpers 19 7.2 Connectors 20 Troubleshooting 23 8.1 USB Driver Problems 23 8.2 Communication Problems between the PC and the Demo Board 23 Page 3 DEMO9RS08KA8 User's Manual 1 Introduction 1.1 Overview The DEMO9RS08KA8 Demonstration board has been designed for the evaluation, demonstration and the debugging of the Freescale MC9RS08KA8 microcontroller. The DEMO9RS08KA8 can be used as a standalone application, or via its built-in USB-to-BDM bridge, or together the Freescale Student Learning Kit (Freescale code: MCUSLK) through an external 36-pin I/O female header connector. 1.2 Package Contents The DEMO9RS08KA8 package includes the following items: The DEMO9RS08KA8 board (composed by the DEMO9RS08SA12/KA8 board + the DB9RS08KA8 adapter, already plugged in); A USB cable; The SofTec Microsystems "System Software" CD-ROM; The CodeWarrior Development Studio Special Edition CD-ROM; A Quick Start Guide sheet; A registration card; This user's manual. 1.3 Supported Devices The DEMO9RS08KA8 Demonstration Board supports the following devices: MC9RS08KA8; MC9RS08KA4. 1.4 Recommended Reading Freescale RS08 microcontroller-specific datasheets; DEMO9RS08KA8 Schematic. Page 5 Introduction Page 6 DEMO9RS08KA8 User's Manual 2 Hardware Features 2.1 Demonstration Board Features The DEMO9RS08KA8 board features: A MC9RS08KA8 microcontroller (in 20-Pin DIP package, already programmed with a demo application); A provision for a low-frequency crystal; A 12 V DC power supply input connector; Power input selection jumper for selecting the input voltage source: o 12 V DC input connector; o USB connector. A built-in USB-to-BDM circuitry which allows the host PC to communicate with the microcontroller through a standard USB interface. When using an external in-circuit debugger (via the "BDM" connector), the USB-to-BDM circuitry must be bypassed by removing the BKGD and RESET# jumpers. A Reset push-button connected to the MCU Reset pin. A series of inputs: o Two push-buttons, together with jumpers to connect/disconnect them to/from the microcontroller; o A potentiometer, together with a jumper to connect/disconnect it to/from the microcontroller; o A photoresistor, together with a jumper to connect/disconnect it to/from the microcontroller. Two LEDs together with jumpers to connect/disconnect them to/from the microcontroller; An RS-232 transceiver (with a DB9 female connector), together with jumpers to connect/disconnect them to/from the microcontroller; A 36-pin I/O female header connector on the bottom of the board. Page 7 Hardware Features The DEMO9RS08KA8 Demonstration Board Page 8 DEMO9RS08KA8 User's Manual 3 Software Setup 3.1 Overview i Note: before connecting the Demonstration Board to the PC, it is recommended that you install all of the required software first (see below), so that the appropriate USB driver will be automatically found by Windows when you connect the Demonstration Board. The Demonstration Board requires that both CodeWarrior Development Studio Special Edition and SofTec Microsystems Additional Components be installed in the host PC. i Note: CodeWarrior Development Studio for HCS08 must be installed first. 3.2 Host System Requirements The Demonstration Board is controlled by CodeWarrior Development Studio. The following hardware and software are required to run the CodeWarrior user interface together with the Demonstration Board: A 200-MHz (or higher) PC compatible system running Windows 98, Windows 2000 or Windows XP; 128 MB of available system RAM plus 1 GB of available hard disk space; A USB port; CD-ROM drive for installation. 3.3 Installing CodeWarrior Development Studio To install the CodeWarrior Development Studio Special Edition, insert the CodeWarrior CDROM into your computer's CD-ROM drive. A startup window will automatically appear. Follow the on-screen instructions. Page 9 Software Setup If present, make sure to install all available service packs or other components for the MC9RS08KA8, available either on the CodeWarrior CD or on the Freescale website (www.freescale.com). 3.4 Installing SofTec Microsystems Additional Components The SofTec Microsystems "System Software" CD-ROM contains other required components to your hard drive. These components include: SofTec Microsystems DLL for DEMO9RS08KA8 support; Examples; Demonstration Board's user's manual; Demonstration Board's schematic; Additional documentation. To install the required components, do the following: 1. Insert the SofTec Microsystems "System Software" CD-ROM into your computer's CDROM drive. A startup window will automatically appear. 2. Choose "Install Instrument Software" from the main menu. 3. Click on the "Copy SofTec Microsystems DLL to \CodeWarrior for Microcontrollers V6.1\prog\gdi" option. An Explorer window will open. Copy the "inDART_RS08.dll" file to your PC in the "\CodeWarrior for Microcontrollers V6.1\prog\gdi" folder, relative to the CodeWarrior installation path. 4. Click on the "Copy examples for CW08 V6.1" option. An Explorer window will open. Copy the "DEMO9RS08KA8" folder to your PC, in a location of your choice. These are the examples specific for the demonstration board, and will be used later in the step-bystep tutorial. i Page 10 Note: to install the Additional Components on Windows 2000 or Windows XP, you must log in as Administrator. DEMO9RS08KA8 User's Manual 4 Hardware Setup 4.1 First Connection The Demonstration Board connects to a host PC through a USB port. Connection steps are listed below in the recommended flow order: 1. Install all the required system software as described in the previous section. 2. Make sure the "POWER SEL" jumper is in the "USB" position. 3. Insert one end of the USB cable into a free USB port. 4. Insert the other end of the USB cable into the USB connector on the Demonstration Board. 5. The first time the Demonstration Board is connected to the PC, Windows recognizes the instrument and starts the "Found New Hardware Wizard" procedure, asking you to specify the driver to use for the instrument. On Windows XP (SP2) the following dialog box will appear. Select the "No, not this time" option and click the "Next >" button. 6. The following dialog box will appear. Page 11 Hardware Setup Click the "Next >" button. 7. Depending on your Windows settings, the following warning may appear. i Note: this warning is related to the fact that the USB driver used by the Demonstration Board is not digitally signed by Microsoft, and Windows considers it to be potentially malfunctioning or dangerous for the system. However, you can safely ignore the warning, since every kind of compatibility/security test has been carried out by SofTec Microsystems. Click the "Continue Anyway" button. 8. Windows will install the driver files to your system. At the end of the installation, the following dialog box will appear. Page 12 DEMO9RS08KA8 User's Manual Click the "Finish" button to exit from the "Found New Hardware Wizard" procedure. 9. The Demonstration Board's USB driver is now installed on your system. 4.2 Power Supply The Demonstration Board can be powered in three ways: 12 V DC input connector; USB connector; I/O header connector. The "POWER SEL" jumper allows you to power the board through either the 12 V DC input connector or the USB connector. Page 13 DEMO9RS08KA8 User's Manual 5 Operating Modes 5.1 Overview The Demonstration Board can work in two modes: "standalone" mode and "host" mode. 5.2 Standalone Mode In standalone mode, no PC connection is required. The microcontroller is factory programmed with a sample application. To run the built-in example: 1. Ensure that all of the "ENABLE" jumpers in the "MCU AND I/O" area are inserted. 2. Ensure that all of the "ENABLE" jumpers in the "SERIAL" area are inserted. 3. Ensure that the "POWER SEL" jumper selects the "UNREG" position. 4. Power on the Demonstration Board through the 12 V DC plug-in power supply. 5. The green "POWER" LED on the board should turn on. 6. Press the "SW0" push-button. Rotate the potentiometer. The "LED0" will blink with a frequency related to the potentiometer value. 7. Press the "SW1" push-button. The "LED1" will blink with a frequency related to amount of light hitting the photoresistor. 8. The value of the potentiometer or the light sensor is also sent to the RS-232 port (baud rate = 9600, data bits = 8, parity = N, stop bits = 1). 5.3 Host Mode In host mode the program execution is controlled by the host PC through the "USB" connector. You can use the PC to debug the application by, for example, executing the program step by step and watching how the microcontroller registers vary, using the provided CodeWarrior Development Studio. Page 15 Operating Modes i Note: all MCUs in the RS08 family contain a single-wire background debug interface which supports in-circuit programming of on-chip nonvolatile memory. This system does not interfere with normal application resources. It does not use any user memory or locations in the memory map. The Background Debug Module (BDM) uses a single-wire communication interface (via the BKGD line) to allow non-intrusive access to target system memory and registers. To work in host mode (using the built-in USB to BDM interface): Make sure that both the "RESET#" and "BKGD" jumpers (in the "USB TO BDM INTERFACE" area) are inserted. Make sure that the "POWER SEL" jumper is in the "USB" position. Connect the host PC to the board through the provided USB cable. Page 16 DEMO9RS08KA8 User's Manual 6 Application Tutorial 6.1 Overview This section will provide a step-by-step guide on how to launch your first project and get started with the CodeWarrior for HCS08 user interface. 6.2 Step-by-Step Tutorial The sample application is the same as the one described in the "Standalone Mode" section above. 1. Ensure that the Demonstration Board is connected to the PC (via the USB cable) and that the board is powered on. 2. Make sure that all of the Demonstration Board jumpers are set to their factory position (see chapter "7.1 Jumpers" for details). 3. Start CodeWarrior by selecting it in the Windows Start menu. 4. From the CodeWarrior main menu, choose "File > Open" and choose the "DEMO9RS08KA8\C\Demo\Demo.mcp" file. This is the board example you copied from the SofTec Microsystems "System Software" CD-ROM. 5. Click "Open". The Project window will open. 6. The C code of this example is contained in the "main.c" file. Double click on it to open it. 7. From the main menu, choose "Project > Debug". This will compile the source code, generate an executable file and download it to the demo board. 8. A new debugger environment will open. From the main menu, choose "Run > Start/Continue". The program will be executed in real-time. 9. From the main menu, choose "Run > Halt". The program execution will stop. The next instruction to be executed is highlighted in the Source window. 10. From the main menu, choose "Run > Single Step". The instruction highlighted in the Source window will be executed, and the program execution will be stopped immediately after. 11. From the main menu, choose "Run > Start/Continue". The application will restart from where it was previously stopped. Congratulations! You have successfully completed this tutorial! You can continue to experiment with the CodeWarrior user interface and discover by yourself its potentialities. For an in-depth guide of all of the user interface features, select "Help > CodeWarrior Help" from CodeWarrior Development Studio's main menu. Page 17 DEMO9RS08KA8 User's Manual 7 Summary of Jumper and Connector Settings 7.1 Jumpers Name J102 Reference 1 PTB6 Description/Pinout I/O ENABLE PTB7 PTC0 Installed: PTC1 PTA0 PTA1 Not Installed: PTA2 Each jumper enables the I/O function connected to the indicated microcontroller pin (default) The indicated microcontroller pin is not connected to any I/O function PTA3 PTA5 J302 1 BKGD BDM ENABLE RESET# All installed: Not Installed: J402 The USB to BDM interface is enabled (default) The USB to BDM interface is disabled POWER SELECTION 1 2 1-2 ("USB"): 3 2-3 ("UNREG"): J403 1 PTB0 (RX) The power supply is taken from the USB connector (default) The power supply is taken from the power supply connector (J401) RS-232 ENABLE PTB1 (TX) All installed: Not Installed: The microcontroller's PTB0/RXD and PTB1/TXD lines are routed to the RS232 transceiver (default) The RS-232 transceiver is not connected to the microcontroller Page 19 Summary of Jumper and Connector Settings 7.2 Connectors Name J101 Page 20 Reference 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Description/Pinout 36-Pin I/O Female Header Connector 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. VDD (5.0 V) PTA4 GND PTA5 PTB6 PTB4 PTB7 PTB5 PTD0 PTA0 PTD1 PTA1 PTD2 PTA2 PTD3 PTA3 PTD4 PTB0 PTD5 PTB1 PTA6 PTB2 PTA7 PTB3 PTC4 PTC0 PTC5 PTC1 PTC6 PTC2 PTC7 PTC3 N.C. N.C. N.C. N.C. DEMO9RS08KA8 User's Manual Name Reference J103 1 2 3 4 5 6 J301 Description/Pinout BDM Connector (Not Populated) 1. 2. 3. 4. 5. 6. USB Connector 1. 2. 3. 4. J401 PTA4 (BKGD) GND N.C. PTA5 (RESET#/VPP) N.C. VDD 2 5 V DC USB Bus Power Supply Line USB DUSB D+ GND 9/12 V DC Power Supply Input Connector 1 1. 2. J404 9/12 V DC GND RS-232 Connector 9 5 6 1 1. 2. 3. 4. 5. 6. 7. 8. 9. N.C. TX RX N.C. GND N.C. N.C. N.C. N.C. Page 21 DEMO9RS08KA8 User's Manual 8 Troubleshooting 8.1 USB Driver Problems If you connected the Demonstration Board to the PC before installing the SofTec Microsystems Additional Components, the Demonstration Board's USB driver may not have been correctly installed on your system. Unplugging and replugging the USB cable is of no use, since Windows has marked the device as "disabled". As a consequence, the PC cannot communicate with the Demonstration Board. To restore the USB driver (provided the SofTec Microsystems Additional Components have been installed), perform the following steps under Windows XP: 1. Connect the Demonstration Board to the PC. 2. Open the Control Panel (Start > Settings > Control Panel). 3. Open the "System" options. 4. Select the "Hardware" tab. 5. Click the "Device Manager" button. 6. The "uDART In-Circuit Debugger" device will be shown with an exclamation mark next to it. Double click on this device. 7. In the "General" tab, click the "Reinstall Driver" button. Follow the on-screen instructions. 8.2 Communication Problems between the PC and the Demo Board 1. Make sure that both the "BKGD" and "RESET#" jumpers are inserted. 2. Make sure that the "POWER SEL" jumper selects the appropriate power source (typically "USB" when the board is connected to the PC). Page 23