SK-S12XDP512-A Quickstart Tutorial The power connector accepts a 12 V DC, wall plug-in power supply with a 2.1 mm pin and sleeve plug with positive in the center and sleeve as ground. Make sure the “VDD ENA” jumper is inserted. The voltage is internally regulated to 5.0 V DC. The SofTec Microsystems Additional Components install all of the other required components to your hard drive. These components include the Starter Kit USB driver, the software plug-in for CodeWarrior, examples and documentation in PDF format. The green “POWER” LED on the board should turn on. To install the SofTec Microsystems Additional Components, insert the SofTec Microsystems “System Software” CD-ROM into your computer’s CD-ROM drive. A startup window will automatically appear. Choose “Install Instrument Software” from the main menu. A list of available software will appear. Click on the “SKS12XDP512-A Starter Kit Additional Components” option. Follow the on-screen instructions. CAN1 CAN2 CAN3 LIN1 MASTER NODE0 ENA CAN4 CAN1_TX ENA CAN4_TX ENA LIN3 CAN0_RX ENA CAN1_RX ENA CAN4_RX ENA MASTER NODE1 ENA MASTER NODE3 ENA CAN2_TX ENA CAN2_RX ENA U401 12V LIN NETWORK TRANSCEIVER SUPPLY SEL CAN2_RX ENA U401 U406 CANH0 SEL U402 LIN2_RX ENA LIN4_TX ENA LIN4_RX ENA LIN5_TX ENA LIN5_RX ENA LIN OUTPUTS U402 PA6 PA5 PA4 PA3 PA2 PA1 PA0 ROW ENA U407 CAN LIN LIN RS-232 RS-232 CAN RS-232_1/ LIN1 SEL BDM 6 Found New Hardware Wizard The first time the Starter Kit 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. LIN5_RX ENA LIN GND LIN LIN LIN RS-232 RS-232 CAN RS-232_0/ LIN0 SEL RESET RS-232_1/ LIN1 SEL CAN3/ LIN3 SEL SERIAL SETTINGS PROTOTYPE AREA PB3 PB2 PB1 PB0 Freescale code: EVB9S12XDP512 CLOCK SofTec Microsystems code: SK-S12XDP512-A OSC SEL CLOCK XCLKS#=0 BKGD ENA LOOP FILTER MCU SET USER MCU VDDA MODA=1 MODB=1 XFC SEL INPUTS VRL SEL 1 0 MODC 0 ENA PAD10 CAN3/ LIN3 SEL 12V I/O LVD ENA 1 VREGEN GND RESET ENA PAD11 PB7 PB6 PB5 PB4 FLEXRAY RESET HCS12X STARTER KIT GND www.freescale.com Run CodeWarrior and Open the Example Make sure that all of the Starter Kit’s jumpers are set to their factory position. Start the CodeWarrior for HC9S12X/XGATE IDE by selecting Start > Programs > Metrowerks CodeWarrior > CW for HCS12X > CodeWarrior IDE. The CodeWarrior IDE will open. From the main menu, choose “File > Open”. Select the “Demo.mcp” workspace file that is located under the “\Program Files\Metrowerks\CW for HCS12X\(CodeWarrior_Examples)\ HCS12X\SofTec Microsystems\SK-S12XDP512-A\Demo” directory. Click “Open”. Note: both Windows 2000 and Windows XP may issue a warning during the “Found New Hardware Wizard” procedure. This warning is related to the fact that the USB driver used by the Starter Kit 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. SofTec Microsystems code: SK-S12XDP512-A CLOCK LIN5_TX ENA LOGIC www.softecmicro.com PROTOTYPE AREA USB ATD REF USER Freescale code: EVB9S12XDP512 CLOCK LIN4_RX ENA OUTPUTS CRYSTAL GND POWER CRYSTAL LIN4_TX ENA POWER 12V USER PB3 PB2 PB1 PB0 OSC SEL LIN2_RX ENA VDD VRH SEL LOGIC GND LIN2_TX ENA GND PA6 PA5 PA4 PA3 PA2 PA1 PA0 CAN GND VDD POWER SUPPLY U407 SCI1 DTE/ DCE SEL RESET ENA VDD ENA 12V LIN SUPPLY ENA JTAG U402 DTE SCI0 DTE/ DCE SEL RS-232 COL ENA CANH1 SEL DCE DTE VDD ENA BDM SERIAL SETTINGS JTAG CANH1 SEL LIN CANH0 SEL USB TO BDM GND RS-232_0/ LIN0 SEL RESET GND COL ENA U402 U407 CANL1 SEL LIN2_TX ENA LED ENA U406 PD4 PD3 PD2 PD1 PD0 U401 CANL0 SEL RS-232 LIN SUPPLY ENA PC4 PC3 PC2 PC1 PC0 CAN2_TX ENA DTE SCI1 DTE/ DCE SEL U406 CANL1 SEL DCE SCI0 DTE/ DCE SEL U401 U406 CANL0 SEL Be sure not to specify any drive or optional location where to look for the driver, since it has already been installed on your hard disk by the SK-S12XDP512-A Starter Kit Additional Components setup. DTE LIN NETWORK TRANSCEIVER SUPPLY SEL RS-232_1 DCE MASTER NODE5 ENA CAN4_RX ENA CRYSTAL RS-232_1 DCE MASTER NODE5 ENA MASTER NODE3 ENA MC9S12XDP512 LIN5 MASTER NODE4 ENA LIN5 MASTER NODE4 ENA USB LIN4 MASTER NODE2 ENA CAN1_RX ENA MASTER NODE1 ENA GND 5 RS-232_0 CAN0_TX ENA LIN4 LIN3 MASTER NODE2 ENA 12V The procedure is slightly different on each version of Windows. On Windows XP, select the “Install the software automatically” option and click on the “Next” button. CAN0 CAN4_TX ENA POWER SUPPLY Insert the other end of the USB cable into the USB connector on the Starter Kit board. GND LIN1 MASTER NODE0 ENA CAN4 RS-232_0 CAN0_RX ENA Note: to install the SK-S12XDP512-A Starter Kit Additional Components on Windows 2000 or Windows XP, you must log in as Administrator. Insert one end of the USB cable into a free USB port. LIN2 CAN3 CAN1_TX ENA CAN0_TX ENA U407 Note: the Starter Kit requires that a CodeWarrior version equal to or greater than 4.1 is present on your system. If you have an earlier version on your system, you must uninstall it and install the new CodeWarrior version which comes with the Starter Kit. If you purchased an earlier CodeWarrior version, we advise you to contact Metrowerks to have your license extended to the new version. LIN0 CAN1 CAN2 12V To install the CodeWarrior Development Studio Special Edition, insert the CodeWarrior CD-ROM into your computer’s CD-ROM drive. A startup window will automatically appear. Follow the on-screen instructions. LIN2 LIN0 CAN0 GND LED ENA CodeWarrior Development Studio for HC9S12X/XGATE Microcontrollers, Special Edition, includes the CodeWarrior integrated development environment (IDE); 32 KB code-size limited C compiler and C source-level debugger; macro assembler and Assembly-level debugger. The Special Edition allows you to evaluate CodeWarrior Development Studio for HC9S12X/XGATE Microcontrollers at no cost. Connect the Board to the PC Power up the Board PC4 PC3 PC2 PC1 PC0 The Starter Kit comes with a free version of CodeWarrior Development Studio for HC9S12X/XGATE Microcontrollers, Special Edition. 4 3 Install Additional Components PD4 PD3 PD2 PD1 PD0 2 Install CodeWarrior Development Studio ROW ENA 1 The C code of this example is contained in the “main.c” file. Double click on it to open it. XCLKS#=0 CRYSTAL MC9S12XDP512 RESET ENA BKGD ENA USER LOOP FILTER MCU SET USER MCU VDDA MODA=1 MODB=1 XFC SEL INPUTS ENA VRH SEL 1 1 USER 0 0 VRL SEL MODC VREGEN ENA PAD10 LVD ENA I/O PAD11 PB7 PB6 PB5 PB4 RESET FLEXRAY HCS12X STARTER KIT Start a Debugging Session 8 9 Run the Example From the main menu, choose “Project > Debug”. This will compile the source code, generate an executable file and will download it to the demo board. From the main menu, choose “Run > Start/Continue”. The program will be executed in real-time. A new debugger environment will open. Press the “PB4” push-button. The output of the light sensor will be displayed on the two dot-matrix displays, in a graphic way. The light sensor is placed on the right of the “PB4” push-button. Cover the sensor with a finger and see the effect on the displays. CAN1 CAN2 GND LIN2 LIN0 CAN0 CAN3 LIN1 MASTER NODE0 ENA CAN4 LIN3 MASTER NODE2 ENA LIN5 MASTER NODE4 ENA CAN0_RX ENA CAN4_TX ENA CAN1_RX ENA MASTER NODE1 ENA MASTER NODE3 ENA 12V CAN2_RX ENA U401 U401 U406 CANH0 SEL U402 LIN2_RX ENA LIN4_TX ENA LIN4_RX ENA LIN5_TX ENA LIN5_RX ENA LIN OUTPUTS U407 PA6 PA5 PA4 PA3 PA2 PA1 PA0 CAN SCI1 DTE/ DCE SEL GND LIN LIN LIN RS-232 RS-232 CAN RS-232_1/ LIN1 SEL CAN3/ LIN3 SEL SERIAL SETTINGS JTAG CANH1 SEL DTE SCI0 DTE/ DCE SEL RS-232_0/ LIN0 SEL RESET GND COL ENA U402 U407 CANL1 SEL LIN2_TX ENA PROTOTYPE AREA VDD PB3 PB2 PB1 PB0 LED ENA U406 CANL0 SEL LIN SUPPLY ENA LOGIC VDD ENA POWER 12V Freescale code: EVB9S12XDP512 CRYSTAL GND CLOCK SofTec Microsystems code: SK-S12XDP512-A OSC SEL CLOCK 12V POWER SUPPLY USB XCLKS#=0 CRYSTAL MC9S12XDP512 RESET ENA USB TO BDM BDM GND ATD REF BKGD ENA USER MCU VDDA USER LOOP FILTER MCU SET MODA=1 MODB=1 XFC SEL INPUTS GND USER BDM VRL SEL 1 0 MODC LVD ENA 1 0 VREGEN ENA PAD10 PAD11 PB7 PB6 PB5 PB4 www.softecmicro.com RESET For the latest software releases, new products, new supported devices, discussion forums and FAQs, log on to GND RESET ENA VRH SEL For an in-depth guide of all of the user interface features, select Help > CodeWarrior Help from the CodeWarrior IDE’s main menu. DCE DTE RS-232 PC4 PC3 PC2 PC1 PC0 LIN NETWORK TRANSCEIVER SUPPLY SEL You have successfully completed this tutorial! You can continue to experiment with the CodeWarrior user interface and discover by yourself its potentialities. RS-232_1 DCE MASTER NODE5 ENA CAN4_RX ENA CAN2_TX ENA Congratulations! Please also read carefully all of the Starter Kit documentation. LIN4 RS-232_0 CAN1_TX ENA CAN0_TX ENA PD4 PD3 PD2 PD1 PD0 7 GND www.freescale.com ROW ENA BDM GND GND RESET I/O FLEXRAY HCS12X STARTER KIT GND www.freescale.com http://www.softecmicro.com/ Microcontroller Development Tools www.softecmicro.com Copyright © 2005 SofTec Microsystems®. DC00847 ATD REF GND Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. Other products and company names are trademarks or trade names of their respective companies. BDM Designed by USB TO BDM www.softecmicro.com Microcontroller Development Tools