ETC EVB9S12NE64QSG

Freescale Semiconductor
Quick Start Guide
Rev. 0.1, 06/29/2004
EVB9S12NE64 Demo
Quick Start Guide
Introduction and Default Settings
This kit and guide contains everything you need to get started. You will connect the board to your PC, run
the pre-programmed Startup Demo, install the correct version of CodeWarrior, and load and play the
demo game, called “The Connector.” Source code for both demos and the Serial Monitor are provided on
the MC9S12NE64 Resource CD. Figure 1 contains diagrams of the power jack and port, the fuse (FZ1),
and all default settings of the EVB9S12NE64 evaluation board. These settings are necessary for the
pre-programmed Startup Demo to work properly. Please refer to the EVB9S12NE64 User's Guide on the
MC9S12NE64 Resource CD provided for information on other configurations, other ports, etc. Black
blocks indicate “on” positions of jumpers or switches. All diagrams in this guide are oriented with the PWR
JACK, in the upper left hand corner. All other ports are open (no jumpers). The board comes with the
default settings already set. You may check the settings or continue.
Figure 1. Default Settings for EVB9S12NE64
Connect the EVB9S12NE64 to your computer and apply power
1. Connect one end of the Crossover Ethernet cable provided to the J1 Ethernet Connector of the
EVB board. Connect the other end to the Ethernet port of your host PC.
2.
Connect the 9-pin serial cable provided to the COM1 port of the EVB board. Connect the other end
to a COM port on your host PC.
3.
There are two ways to apply power to the EVB: via the power jack or the power port. Refer to the
EVB9S12NE64 User's Guide about using the power port. Otherwise, plug the wall plug power
supply provided into a power outlet and install the barrel connector into the PWR JACK on the EVB
board. If you are not using the original adapter supplied, please refer to the specs in the diagram
above for the PWR JACK.
4.
Set the EVB board RUN/LOAD switch to the RUN position.
5.
Turn the PWR_SW switch ON. The +V, +3.3V, and +5V LEDs should come on. Either LED1 or
LED2 (not both) should turn on as well, indicating that you are in Test1 of the Startup Demo.
© Freescale Semiconductor, Inc., 2004. All rights reserved.
Introduction and Default Settings
Run the Startup Demo program
The EVB9S12NE64 is shipped with the Startup Demo already stored in on-chip flash memory as
mentioned before. You may view the source code for this demo provided on the supplied MC9S12NE64
Resource CD as zip file, “Startup_Demo.zip.” To run through this demo, follow the instructions below:
1.
Test1, Analog Input: With default settings set and the PWR_SW in the ON position, either LED1
or LED2 should be on. You are in Test1 of the Startup Demo. Turn the RV1 user potentiometer to
blink LED1 and LED2 alternately. This test uses the output of the Analog to Digital Converter (ATD)
on the MC9S12NE64. By turning the RV1 user potentiometer, you are adjusting the ATD input.
Press the button labeled “SW2” to move on to Test2.
2.
Test2, Switch: Both LED1 and LED2 should light up. Press SW2 to turn off LED2, and let go to
turn it back on. Press SW1 to move on to Test3.
3.
Test3, Ethernet/Ping: LED1 should turn off. Soon after, the board should obtain an Ethernet
connection and turn on the LINK LED. You will now need to configure the IP address for the PC.
Please follow the directions below.
Set the PC's IP address and the Ping Test
The ping test will verify that the PC is communicating with the EVB board through the Ethernet Crossover
cable, provided in the kit, but you must first set the PC's IP address to one that is compatible with the
board's IP address. For this demo, you will set the PC's IP address to 192.168.2.1. The board's IP address
is currently set at 192.168.2.3. The mask for both should be 255.255.255.0.
1.
Board's IP address: The board's IP address is already preset to 192.168.2.3 and mask to
255.255.255.0. They can be changed later, by changing the “prot_addr” and “netw_mask” entries
respectively, in the address.c source file of the Startup Demo project, Startup_Demo.mcp.
2.
PC's IP Address: Setting the PC's IP address using Windows XP (similar in other Windows
platforms; see Figure 2):
a.
b.
c.
d.
e.
On your PC, go to Start -> Settings -> Control Panel -> Network Connections -> Local Area
Connection.
In the “Local Area Connection Status” window, click on “Properties.”
In the “Local Area Connection Properties” window, click on “Internet Protocol (TCP/IP)” to
highlight it, and click “Properties”, or just double click it.
In the “Internet Protocol (TCP/IP) Properties” window, select “Use the following IP address”
and type in 192.168.2.1 for the IP address and 255.255.255.0 for the subnet mask. Notice the
PC's IP address is exactly like the board's IP address but with the fourth number slightly
different. Click OK, OK, and Close.
To later return your LAN setting to normal, repeat steps 2a) -2c), select “Obtain an IP..” and
click OK.
EVB9S12NE64 Demo, Rev. 0.1
2
Freescale Semiconductor
Introduction and Default Settings
e (to return to normal LAN settings)
a
b and c
d
Figure 2. Setting the PC’s IP Address
3.
Ping Test:
a.
b.
c.
Open a DOS command window (in Windows by clicking Start -> Run, typing “cmd”, and
clicking OK).
In this black window, type “ipconfig” to verify that your PC IP address and mask has changed
(i.e., to 192.168.2.1 and 255.255.255.0).
Now ping the board by typing “ping,” followed by the board's IP address and the enter key, i.e.,
“ping 192.168.2.3" and <enter>. If the PC and board have a connection and are
communicating, you will see something like:
Pinging 192.168.2.3 with 32 bytes of data:
Reply from 192.168. 2.3: bytes=32 time=1ms
Reply from 192.168. 2.3: bytes=32 time=1ms
d.
TTL=127
TTL=127
. . .
If communication could not be established, see “Reasons Why the Ping Test might fail.”
Install CodeWarrior Development Studio Version 3.1 for HC(S)12
If you do not have Version 3.1 of CodeWarrior for HC(S)12 installed on your computer, please refer to the
provided “CodeWarrior Development Studio for Motorola” CD for HC(S)12 Special Edition Version 3.1
and the included CodeWarrior Quick Start. Important: You must register and obtain the special edition
license key, which will allow you to experience all the features of the CodeWarrior debugger (see install,
register, and license key instructions in the CodeWarrior Quick Start). Be sure to select “CodeWarrior
Special for HC12 Release 3.1” under “Product Name” in the registration window. To begin a new
MC9S12NE64 project in CodeWarrior, please be sure to install the CodeWarrior service pack (CD is
included in the kit) that includes all stationery files for the MC9S12NE64.
EVB9S12NE64 Demo, Rev. 0.1
Freescale Semiconductor
3
Introduction and Default Settings
Use the Serial Monitor to Program the MC9S12NE64 Connector Game
The Serial Monitor is a program in MCU memory used to program the chip using only a serial cable. Its
source file is included on the provided MC9S12NE64 Resource CD as zip file, HCS12SerialMon2r1.zip.
After installing CodeWarrior v3.1 for HC(S)12, follow the procedure below to load The Connector software
into the DEMO board using the Serial Monitor. Note: If you later need to re-program the Serial Monitor,
you will need a BDM interface cable to program the Flash on the MCU. The BDM interface cable is not
provided in this kit.
1.
In the MC9S12NE64 Resource CD, copy and open the “Connector_App.zip” file to your PC, and
extract the files into a working folder. Note: Be sure to extract, and not just copy, the files.
2.
If you have not already done so, do step 2 of “Connect the EVB9S12NE64 to your computer and
apply power” (connect serial cable). If you are using a different PC COM port, you will need to
adjust the settings within the CodeWarrior IDE.
3.
In the working folder, double click on the “Connector_App.mcp” project file. The CodeWarrior IDE
will launch.
4.
Open the main source file, “Main.c,” by double clicking it in the list of Files on the left side.
5.
Click on “Make” under Project in the menu bar or hit “F7.”
6.
This saves, compiles, etc. A list of errors and warnings should appear. There should be no errors.
A trick: If the errors window does not appear, make a small code change (ex. type a space, then
<Del>) and retry.
7.
Assure the RUN/LOAD_SW is set to LOAD, and then press and release the RESET button on the
EVB board.
8.
Click on “Debug” under Project in the menu bar or hit “F5.” The True-Time Simulator & Real-Time
Debugger should initiate serial communications with the EVB board. As soon as the debugger
opens, the code currently in the MC9S12NE64's Flash memory is erased and the newly compiled
code is programmed in. The serial monitor code is not erased.
9.
If the debugger does not open, refer to “Reasons Why the Debugger Won’t Open” of this guide.
10.
Once the “Connector” software has been programmed and no error messages appear, you are
ready to run and debug in real time. Move the RUN/LOAD_SW switch to RUN, and click on the
green arrow (Start/ Continue button) in the Debugger window to begin running/ debugging code.
The LINK LED should light up.
11.
Conduct another ping test (refer to “Set the PC's IP address and the Ping Test”). The board's IP
address in the “Connector” demo game is set to 192.168.2.3 and the mask is 255.255.255.0.
The serial monitor can be used for much more than just programming new code. Many debug operations
(memory modify, breakpoints, real-time bug traces, etc.) can also be run over the serial cable while in this
mode. Refer to application note AN2548 for more information on the serial monitor.
Running the MC9S12NE64 Demo Game: “The Connector”
This completes the quick start for your EVB9S12NE64! Now that you have compiled and loaded the
“Connector” game into the Flash memory of the MC9S12NE64 using the Serial Monitor, you are ready to
play the game. The switches and analog input serve as controls. Click on “Connector.exe” on the
MC9S12NE64 Resource CD, and enjoy!
EVB9S12NE64 Demo, Rev. 0.1
4
Freescale Semiconductor
Troubleshooting
Troubleshooting
Reasons Why the Debugger won't open
•
If a series of error notifications appear, the debugger may have launched when the board is not
powered. Cancel these messages, close the debugger window, and power up the board before
opening the debugger again.
•
You may not have installed the special edition license key for this version (3.1) of CodeWarrior (see
the CodeWarrior Quick Start Guide included with the CodeWarrior CD provided).
•
If the debugger could not establish a connection, press the RESET button on the EVB board, and
retry.
•
The COM port on the PC may be in use by another application. If so, disconnect that application
or connection.
•
RUN/LOAD_SW may not be in the correct position (LOAD to Flash memory and RUN to run
program). Please check your steps.
Reasons Why the Ping Test might fail
•
Ethernet cable may not be secure.
•
IP addresses or masks may not be set correctly. The mask is typically 255.255.255.0. To check
the board's and the PC’s IP addresses, you must install and open CodeWarrior and do the steps
in “Set the PC's IP address and the Ping Test.”
•
You may not have waited long enough for the PC to regain its IP settings. This shouldn't take more
than a minute and takes typically 1-20 seconds.
EVB9S12NE64 Demo, Rev. 0.1
Freescale Semiconductor
5
How to Reach Us:
Information in this document is provided solely to enable system and software implementers to use
Freescale Semiconductor products. There are no express or implied copyright licenses granted
USA/Europe/Locations not listed:
Freescale Semiconductor Literature Distribution
P.O. Box 5405, Denver, Colorado 80217
1-800-521-6274 or 480-768-2130
hereunder to design or fabricate any integrated circuits or integrated circuits based on the information
in this document.
Freescale Semiconductor reserves the right to make changes without further notice to any products
herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the
Japan:
Freescale Semiconductor Japan Ltd.
SPS, Technical Information Center
3-20-1, Minami-Azabu
Minato-ku
Tokyo 106-8573, Japan
81-3-3440-3569
suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any
liability arising out of the application or use of any product or circuit, and specifically disclaims any
and all liability, including without limitation consequential or incidental damages. “Typical” parameters
which may be provided in Freescale Semiconductor data sheets and/or specifications can and do
vary in different applications and actual performance may vary over time. All operating parameters,
including “Typicals” must be validated for each customer application by customer’s technical experts.
Asia/Pacific:
Freescale Semiconductor H.K. Ltd.
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T. Hong Kong
852-26668334
Freescale Semiconductor does not convey any license under its patent rights nor the rights of others.
Freescale Semiconductor products are not designed, intended, or authorized for use as components
in systems intended for surgical implant into the body, or other applications intended to support or
sustain life, or for any other application in which the failure of the Freescale Semiconductor product
could create a situation where personal injury or death may occur. Should Buyer purchase or use
Learn More:
For more information about Freescale
Semiconductor products, please visit
http://www.freescale.com
Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall
indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and
distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney
fees arising out of, directly or indirectly, any claim of personal injury or death associated with such
unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was
negligent regarding the design or manufacture of the part.
Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other
product or service names are the property of their respective owners.
© Freescale Semiconductor, Inc. 2004.
Rev. 0.1, 06/29/2004