Demo Menu Options
DEMO9S08QG8_APP Example Application User Guide, Rev. 0.02
Freescale Semiconductor 3
FLASH at location 0xFFAF. CodeWarrior with the MC9S08QG8 Service Pack will trim and save the trim value
automatically.
The 31.25 kHz reference will generate an 8.0 MHz bus clock in FEI mode. The demo will light LED1, and the
MCU’s TPMCH1 pin will be outputting a PWM signal running at 1/10,000 of the bus frequency. If the internal
reference is trimmed, this PWM signal should be 800 Hz ±2%.
RESET Button and SRS Register
After every chip reset, the display will show the value of the System Reset Status (SRS) register and state the
cause or causes of the last reset.
For this demo application, the RESET pin on the MC9S08QG8 is configured as a general purpose PTA5 input,
not as RESET. However, the program uses PTA5 to determine whether the COP should be serviced. If the
RESET button (connected to the PTA5/IRQ/TCLK/RESET pin) is not pressed, the COP will be serviced and
no COP reset will be generated. If the RESET button is pressed, the COP will not be serviced and will therefore
timeout, forcing a chip reset.
Because the cause of the reset is actually the COP and not the RESET pin function, the SRS will indicate a
COP reset occurred instead of a pin reset.
Demo Menu Options
The user can choose from eight options to explore a handful of the MC9S08QG8’s features. The options allow
the user to choose from several ICS setups, change the TPM clock source, reconfigure the MTIM settings,
measure the RTI’s internal reference, and try out the different stop modes, the ACMP, and the ADC modules.
To make a selection, simply type the number next to the menu item. Some menu choices will require a two-
digit value. For these items, type the two-digit number followed by <Enter>. When entering these two-digit
values, the delete and backspace keys will not work. To re-type a value, enter a non-hexadecimal value and
the menu will ask for a new entry.
ICS setup
This option allows the user to select from five different settings of the Internal Clock Source (ICS) module. Four
of the settings are using FEI mode (FLL-enabled, internal clock reference) with different bus divider values and
one option selects FBI mode (FLL-bypassed, internal clock reference).
TPM PWM setup
This option simply lets the user change the clock source to the TPM (Timer/PWM Module). One of the choices,
“TCLK source”, requires a clock signal to be input on the PTA5/IRQ/TCLK/RESET pin. If no clock source is
present, the timer will not count and the PWM signal will freeze. The demo will continue to run.
MTIM setup
This menu option allows the user to do several things with the MTIM (Modulo Timer Module): initiate a software
PWM signal running at 1/100 of the bus frequency, choose a different clock source, set the clock source
prescaler, set the timer modulo value, start, stop and reset the MTIM.
As with the “TPM PWM setup”, if the TCLK is selected as the MTIM clock source, a clock signal must be input
on the PTA5/IRQ/TCLK/RESET pin. If no clock source is present, the MTIM will not count and the software
PWM signal will freeze. The demo will continue to run.