Example Application Using the DEMO9S08LC60
Interfacing an LCD to the MC9S08LC60, Rev. 0
Freescale Semiconductor
25
//Change BAT and VOL randomly
SET_VOL(SEGONOFF,ON, 5-l);
SET_BATT(SEGONOFF,ON, l);
if (l == 4) l=0;
else l++;;
//Display default message
DefaultDisplayMessage();
}
}
}
The loop polls the SCI0 data register and, when validate is available, stores the SCI0 data into the array
sci_input[inputcounter]. The inputcounter variable counts the total number of SCI0 characters stored in
sci_input. When the SCI0 data received is equal to a carriage return, ‘\r’, the Scroll_String() function is
called with sci_input as an argument. After the scrolling of the data on the LCD display, the sci_input array
is cleared and a default LCD message is displayed. Afterwards, the program loop continues polling the
SCI0 data register for the next user input.
4.3
Example Application Operation and Quick Start
The demo uses the FBE ICG configuration so it used the DEMO9S08LC60 32.768 kHz crystal clock
source. The code in AN3280SW1.zip is pre-configured to drive the LCD panel at 3 Volts with a 1/4 duty
cycle and a frame frequency of 64 Hz. The following instructions provide a walkthrough of the demo
operation.
1. Unpack the DEMO9S08LC60 and place jumpers as described in
2. Connect a serial cable from a PC to the DEMO9S08LC60.
3. Connect an USB cable from a PC to the DEMO9S08LC60.
4. Unzip the AN3280SW1.zip file
5. Start Code Warrior and open the project file for the demo found in the AN3280SW1.zip file
— Project file is named AN3280_CWPRJ.mcp
— Ensure the Code Warrior version supports the MC9S08LC60. For Code Warrior 5.1, an
MC9S08LC60 patch is available from Freescale.com. Alternatively, Code Warrior 5.x can be
used with an MC9S08LC60 driver provided by SofTech Microsystems. The SofTech
Microsystems is provided on a CD in the DEMO9S08LC60 kit.
6. With the AN3280_CWPRJ.mcp open, select SofTech as the programming target and then start the
program download. This will start the Code Warrior debugger, Hiwave. The Code Warrior IDE
icon that executes the command to start the debugger is the following:
7. At this point, the Hiwave debugger will erase and reprogram the DEMO9S08LC60 — several
dialog boxes will show the reprogramming progress.