|
|
Freescale
MC9S08QG8/4
|
|
Getting
Started - Supplementary Information
|
Please note that the DEMO9S08QG8 or APS08QG8SLK requires
a PC with a USB connection.
|
If you have purchased the DEMO9S08QG8 or APS08QG8SLK developmental kit, follow the Quick Start Guide that comes with the kit in order to install CodeWarrior IDE.
Basically, here are the things you need do:
Metrowerks CodeWarrior and the Service Pack can be downloaded from www.metrowerks.com
You do not need to purchase the developmental kit in order to run the simulator only.
A new license key from Metrowerks is not required if your code is less than 1K bytes long.
(Note: Metrowerks is now part of Freescale Semiconductor).
This information is supplementary to the Getting Started web page.
The information presented here refers to an older version of Metrowerks Codewarrior. Your installation could be somewhat different.
The MC68HC11 LCD display module requires +5V supply:
+5V = RED
GND = BLACK
Apply power to the LCD module and a startup message (different from the one shown) should appear on the LCD screen.
Press the RESET button if a readable message is not displayed.
The MC9S08QG8 development board requires +3.3V supply. Do not connect to the 5V supply. Also do not power the MC9S08QG8 directly from +5V. If 5V tolerant parts are required for your project, MC9S08QD2 and MC9S08QD4 are available in 8-pin DIP packages and MC9S08SH4 and MC9S08SH8 are available in 20-pin packages.
If required, the MC9S08QG8 MCU can be powered using a simple voltage divider circuit shown below.
Connect MCU pin-3 to +3.3V amd pin-4 to GND.
Connect the 8MHz XTAL between pin-5 and pin-6 of the MCU along with a 22M-ohm
resistor in parallel with the XTAL.
(The MCU has an internal RC oscillator. This is not stable enough for serial
data transmission. The external XTAL provides a more stable and accurate system
clock.)
Connect the WHITE wire from the LCD module to the MCU TXD output at MCU pin-11. Turn on power. A test message should be generated on the LCD. Connect four LEDs to MCU pins 5, 6, 7 and 8 (with cathode to GND via 220-ohm resistors) and observe the LEDs flash.
Connect Vss to GND.
Follow the instructions supplied with the CodeWarrior CD and install the software.
The latest version of CodeWarrior and Updates can be obtained from the Freescale website:
http://www.freescale.com/webapp/sps/site/homepage.jsp?code=CW_HOME
Your version may be different from the one shown:
Select the New icon at the left (second icon) of the control panel:
Select the New Poject Wizard and enter a Project name:
Setup your project by choosing the following options. The only change from the default setting is made on Page 8.
Select both P&E Full Chip Simulation and P&E Hardware Debugging:
At the left hand side of the screen in the Project Panel, make sure you select
P&E ICD.
P&E FCS - Full Chip Simulator allows you to simulate the code without actual
hardware.
P&E ICD - In-Circuit Debugger is required to program the target MCU and
run the code.
Click on the + sign at the left of Sources to expand and dropdown the contents of Sources. Double click on main.c to open the source code main.c
Connect the MC9S08QG8 Demo board to the PC using the USB cable supplied. The PC should recognise the board automatically. If everything is fine, there should be two GREEN LEDs (VDD, USB) and one YELLOW LED (USB PWR) lit on the board.
Click on the Debug icon (GREEN ARROW)
Click on Reset and Stop MCU.
Click on the GREEN ARROW - Start/Continue (F5) to begin execution.
Occasionally something goes wrong and the IDE fails to find the demo board
or the target MCU. The IDE reverts to the P&E FCS mode.
When this happens, select PEDebug... Mode: Full Chip Simulator... In-Circuit
Debug/Programming.
We will start from scratch and delete everything in the main.c window.
The first test program will be posted here later...
More to come...
Connect Vss to GND
2006.11.09 - 2011.12.21