DEMO9S08SE8 Lab Tutorial

DEMO9S08SE8—Lab Tutorial
DEMO9S08SE8—Lab Tutorial
Default Jumper Settings
The following list shows the default jumper settings for DEMO9S08SE8 board.
Jumper
Status
PWR_SEL
VB
VX_EN
installed
JP301-RST*, BGND
installed
JP302-GPIO, DATA1, DATA2
installed
COM_SEL
COM
USER1, SW1, SW2, LED1, LED2, RV1, RZ1
installed
Do More with Less
Learn More:
For more information about Freescale products,
please visit www.freescale.com/8bit.
Freescale and the Freescale logo are trademarks or registered trademarks of Freescale Semiconductor, Inc.
in the U.S. and other countries. All other product or service names are the property of their respective owners.
© Freescale Semiconductor, Inc. 2008.
DEMO9S08SE8
Lab tutorial
Doc Number: DEMO9S08SE8LAB / REV 0
Agile Number: 926-78277 / REV A
DEMO9S08SE8—Lab Tutorial
MCU Port Connector Pin Out
Figure 1. DEMO9S08SE8
Push Buttons
Power Select
Jumper
LEDs
The following list shows the pin out for the MCU port connector on the DEMO9S08SE8 board (J1).
MCU Port
MC9S08SE8 MCU
Embedded
BDM Multilink
for Programming
and Debug
MCU Reset
Push Button
RS232 Port
Symbol
VX
VSS
PTB1 /KBIP5/TxD/ADP7
PTB0 /KBIP4/RxD/ADP6
PTA2/KBIP2/ADP2
PTA3/KBIP3/ADP3
PTA0/KBIP0/TPM1CH0/ADP0
PTB6/XTAL
PTB3/KBIP7/ADP9
PTB4/TPM2CH0
PTB2/KBIP6/ADP8
PTB5
PTC0
PTC1
PTC2
PTC3
PTC4
PTC5
NA
NA
Number
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
Number
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
Symbol
PTA5 /IRQ/TCLK/RESET
PTA5 /IRQ/TCLK/RESET
PTA4 /BKGD/MS
PTB7 /EXTAL
PTB6/XTAL
NA
NA
NA
PTA1/KBIP1/TPM1CH1/ADP1
PTA0/KBIP0/TPM1CH0/ADP0
NA
NA
PTB1/KBIP5/TxD/ADP7
PTB0 /KBIP4/RxD/ADP6
PTA6/TPM1CH0/ADP4
PTA7/TPM1CH1/ADP5
PTC7
PTC6
NA
NA
DEMO9S08SE8—Lab Tutorial
DEMO9S08SE8
This document explains how to set up and use the SE8_DEMO_LAB1 example application. The example application allows
the user to try out several features on Freescale’s MC9S08SE8 microcontroller.
Step
1
DEMO9S08SE8 Lab
This lab document applies to
DEMO9S08SE8.
Start each lab with the board powered
ON. Make sure to use only one utility at a
time, as they share the same USB source.
Familiarize yourself with these buttons:
Start/Continue (F5) button
MCU Change Wizard button
Debug button
Step
2
Step
3
Setting up the Demo
Running the Demo
Demo Menu Options
1. Connect the DEMO9S08SE8 demo board to the PC
with the USB cable. The jumper configuration for this
application is:
•SW1, SW2, LED1, LED2, RV1, RZ1 jumpers are installed
•COM_SEL switches to BDM
Now click the “RUN” button. If everything is configured
correctly, LED1 and LED2 will begin to blink alternately and
the terminal window will display the following as soon as the
demo starts:
Welcome to the World of MC9S08SE8 Demo
Application V1.0
POR LVD, Reset Occurred
The user can choose from three options to explore a few of
the MC9S08SE8’s features and go to the submenu of each
function.
To make a selection, simply type the number next to the
menu item.
2. Open both the CodeWarrior IDE and the SE8_DEMO_
LAB1 project.
3. To compile the project and program the MCU, select “P&E
Multilink/Cyclone Pro” from the pull-down menu beneath
the project name. Then click the debugger icon. This
will compile the project of SE8_DEMO_LAB1, launch the
debugger application and prompt the user with “Erase
and program FLASH.” Click “Yes.” The MCU is now
programmed.
5. After the MCU is programmed, start the TerminalWindow.
exe from the DEMO9S08SE8 Toolkit directory. It will open
a terminal window connected to USB port. The USB COM
port settings must be:
•38400 baud rate
•8 bits
•No parity
•1 stop bit
The demo is now ready to run.
Main test menu
[1] Real-time clock setup
[2] TPM1 PWM setup
[3] ADC test
Please select a number to execute:
• Bus clock source
This demo relies on the internal clock reference to
generate bus frequency and the communications baud
rate. Therefore, the MCU’s internal clock reference has
been trimmed to 32 kHz.
• System reset status
After every chip reset, the terminal will display the
system reset status and state the cause or causes of the
last reset.
• Reset button
For this demo application, the reset pin on the
MC9S08SE8 is configured as an IRQ pin function. The
user can use the IRQ function to wake the MCU from lowpower mode.
• Potentiometer RV1
On the demo board, the RV1 is a potentiometer. The user
can turn the RV1 to get the voltage (from 0V to 5V) on the
RV1 jumper.
• Photo sensor RZ1
On the demo board, the RZ1 is a photo sensor. As the
intensity of the light shining on the RZ1 sensor changes, the RZ1 jumper voltage will vary from 0V to 5V—the
lower the light, the higher the voltage. Usually, in a room
environment, the RZ1 jumper voltage is about 5V, so the
user needs a light source, such as lamp, to drive lower
RZ1 jumper voltages.
[1] Real-time clock setup
Real-time clock menu:
[1]: Set up, enable and display real-time clock
[2]: Disable real-time clock
[e]: Exit real-time clock menu
Please select a number to execute.
These menu options let the user enable, disable and exit the
real-time clock, which is the basis of the RTC module.
When number 1 is selected, the clock is enabled and
displayed on the terminal after the current time input. Please
enter the current time according to the display: format as
HHMM (H=hour, M=minute). The clock will be displayed on
the terminal.
When number 2 is selected, the RTC is disabled, and the
clock disappears from the terminal.
[2] TPM1 PWM setup
TPM1 menu:
[1]: Enable TPM1
[2]: Disable TPM1
[e]: Exit TPM1 menu
Please select test number to execute.
These options let the user enable or disable the PWM
function of TPM1.
When number 1 is selected, LED1 connected to TPM channel
0 and LED2 connected to TPM channel 1 begin to blink
alternatively. When number 2 is selected, LED1 and LED2
stop blinking.
[3] ADC menu
[1]: Enable ADC to measure the RZ1
[2]: Disable ADC
[e]: Exit ADC menu
Please select test number to execute.
When number 1 is selected, the analog-to-digital converter
(ADC) is enabled to sample the output of RZ1. LED2
illuminates if the voltage on the photo sensor (RZ1) is higher
than 4V. If the RZ1 voltage is less than 4V, LED2 will not light
up. When number 2 is selected, the ADC is turned off.