Part Number Hot Search : 
LSP3130 24000 PC200 ZMDK87W MC6847Y 23000 UGP30K PCF857
Product Description
Full Text Search
 

To Download 5745 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 R
ST624x-KIT
STARTER KIT FOR ST624x MCU FAMILY
HARDWARE FEATURES
s
SOFTWARE FEATURES
s
s
s
s
Immediate evaluation of ST6240 with demonstration examples Program debugging within the user's real application environment On board programming of ST62E46 and ST62T46 In-circuit programming of ST62E4x and ST62T4x devices on the user's application board
s s s
Software simulator including LCD display and I/O read/write Assembler, linker, debugger EPROM/OTP programming utilities Application examples
February 1998
1/49
5
Table of Contents
ST624x-KIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1 Where to go from here... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2 THE STARTER KIT HARDWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1 The ST6 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 The Starter Kit Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3 8 MHz and 32 KHz Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.4 8-alphanumeric Digit LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.5 Reset Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.6 LED Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.7 Hexadecimal Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.8 Resistance trimmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.9 Combi-ports PC0-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3 INSTALLING THE STARTER KIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1 Hardware and Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 Installing the Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.3 Connecting the Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4 RUNNING THE DEMOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1 What the Demos Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1.1 Demo 1 - Key Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1.2 Demo 2 - Voltmeter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.2 Running the Demonstration Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 CONNECTING EXTERNAL RESOURCES TO THE STARTER KIT BOARD . . . . . . . . . . . . . . 19 6 USING THE STARTER KIT BOARD AS A HARDWARE SIMULATOR . . . . . . . . . . . . . . . . . . 22 6.1 The Data Transmission Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.2 Technical Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 6.3 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.4 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7 EXERCISES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 7.1 Exercise 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 7.2 Exercise 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 8 PROGRAMMING ST6 MICROCONTROLLERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.1 Setting Up the Starter Kit Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.2 In-Circuit Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 8.2.1 Application Board Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 8.3 Setting Up the Starter Kit Board for In-Circuit Programming . . . . . . . . . . . . . . . . . . . . . . . 35
2/49
6
Table of Contents
9 LCD INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 9.1 ST6240 LCD DRIVER OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 9.2 STARTER KIT LCD PANEL INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 9.3 Interfacing The LCD Panel with the ST6240 LCD Driver . . . . . . . . . . . . . . . . . . . . . . . . . . 40 9.4 Character Definition Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 9.4.1 Character A Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 9.4.2 Character 3 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 9.5 Starter Kit LCD Panel Character Set Software Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 9.5.1 Direct Code LCD RAM Patching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.2 Indexed Data ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.3 Complete Message Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 HARDWARE INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 44 45 47
10.1 Part List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 10.2 Starter Kit Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3/49
7
Introduction
1 INTRODUCTION
The ST624x Starter Kit provides you with all you need to start designing, developing and evaluating programs for ST624x microcontrollers immediately. The ST624x Starter Kit includes: * The ST6 assembler and linker, AST6 and LST6. * The ST6 Windows debugger, WGDB6. * The Windows ST6 microcontroller programmer, Epromer. * The ST6 Starter Kit board, which serves as a demonstration board and low-cost debugging tool. * Some demonstration programs that show how ST6 microcontrollers use the Starter Kit board resources. * Some example programs. * Two ST62E46BF1 microcontrollers. * A complete set of paper documentation and online help. The demonstration programs, that come pre-loaded on the ST62T40B microcontroller, show how the powerful features of ST6 microcontrollers operate in a real environment. The demonstration programs use the hardware resources provided on the Starter Kit board, which include an LCD, hexadecimal keyboard, a resistance trimmer and an 8 MHz and a 32 KHz oscillator. Using the ST6 assembler and linker, AST6 and LST6, you can assemble and link ST6 programs. The "ST6 Family Software development tools AST6, LST6, WGDB6" User Manual will guide you through the steps of developing, assembling and linking programs for the ST6. The Starter Kit software includes a set of example programs of typical ST6 applications. These are installed in the directory C:\st6tools\sk624Xi1\examples. For a fast-track solution for developing bug-free programs for the ST6, without the hassle of writing assembler code, try out the ST6-Realizer program. Once you have developed your ST6 program, you can use the Windows-based ST6 program debugger, WGDB6/SIMULATOR, together with the Starter Kit board, as a low-cost but powerful debugging tool. WGDB6 includes an ST6 simulator, that simulates the execution of your program, and uses the ST6 that is plugged into the Starter Kit board to emulate all transactions that are performed with the data space. Thus, using the Starter Kit board with WGDB6, you can view how the microcontroller peripherals behave when your program is executed. WGDB6 includes powerful debugging features, such as source-level debugging, instruction and conditional memory access breakpoints and selective trace recording. The "ST6 Family
4/49
8
Introduction
Software development tools AST6, LST6, WGDB6" User Manual and online help will lead you through the debugging process using WGDB6. When your program is ready, Epromer provides you with an easy-to-use Windows interface, which lets you prepare executable code, then write it to the ST62E46B microcontroller that can be plugged into the SDIP56 ZIF socket on the Starter Kit board, or your own in-circuit application board that is connected to the Starter Kit board. The ST62T40B can't be erased or programmed, it is already programmed and contains the demonstrations program. To observe and evaluate the consequences of your program on the resources it controls, you can run it on the ST62T40B microcontroller that is soldered on the Starter Kit board in Hardware Simulation mode. If it controls a resource that is not included on the Starter Kit board, you can connect your own resource to the board. Instructions for use - Warning This product conforms with the 89/336/EEC directive; it also complies with the EN55022 emissions standard for ITE, as well as with generic 50082-1 immunity standards. The product is a Class A apparatus. In a residential environment this device may cause radioelectrical disturbances which may require that the user adopt appropriate precautions. The product is not contained in an outer casing, and cannot therefore be immune against electrostatic discharge (ESD): it should therefore only be handled at static safe work stations.
5/49
9
Introduction
The following diagram summarises the possible uses of the Starter Kit board and the hardware setup required for each one. To program ST6s on your own in-circuit programming board: PC running Epromer Starter Kit board In-circuit programming board
Parallel port connected to P2
P1 connector
To program ST6s using the Starter Kit board: PC running Epromer
ST6 to be programmed
Starter Kit board Parallel port connected to P2 To run the demonstrations: ST62T40B Programmed with DEMOKIT2.HEX Starter Kit board
To use the Starter Kit board as a hardware simulator: PC running WGDB6 Simulator ST62T40B Programmed with DEMOKIT2.HEX
Parallel port connected to P2
6/49
10
Introduction
1.1 Where to go from here... The following table directs you to where you should look for further information about using the ST6 Starter Kit
To: Find out about the Starter Kit board and ST6 microcontrollers provided with the kit. Install the Starter Kit software, and connect the power supply to the board. Find out what the demonstration applications do, and run them. Learn how to develop source code for AST6 and LST6. Prepare the Starter Kit board for use as an ST6 hardware simulator with WGDB6. Learn how to use WGDB6 for debugging your programs. Prepare the Starter Kit board for programming ST6 microcontrollers using Epromer. Prepare the Starter Kit board for connecting your own in-circuit programming board. Learn how to use Eprommer for programming ST6 microcontrollers. Connect your own hardware resource or LCD to the Starter Kit board. Perform some introductory excercises using WGDB6. Learn how the LCD interface works. Refer to: "The Starter Kit Hardware" on page 8 of this book. "Installing the Starter Kit" on page 15 of this book. "Running the Demos" on page 17 of this book. "ST6 Family Software development tools AST6, LST6, WGDB6" User Manual. "Using The Starter Kit Board as a Hardware Simulator" on page 22 of this book. "ST6 Family Software development tools AST6, LST6, WGDB6" User Manual. "Programming ST6 Microcontrollers" on page 32 of this book. "In-Circuit Programming" on page 33 of this book. The Epromer online help. "Connecting External Resources to the Starter Kit Board" on page 19 of this book. "Exercises" on page 26. "LCD Interface" on page 36.
7/49
11
The Starter Kit Hardware
2 THE STARTER KIT HARDWARE
This section describes the ST6 microcontrollers and the Starter Kit board that come with the ST6 Starter Kit. A full schematic of the Starter Kit board is provided in "Hardware Information" on page 47. 2.1 The ST6 Microcontroller The Starter Kit includes two ST62E46BF1 microcontrollers. The ST62T40B microcontroller is pre-loaded with the code DEMOKIT2.HEX, which includes the demonstration programs (see "Running the Demos" on page 17), as well as the communications protocol program, that enables you to use the Starter Kit board as a simulator (see "Using The Starter Kit Board as a Hardware Simulator" on page 22). 2.2 The Starter Kit Board The Starter Kit board includes the following resources: * A Reset button. * An 8-alphanumeric digit LCD. * A hexadecimal keyboard. * A LED indicator. * A resistance trimmer. * One 8 MHz and one 32 KHz oscillator. * A SDIP56 ZIF socket to program the ST62E46B or ST62T46B. It comes with its own power supply unit that can be plugged into an AC mains source, or a DC source with the following characteristics: * Voltage: 16V min./20V max. * Current: 100 mA min.
8/49
12
The Starter Kit Hardware
It includes the following connectors: * A parallel port connector (P2) for connection to the host PC when it is used as a hardware simulator or for programming. * A remote resource I/O interface (J1). * An in-circuit ST6 programming board connector (P1). * A remote LCD connector (J2) to which you can connect your own LCD.
Below is a block diagram of the Starter Kit board:
9/49
13
The Starter Kit Hardware
ST624x Starter Kit Board
10/49
14
The Starter Kit Hardware
The following diagram shows the layout of the Starter Kit board.
1 2 3 ST6246B 4 DISPLAY 5 6 1 7 4 8 9 7 A 5 8 0 6 9 B E D C 2 3 F SOCKET JP1 ST62T40B
17 16 15 14 13 12 11 10
1 2 3 4 5 6 7 8 9
In-circuit programming connector P1. "Programming" or "User" operating mode selection jumper JP1. 8 Mhz oscillator. PC connector P2. 32.768 KHz oscillator. LED indicator LD1. LCD display. Power supply JACK connector J3. Power supply LED indicator LD2.
17 16 15 14 13 12 11 10
Remote resource I/O interface J1. Remote LCD interface connector J2. ST62T40B MCU LCD protection with jumper JP2 if the combiport PC0-7 is used. SDIP56 ZIF MCU socket. Keyboard Voltage trimmer RESET button.
11/49
15
The Starter Kit Hardware
2.3 8 MHz and 32 KHz Oscillators An oscillator feeds the ST62T40B OSCIN input with an 8 MHz clock signal. A 32 KHz oscillator is delivered with the board. The required components: crystal XT1 and capacitors C5, C6 are connected to the ST62T40B as described in the ST6240 Data Book. 2.4 8-alphanumeric Digit LCD An 8-alphanumeric digit LCD is connected to the ST62T40B LCD driver outputs. It has 32 segments that are driven by 4 COM outputs. You can disconnect a part of the LCD by removing jumper JP2 if you want to use the combi-port PC0-7 on the connector interface J2. For full details about the LCD see "LCD Interface" on page 36. 2.5 Reset Button This activates the ST62T40B RESET input when pressed. A power-on reset circuit is also provided. 2.6 LED Indicator A LED is connected to the ST62T40B PB4 I/O pin (which is defined as output) to demonstrate the ST6 LED-driving capacity. It can be disconnected from PB4 by removing the jumper JP3.
2.7 Hexadecimal Keyboard A hexadecimal keyboard is connected to the ST62T40B PB0 I/O pin (defined as A/D Converter input), via an analog interface resistor array. The voltage value on the A/D converter input is equal to 5V/16 x the key number, thus giving an image of the pressed key.
12/49
16
The Starter Kit Hardware
The following table lists the Resistor array values and their corresponding voltage/key values:
Resistor Array Values RT: 1K R0: 68 R1: 75 R2: 82 R3: 100 R4: 120 R5: 150 R6: 180 R7: 220 R8: 270 R9: 390 R10: 560 R11: 820 R12: 1.2K R13: 2.7K R14: 7.5K Theoretical Voltage Values NO KEY: 5V K0: 0V K1: 0.312V K2: 0.625V K3: 0.937V K4: 1.250V K5: 1.562V K6: 1.875V K7: 2.187V K8: 2.500V K9: 2.812V KA: 3.125V KB: 3.437V KC: 3.750V KD: 4.062V KE: 4.375V KF: 4.687V
Jumper JP5 sets the keyboard operation mode: polling or IRQ, according to the following diagram. JP5 JP5
This position selects polling.
This position selects IRQ.
Jumper JP4 disconnects the keyboard output from PB0 when it is removed, enabling you to connect your own external source to PB0 via the J1 connector. For an example of the analog keyboard application, refer to the SGS-Thomson application note AN431: Using ST6 Analog Inputs for Multiple Key decoding.
13/49
17
The Starter Kit Hardware
Analog Keyboard diagram:
2.8 Resistance trimmer A 10 K resistance trimmer feeds the ST62T40B PA4 I/O pin (when programmed as an A/D Converter input) with a variable voltage (0 to 5V DC). It is used for A/D conversion demonstration/evaluation. The trimmer can be disconnected from the PA4 I/O pin by removing the JP6 jumper.
VDD ST62T40B JP6 TRIMMER RV1 PB4 JUMPER
GND
2.9 Combi-ports PC0-7 The port C of the ST6240B is used for the LCD segments. It can be used as a normal port in hardware simulation mode. The port PC0-7 can be accessed on J2, prior to use it, remove the 8 jumpers on JP2 (marked 14 on the Starter Kit board diagram on page 11). Thus, the LCD won't be affected by the inputs on the port PC0-7 and won't be damaged.
14/49
18
Installing the Starter Kit
3 INSTALLING THE STARTER KIT
3.1 Hardware and Software Requirements To be able to install and run the ST6 Starter Kit, you need a PC with: * A 3 1/2" Floppy Disk Drive * A free Centronics compatible parallel port connector * MS-WindowsTM 3.11, NT or 95. * A CD-ROM Disk Drive 3.2 Installing the Software If diskettes are provided, you must install the software with them in order to have the latest release: 1 Place the SK624XI1 diskette into your floppy disk drive. 2 In Windows Explorer or File Manager, view the contents of the diskette, then double-click the Setup file or icon. 3 Follow the instructions as they appear on screen. If only the ST62 CDROM is provided, then: 1 Place the ST62 CDROM provided into your CDROM disk drive. 2 In Windows Explorer or File Manager, view the contents of the CDROM, browse to st62oncd\ftools\sk624Xi1 and double-click the Setup file or icon. 3 Follow the instructions as they appear on screen. 3.3 Connecting the Power Supply If you have AC mains supply, connect the Jack plug on the power supply cable provided to the J3 input socket, then connect the mains plug to a mains source. If you have DC mains supply, connect the male plug on the power supply cable provided to the J3 input socket, then connect the mains plug to a mains source with the following characteristics: * Voltage: 16V min./20V max. * Current: 100 mA min. To avoid a short circuit, always connect the power input cable to the starter kit board before connecting it to a mains power supply.
15/49
19
Installing the Starter Kit
If you use your own 3.5 mm power supply plug, its polarity must be as follows:
JACK PLUG
-
+
16/49
20
Running the Demos
4 RUNNING THE DEMOS
This section describes the demonstration programs that are provided with the Starter Kit and explains how to run them. 4.1 What the Demos Do The following paragraphs describe the demos that come pre-loaded with the ST6 Starter Kit demos. See "Running the Demonstration Programs" on page 18 below for details on how to select and run a demo. The source files of these demos are provided with the Starter Kit software in the file C:\st6tools\sk624Xi1\sk624Xli\DEMOKIT2.ASM. 4.1.1 Demo 1 - Key Display 1 Initialises the pin PB0 (which is connected to the keyboard) as an analog input. 2 Polls the A/D converter to detect whether a key is pressed. 3 When a key is pressed, it shifts the contents of the LCD one place to the left and displays the value of the pressed key on the right side of the LCD. To stop the demonstration, press the Reset button. To quit the demonstration routine and bypass the presentation message, press and release the Reset button while pressing any key on the Starter Kit keyboard. 4.1.2 Demo 2 - Voltmeter 1 Initialises the pins as follows:
This pin: PA4 PB4 Is initialised as: Analog input. Connected to the trimmer RV1. 20 mA direct LED drive output.
2 Reads digital value of the voltage present on PA4 from the A/D converter data register. 3 Displays the read voltage value on the LCD panel. When the read value reaches 4 volts, the LD1 LED is switched on indicating that the voltage value is reaching its upper limit. You can adjust the voltage value using the voltage trimmer (marked 11 on the Starter Kit board diagram on page 11). To stop the demonstration, press the Reset button. To quit the demonstration routine and bypass the presentation message, press and release the Reset button while pressing any key on the Starter Kit keyboard. The LED flickers when around 4 volts is reached. This is because of the power supply voltage noise >20 mV or instability of the resistor trimmer.
17/49
21
Running the Demos
4.2 Running the Demonstration Programs The ST62T40B microcontroller labelled DEMOKIT2 is programmed with the demonstration software. To run the demonstrations: 1 Power down the Starter Kit board. 2 Make sure that the ST62E46B is not plugged into the SDIP56 ZIF MCU socket. 3 Select the USER mode using the jumpers marked JP1 (marked 2 on the Starter Kit board diagram on page 11), as shown in the diagram below:
PROG
USER
4 Disconnect the cable from the parallel port (P2) connection, if it is connected. 5 Power up the Starter Kit board. 6 Press and release the Reset button on the Starter Kit board. When the message "Press key 1\2" is displayed on the LCD, press either 1 to run the Keyboard demonstration or 2 to run the Voltmeter demo. To stop the current demonstration and view the other demonstration, repeat step 6 above. Or, to avoid the display of the presentation message, press any key on the Starter Kit keyboard then, while keeping the key pressed, press and release the Reset button.
18/49
22
Connecting External Resources to the Starter Kit Board
5 CONNECTING EXTERNAL RESOURCES TO THE STARTER KIT BOARD
You can connect your own external resources to the pre-programmed ST62T40B to debug or evaluate your programs, using the connector J1 (marked 17 on the Starter Kit board diagram on page 11). You can also connect your own LCD to the ST62T40B LCD driver using the connector J2 (marked 16 on the Starter Kit board diagram on page 11). To be able to use either of these connectors, you must disconnect the resources that are already connected to the ST62T40B, to avoid external resource/Starter Kit board resource conflicts. The following tables list the Starter Kit board resources and the corresponding J1 and J2 connections, and indicates the jumper that disconnects each resource Table 1. J1 User's I/O Interface Connector
Signal 5V supply RESET OSC32in PB0 (3) PB2 PB4
(5) (2) (1)
Pin Number 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
Pin Number 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
Signal 5V supply (1) PSS OSC32out (2) PB1 (4) PB3 PB5 PB7 NMI OSCin Unused Unused PA3 PA5 (7) PA7 (7) GND
PB6 TIMER OSCout WDON Unused Unused PA4 (6) PA6 (7) GND
NOTE: 1. The 5V supply is available up to 200mA max current. 2. 32KHz oscillator is mounted on PCB at XT1, C5 and C6 locations.
19/49
23
Connecting External Resources to the Starter Kit Board
3. PB0 is connected to Analog Keyboard Array output. It can be disconnected by removing jumper JP4. 4. PB1 may be connected to Analog Keyboard reference voltage input (for interrupt mode). It can be disconnected by removing jumper JP5. 5. PB4 is connected to LED LD1. It can be disconnected by removing jumper JP3. 6. PA4 is connected to the trimmer RV1. It can be disconnected by removing jumper JP6. 7. PA5, PA6, PA7 are used to perform data transfer in programming mode (PROG configuration). In case these signals are connected to external user's sources, those sources must be disconnected (or set to High Z state) during programming operations. PA0, PA1, PA2 are used to perform data transfer with PC simulator software. They are not available for external usage in this operating mode. Thus, they are not present on J1 connector. Table 2. J2 User's LCD Interface Connector
Signal Unused Unused S47 S45 S43 S41 S39/PC6
(1)
Pin Number 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41
Pin Number 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42
Signal Unused Unused S48 S46 S44 S42 S40/PC7 (1) S38/PC5 (1) S36/PC3 (1) S34/PC1 (1) S32 S30 S28 S26 S24 S22 S20 S18 S16 S14 S12
S37PC4 (1) S35PC2 (1) S33/PC0 (1) S31 S29 S27 S25 S23 S21 S19 S17 S15 S13 S11
20/49
24
Connecting External Resources to the Starter Kit Board
Signal S9 S7 S5 Unused Unused COM2 COM1 5V
(2)
Pin Number 43 45 47 49 51 53 55 57 59
Pin Number 44 46 48 50 52 54 56 58 60
Signal S10 S8 S6 S4 Unused COM4 COM3 VLCD (2) VLCD2/3 (3)
VLCD1/3 (3)
NOTE: 1. The combi-port PC0-7 can be accessed on J2. It is normally connected to the LCD pins but, however, these LCD pins can be disconnected with JP2 jumper in order to use the combi-port. After Reset, these pins are configured automatically as LCD segment. 2. The VLCD input pin is connected to 5V supply voltage through a jumper between pins 57 and 58. To connect another voltage source, first remove this jumper and then feed pin 58 with the new VLCD voltage. 3. For the Starter Kit LCD, VLCD1/3 and VLCD2/3 are generated by the ST62T40B internal resistor divider. If needed, an external divider can be connected to these two pins as described in ST6240 data book, especially if VLCD < 4.5V.
21/49
25
Using The Starter Kit Board as a Hardware Simulator
6 USING THE STARTER KIT BOARD AS A HARDWARE SIMULATOR
WGDB6, the ST6 debugger that runs under Windows, lets you test your programs without having to program the EPROM of your target ST6. Depending how much information you want, and how close to real life you want your test environment to be, you can use WGDB6 in one of three ways: * As a software simulator. If you use WGDB6 as a simulator, you need not attach any additional hardware to your PC. The ST6 simulator program, that comes with WGDB6 and is run when you run WGDB6/Simulator, simulates the execution of your program, letting you step through the code and see what happens as the program runs. WGDB6 simulator includes Wave Form Editor, which simulates the output of the pins on your target ST6 in relation to inputs that you define, enabling you to see how its peripherals react to the inupts they receive. * With an ST6 hardware emulator. Emulators are hardware systems that act as your target microcontroller, at the same time capturing detailed information, such as which areas of memory are accessed by the program and what happens when they are accessed. In this case, WGDB6/Emulator provides an interface between the emulator and your PC, displaying data captured by the emulator and letting you implement the WGDB6 features in the emulator, such as software or hardware breakpoints. * With the Starter Kit board as a hardware simulator. This is a cross between the above two. The WGDB6 software simulator simulates the execution of your program, but each time the data space is accessed, it accesses that of the ST6 that is plugged into your Starter Kit board. Thus, using the Starter Kit board with WGDB6, you can view how the real microcontroller peripherals behave when your program is executed. This section describes the third option, how to use the Starter Kit board as a hardware simulator. You can use the Starter Kit board to emulate any ST624x microcontroller. When simulating programs designed for other microcontrollers, make sure that you do not use resources that are not available on the microcontroller your application is designed for.
22/49
26
Using The Starter Kit Board as a Hardware Simulator
6.1 The Data Transmission Driver Data is transferred between the simulated peripheral registers and the ST62T40B registers via the host PC's parallel port. The DEMOKIT2.HEX program, which is in the ST62T40B microcontroller that is soldered on the Starter Kit board includes the transmission driver.
The data transfer driver uses the following pins: PC parallel port D2 D3 D4 D6 SDOP ST62T40B PA2 PA0 RESET NMI PA1 SIMULATOR USAGE Synchronisation Write data to MCU Hardware reset of peripherals Initiates data transfer Read data from MCU
Note: Do not connect any external resources to the corresponding J1 connector pins when using the Starter Kit board as a peripheral emulator. 6.2 Technical Limitations The Starter Kit board has the following limitations when used with WGDB6 as a hardware simulator: * Real-time program execution is not supported. The program execution speed depends on your PC. * Resetting the ST62T40B by power up, pressing the Reset button or external reset does not reset the simulated ST6 core. To perform a complete simulated reset, use the WGDB6 reset command instead. * Interrupts sent by the ST62T40B microcontroller are not supported by the WGDB6 simulator. * The pins: NMI, PA0, PA1 and PA2 on the ST62T40B microcontroller are used for communications with the host PC, and are thus not available for simulation.
23/49
27
Using The Starter Kit Board as a Hardware Simulator
To use the Starter Kit board as a hardware simulator: 1 Power down the Starter Kit board. 2 Make sure that the ST62E46BF1 is not plugged into the SDIP56 ZIF MCU socket. 3 Select the USER mode using the jumper JP1 (marked 2 on the Starter Kit board diagram on page 11), as shown in the diagram below:
PROG
USER
4 Connect the Parallel port P2 on the Starter Kit board to a spare parallel port on your PC using the cable provided with the Starter Kit. 5 Power up the Starter Kit board. To run WGDB6: * If you are using Windows 95, click the Start button, point to Programs, then ST6 Tools, then click WGDB6/Simulator. * If you are using Windows 3.x, double-click the appropriate WGDB6/Simulator icon in the ST6 Tools program group. Refer to "WGDB6 User Guide" in the "ST6 Family Software Development Tools AST6, LST6, WGDB6" User Manual for full instructions on how to use WGDB6.
24/49
28
Using The Starter Kit Board as a Hardware Simulator
6.3 Error Messages The following table lists the error messages you may encounter when using WGDB6 with the Starter Kit board:
Error message Error 116 Port A protected when using board. Description This means that WGDB6 tried to access the PORT A registers. These are used for communications with the board. This means that a problem occurred during communications between the host PC and the board. Perform the checks listed below.
Error 117 Communication error with ST624x board.
6.4 Troubleshooting If there is a communication problem between WGDB6 and the Starter kit board, the title "WGDB6 Simulator" appears in the WGDB6 title bar. In this case, you shoud check the following: * That the Starter Kit board is correctly powered up. * That the parallel port cable is correctly connected. * That the device jumper JP1 is in the USER position. * That no ST62E46B is plugged into the Starter Kit board.
25/49
29
Exercises
7 EXERCISES
This section describes two exercises, in which you use your ST6 Starter Kit board as a hardware simulator with WGDB6: * In the first excercise, you're going to learn how to use WGDB6 to reset the LCD on your Starter Kit board then display the letter A on it. * In the second excercise, you're going to use WGDB6 to step through the instructions that display messages on the keyboard. 7.1 Exercise 1 1 Connect your Starter Kit board as a Hardware Simulator following the instructions given in "Using The Starter Kit Board as a Hardware Simulator" on page 22. Press the Reset button on the Starter Kit. 2 Run WGDB6 Simulator: If you are using Windows 95, click the Start button, point to Programs, then ST6 Tools, then click WGDB6/Simulator. If you are using Windows 3.x, double-click the appropriate WGDB6/Simulator icon in the ST6 Tools program group. The message `REMOTE' is displayed on the LCD of the Starter Kit board. The WGDB6 main window opens:
3 Load the file Stktrain.hex: i In WGDB6, on the File menu, click Open.
ii Browse to the directory c:\st6tools\sk624Xi1 iii Select the file stktrain.hex, then click OK. 4 The Disassembler window now opens, displaying the source code of stktrain.hex.
26/49
30
Exercises
5 Reset the simulated program: on the Commands menu, click Reset. The disassembler window opens, displaying the line 0xffe, which is set by the reset vector.
The LCD panel on the Starter Kit board is now clear, indicating that the WGDB6 simulator performed a physical reset of the ST62T40B plugged into the starter kit board. When the reset was performed, all segment outputs were set to OFF by setting the HFE bits 2, 1 and 0 of the LMCR register to 0. The LMCR register sets the LCD control mode. For full details about the LMCR, see the ST6240 Data Book.
27/49
31
Exercises
You are now going to locate the register LMCR, and change its value: 1 In the WGDB6 main window, on the Windows menu, click Browser. The Browser dialog box opens:
2 From the Type drop down list, choose data, as shown above (LMCR is a data address). 3 In the Filter field, type LMCR, as shown above. 4 Click Apply. LMCR is now displayed in the Symbols matching box, as shown above. 5 Select LMCR in the Symbols matching box, then click Inspect. The Inspect window opens, displaying the value of LMCR (which is 0):
28/49
32
Exercises
You are now going to change the value of LMCR to 36: 1 In the Inspect window, select the value `0', then on the Edit menu, click Modify, and overtype the value 0 with 36, and click Set. The contents of the inspect window are now 36 `$', indicating that the new LMCR value is 36. The value 36 corresponds to the following configuration: bits DS1-0 = hold the values 0 0, defining 1/4 duty. bits HF2-0 = hold the values 1 1 0, setting %256 main osc. bits LF2-1 = hold the values 1 1 0, setting the LCD frequency to 512 Hz. 2 Look at the LCD on the Starter Kit board, it now displays the message `REMOTE'. (If you already used the program, the message may not be `REMOTE'. It depends on what is in the memory) You are now going to manually build the character `A' that will be displayed on the LCD: 1 In the Inspect window, on the Edit menu, click Dump. The dump window opens, click on `Data' to display the contents of the data space starting at the address 0d0.
2 In the Address field in the Dump window, type the address 0e0, then press the Enter key on your keyboard. This moves the cursor to the beginning of the LCD RAM area. Observe the values from 0E0 to 0F7: these correspond to the letters `REMOTE' that are displayed on the LCD. Overtype all these values with the value `00', by repeatedly pressing the 0 key on your keyboard: you will note that all LCD panel segments are turned off.
29/49
33
Exercises
3 To build the letter A, in the Dump window overtype the values 00 with the following values:
At this address: 0e1 0e7 0ed 0f3 Which corresponds to this value: COM1 COM2 COM3 COM4 Type this value: 02 0e 07 00
Look at the LCD: the character `A' is now displayed at digit 0. Now try writing some of your own characters, using the information provided in "LCD Interface" on page 36. 7.2 Exercise 2 1 With stktrain.hex still loaded in WGDB6, in the WGDB6 main window, on the Commands menu, click Reset to reset the program. The Disassembler window opens, with the line jp init highlighted: this is the line pointed to by the reset vector. 2 In the WGDB6 main window, click the Cont button. The program counter jumps to the init address, which is the beginning of the program. Look at the Starter Kit LCD: it is first cleared, then the word `DISPLAY', followed by `KEY' is displayed on it. Press some keys on the starter kit keyboard, and note the result: the keys you press are displayed on the right side LCD. Bear in mind that the program is being simulated, and thus is not running in real time mode, so you may have to keep keys pressed for several seconds until they are displayed on the LCD. 3 In the WGDB6 main window, click the Stop button. 4 In the Disassembler window, type m_disp in the top right field, next to the Page field, and press the Enter key on your PC keyboard. The disassembled code around the address m_disp is displayed, with the m_disp address highlighted. Click the Break button in the Disassembler window to set a breakpoint
30/49
34
Exercises
on the m_disp address: program execution will now stop when the PC reaches this address.
5 In the Disassembler window, on the Commands menu, click Reset. 6 Type init in the top right field, next to the Page field, and press the Enter key on your PC keyboard. The program counter now jumps to the beginning of the program. 7 On the Commands menu, click Continue. This continues running the program, until the breakpoint you placed on the line of m_disp is reached. Wait for program execution to stop. 8 Click the Next button to execute the next line of the program, and look at the LCD : it displays one segment, that has been turned on by the instruction: ldi E1, 80. Keep pressing the Next button to execute each instruction in turn, watching the effects each one has on the LCD. You will notice that each time you press the Next button, a few more segments are turned on, until the word `DISPLAY' appears on the LCD. Now that you are familiar with WGDB6, try stepping through the program yourself, observing the effects each command has on the LCD, and modifying data to see the effect it has on the LCD.
31/49
35
Programming ST6 Microcontrollers
8 PROGRAMMING ST6 MICROCONTROLLERS
You can use the Starter Kit board, in conjunction with the program Epromer, to program ST62E46B or ST62T46B microcontrollers. You can also perform in-circuit programming of ST62E4X or ST62T4X OTP/EPROM microcontrollers using your own board, connected to the Starter Kit board via the connector P1 (marked 1 on the Starter Kit board diagram on page 11). NOTE: The PA5, PA6, PA7 and RESET pins are used to perform programming operations. If these pins are connected to an external resource via J1, you must either disconnect them (see "Connecting External Resources to the Starter Kit Board" on page 19) or set them to high impedance state during programming operations. This section describes how to set up the Starter Kit board for programming microcontrollers, and lists the connection requirements for in-circuit application boards. 8.1 Setting Up the Starter Kit Board 1 Power down the Starter Kit board. 2 Plug the ST62E46B/T46B microcontroller you want to program into the MCU socket on the Starter Kit board. 3 Select the PROG mode using the jumper JP1(marked 2 on the Starter Kit board diagram on page 11), as shown in the diagram below:
PROG
USER
32/49
36
Programming ST6 Microcontrollers
4 Connect the Parallel port P2 on the Starter Kit board to a spare parallel port on your PC using the cable provided with the starter kit. 5 Power up the Starter Kit board. You can now use Epromer to program the microcontroller that is plugged into the Starter Kit board. NOTE: Epromer does not work under Windows NT. To run Epromer from Windows 3.x, double-click the Epromer icon in the ST6 Tools group. To run Epromer from Windows 95, click Start, Programs, ST6 Tools, then Epromer. For instructions on how to operate Epromer, click Help in the Epromer main window. 8.2 In-Circuit Programming You can perform in-circuit programming of ST62E4x and ST62T4x EPROM/OTP microcontrollers using your own board, connected to the Starter Kit board via the connector P1 (marked 1 on the Starter Kit board diagram on page 11). 8.2.1 Application Board Connections The following paragraphs specify the connection requirements between your application board and the Starter Kit board. The application board must have a suitable 16-way connector (8x2 header HE10) to be connected via a 16-way cable to connector P1 (marked 1 on the Starter Kit board diagram on page 11) on the Starter Kit board. The following table shows the required pin connections: Table 3. Signal interconnection to different ST6 families
8x2 Connector Pin 1 Pin 3 Pin 5 Pin 7 Pin 9 Pin 11 Pin 13 Pin 14+16 Pin 2+4+8 I/O O O O I O I O Power Power ST621X/2X PB6 PB5 OSCin PB7 RESET OSCout VPP/TM VDD VSS ST624X PA6 PA5 OSCin PA7 RESET OSCout VPP/TM VDD VSS ST626X/9X PB3 PB0 OSCin PB2 RESET OSCout VPP/TM VDD VSS
33/49
37
Programming ST6 Microcontrollers
VDD Use of the VDD connection is optional, depending on whether the application board supply can or cannot be disconnected. If the application board supply is disconnected, you can supply it through pins 14 and 16 of the connector, as long as the total load current does not exceed 100 mA, and the capacitive load is less than 50 F. If the application board has its own power supply, its voltage must be set to 5V, so that logic levels are compatible with those of the Starter Kit board. OSCin Synchronises the programming operations using a clock generated by the programming tool. OSCin is located on the application board, and must be directly connected to Pin 5 on the 16way connector. No isolation is needed as long as a quartz crystal or ceramic resonator is used in the application. If an external clock generator is used in the application, it must be disconnected during in-circuit programming. RESET Controls the programming mode entry. To prevent signal level contention, RESET must be directly connected to Pin 9 on the 16-way connector, and must be isolated from other nodes on the application board. Any direct connection to V DD, VSS or an output must be avoided. This pin can be connected to a CMOS input, a 2 K pull-up, a 10 KOhm pull-down or left open (Internal pull-up). The capacitive load of the RESET pin should not exceed 1
F.
Pins 1 and 7 on the 16-way connector are used to establish communications between the programming tool and the microcontroller. To prevent signal-level contention, Pins 1 and 7 must be directly connected to PA6 and PA7 on the 16-way connector, and must be isolated from other nodes on the application board. Any direct connection to V DD, VSS or an output must be avoided. These pins may be connected to a CMOS input, a 2 K pull-up, a 10 KOhm pull-down or left open (Internal pull-up). If pin 3 on the 16-pin connector is connected to the target device, the same applies. Connection to pin 3 is not necessary if a high voltage level is guaranteed by the board design. Some I/O pins are not connected to the 16-way connector and must be set to a high level during programming. This is normally achieved by the RESET signal sent by the programming tool through the 16-way cable, setting the I/O pins as inputs with an internal 300 K pull-up. To keep these I/O lines high, direct connection of these pins to GND or to any other signal at low level (even temporarily) must be avoided. Only connections to another CMOS input, to an external pull-up or a 10 M pull-down is allowed. The Vpp/TM pin must not be directly connected to GND/VSS on the application board, to avoid any conflict with the programming voltage provided by the programming tool via pin 13 on the
34/49
38
Programming ST6 Microcontrollers
connector. This pin should be pulled down by a resistor with minimum value of 10 K. You must add a 100 nF ceramic capacitor between Vpp/Test and VSS. 8.3 Setting Up the Starter Kit Board for In-Circuit Programming 1 Power down the Starter Kit board. 2 Select the PROG mode using the jumpers JP1 (marked 2 on the Starter Kit board diagram on page 11), as shown in the diagram below:
PROG
3 Connect the Parallel port P2 on the Starter Kit board to a spare parallel port on your PC using the cable provided with the starter kit. 4 Connect your application board to the connector P1 (marked 1 on the Starter Kit board diagram on page 11) on the Starter Kit board. 5 Power up your Starter Kit board. You can now use Epromer to program the microcontroller that is on your own board. NOTE: Epromer does not work under Windows NT. To run Epromer from Windows 3.x, double-click the Epromer icon in the ST6 Tools group. To run Epromer from Windows 95, click Start, Programs, ST6 Tools, then Epromer. For instructions on how to operate Epromer, click Help in the Epromer main window. If your application board is not powered by the Starter Kit, you must connect it to a 5V DC power supply before you start programming.
35/49
39
LCD Interface
9 LCD INTERFACE
9.1 ST6240 LCD DRIVER OVERVIEW This is a quick summary of the features of the ST6240 LCD driver. Refer to the ST6240 data book for more detailed information. The ST6240 LCD driver comprises LCD control logic, a programmable prescaler, a 24-byte wide dedicated LCD RAM, 45 segments and 4 common outputs. This drives up to 180 LCD segments. The LCD control logic operates automatically and without interrupting the processor. The LCD driver configuration is defined by the following ST6240 registers: * LMCR (LCD Mode Control Register), which defines the LCD backplanes (duty cycle) and the frame frequencies used by the LCD. * LCD RAM (24 bytes), which sets each segment to ON or OFF by setting or resetting the corresponding bit. According to the contents of the LCD RAM, the drivers generate the segments and common signals which can directly drive an LCD panel. Hardware configuration requirements are reduced to minimum: * The VLCD input pin must be fed with VLCD voltage (independently of VMVDD), according to your LCD panel specifications. * The VLCD1/3, VLCD2/3 pins are connected to intermediate VLCD voltages, to enable external capacitive buffering or resistive shunting. An internal resistor network is implemented so that in most cases, thus no additional components are necessary. To interface with the LCD panel, all you have to do is: * Determine the operating LMCR register value according to the LCD panel specifications. * Generate the correct VLCD voltage and, if needed, connect an external resistor network to the VLCD1/3 and VLCD2/3 pins. * Determine the most suitable mapping between the LCD panel segments and the LCD RAM bits. Once you've completed the above steps, controlling the LCD panel becomes as easy as modifying software bits.
36/49
40
LCD Interface
9.2 STARTER KIT LCD PANEL INTERFACE The following paragraphs describe how the starter kit LCD panel interfaces with the ST62T40B microcontroller. The LCD panel used on ST62T40B Starter Kit board has 8 alphanumeric digits. Each digit is based on a 16-segment matrix operating in multiplexed mode (1/4 duty) so that only 4 segment pins are required per digit. Thus the following pins are required for the 8 digits: * 32 segment (SEG) pins * 4 common (COM) pins VLCD operating mode is 5V. Digits are annotated from 0 to 7 respectively from right to left as shown by the following diagram:
8 ALPHANUMERIC DIGITS LCD
X A H F G I J B K F G X A H I J B K F G X A H I J B K F G X A H I J B K F G X A H I J B K F G X A H I J B K F G X A H I J B K F G X A H I J B K
L E M
N C E
L M
N C E
L M
N C E
L M
N C E
L M
N C E
L M
N C E
L M
N C E
L M
N C
D DP
D DP
D DP
D DP
D DP
D DP
D DP
D DP
digit 7
digit 6
digit 5
digit 4
digit 3
digit 2
digit 1
digit 0
VR0A1879
37/49
41
LCD Interface
Each digit is made up of 16 segments (A,B,C,D and so on) as shown by the following diagram:
X A H F G I J B K
L E M
N C
D
DP VR001879
Each segment can be set to ON or OFF, depending on the state of its dedicated Segment and Common lines, according to the boolean equation: segment ON = Seg_line and Com_line active Each DIGIT requires 4 SEG lines X 4 COM lines to be completely defined. The following diagram shows the graphic segments that are switched on according to each active COM:
X A H F G I J B K F G X A H I J B K F G X A H I J B K F G X A H I J B K
L E M
N C E
L M
N C E
L M
N C E
L M
N C
D DP COM1
D DP COM2
D DP COM3
D DP COM4 VR0B1879
38/49
42
LCD Interface
The following table shows the mapping between graphic elements set and the segment/common pins. Table 4. Digit Matrix to Segment/COM Pins Mapping
PIN 1 2 3 4 5 6 7 8 9 10 11 12 COM 7X 7I 6X 6I 5X 5I 4X 4I 3X 3I 2X 2I C1 SEGMENTS 7F 7J 6F 6J 5F 5J 4F 4J 3F 3J 2F 2J C2 7E 7K 6E 6K 5E 5K 4E 4K 3E 3K 2E 2K C3 7D 7N 6D 6N 5D 5N 4D 4N 3D 3N 2D 2N C4 PIN 13 14 15 16 17 18 19 20 21 22 23 24 COM 1X 1I 0X 0I . . . C01 0A 0H 1A 1H C1 SEGMENTS 1F 1J 0F 0J . . C02 . 0B 0G 1B 1G C2 1E 1K 0E 0K . C03 . . 0C 0L 1C 1L C3 1D 1N 0D 0N C04 . . . 0DP 0M 1DP 1M C4 PIN 25 26 27 28 29 30 31 32 33 34 35 36 COM 2A 2H 3A 3H 4A 4H 5A 5H 6A 6H 7A 7H C1 SEGMENTS 2B 2G 3B 3G 4B 4G 5B 5G 6B 6G 7B 7G C2 2C 2L 3C 3L 4C 4L 5C 5L 6C 6L 7C 7L C3 2DP 2M 3DP 3M 4DP 4M 5DP 5M 6DP 6M 7DP 7M C4
For example, the graphic element 7J (J of digit 7) is driven by SEG line S2 (pin 2) and COM line C2 (pin 19). For digit 2, pin 12 drives segments I,J,K,N when COM lines C1,C2,C3,C4 respectively are active.
39/49
43
LCD Interface
9.3 Interfacing The LCD Panel with the ST6240 LCD Driver When assigning the LCD panel segments to the LCD RAM bits, the mapping used will depend on the LCD you are using. It is recommended that you define the character mapping after defining your software architecture. Make sure, however that this mapping is kept as simple as possible. For example, the description map of each character in LCD RAM should be the same for all the 8 digits on the LCD. The LCD panel requires 32 segment lines multiplexed through 4 common lines. This is less than the capabilities of the ST6240. Segments S9 to S39 and outputs COM1,2,3,4 of ST6240 LCD driver are connected to the LCD panel inputs as described in the following diagram.
LCD PANEL S39 S37 S35 S33 S31 S29 S27 S25 ST6240 OUTPUTS S23 S21 S19 S17 S15 S13 S11 S9 COM4 COM3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 COM4 18 COM3 digit 0 digit 1 digit 2 digit 3 digit 4 digit 5 digit 6 digit 7 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 COM1 20 COM2 19 S40 S38 S36 S34 S32 S30 S28 S26 S24 S22 S20 S18 S16 S14 S12 S10 COM1 COM2
VR001880
ST6240 OUTPUTS
40/49
44
LCD Interface
The following table lists the location of each digit definition in the ST6 RAM. Note that the memory is not entirely used. Table 5. Digit Locations in LCD RAM
LCD RAM Address E1h E2h COM1 E3h E4h E7h E8h COM2 E9h EAh EDh EEh COM3 EFh F0h F3h F4h COM4 F5h F6h D7 D6 D5 D4 Digit 1 Digit 3 Digit 5 Digit 7 Digit 1 Digit 3 Digit 5 Digit 7 Digit 1 Digit 3 Digit 5 Digit 7 Digit 1 Digit 3 Digit 5 Digit 7 D3 D2 D1 D0 Digit 0 Digit 2 Digit 4 Digit 6 Digit 0 Digit 2 Digit 4 Digit 6 Digit 0 Digit 2 Digit 4 Digit 6 Digit 0 Digit 2 Digit 4 Digit 6
Each digit is represented by 4 bits (MSB for odd digits, LSB for even digits) in each COM memory area. Each set of 4 bits x 4 COMs are assigned to the 16 bits defined above as shown in the following table. Table 6. LCD RAM Bits Mapping
Bit 7/3 COM1 COM2 COM3 COM4 H G L M Bit 6/2 X F E D Bit 5/1 A B C DP Bit 4/0 I J K N
41/49
45
LCD Interface
9.4 Character Definition Examples The following examples show the definition of characters using the previously described method. 9.4.1 Character A Definition The following diagram represents the `A' character to be displayed on the LCD panel.
X
A H F G I J B K
L E M
N C
D
DP VR0C1879
The following table gives the corresponding bit pattern to be set in the LCD RAM to display the character `A' on the LCD panel. The bits set to 0 are left blank, and the bits set to 1 are shaded. The right column provides the corresponding hexadecimal value.
D3 COM1 COM2 COM3 COM4 H G L M D2 X F E D D1 A B C DP D0 I J K N Hex value 2 E 7 0
This description is valid for all characters. The position of the displayed character depends only on the addresses and the position (LS/MS nibble).
42/49
46
LCD Interface
9.4.2 Character 3 Definition The following diagram shows the character 3 to be displayed on the LCD.
X
A H F G I J B K
L E M
N C
D
DP VR0D1879
The following table gives the corresponding bit pattern to be set in the LCD RAM to display the character `3' on the LCD panel.
D3 COM1 COM2 COM3 COM4 H G L M D2 X F E D D1 A B C DP D0 I J K N Hex value 2 A 3 4
The set of 4 x 4 bits (representing the character set) can be stored in the ST624x DATA ROM and easily used by display software through indexed accesses.
43/49
47
LCD Interface
9.5 Starter Kit LCD Panel Character Set Software Model As described in the previous paragraphs, LCD connection and character mapping drive a software model of the LCD-displayable objects. These objects are available for DISPLAY routines to drive LCD panel display during program execution. The following paragraphs describe three methods of displaying characters on the LCD. 9.5.1 Direct Code LCD RAM Patching This is the most simple way to display digits on an LCD. The mapped character values are directly patched into the corresponding LCD RAM locations. The bit map values are contained in the immediate values of write instructions. This method should only be used for very simple applications (few characters, displayed few times) or for rapid evaluation. The following block of code shows how to use direct code LCD RAM patching to display the character `A' at digit 0, where x is the value of the MSB (digit 1): disp_A_0 ldi E1, x2 ldi E7, xE ldi ED, x7 ldi F3, x0 9.5.2 Indexed Data ROM The mapped values of character sets are defined into ST6240 Data ROM area (refer to ST6240 databook). The AST6/LST6 .byte directive and .w and .d labels define and access the Data ROM area. A generic display call subroutine accesses the character definition map through the parameter passed by the calling program. The disp_0 subroutine (see below) displays a character at digit 0 and clears digit 1 (MSB of the same LCD RAM locations). An efficient generic display subroutine should manage the digit number (as input parameter) and perform the read/modify/write only on the concerned nibble in the LCD RAM byte (MSB or LSB). This is done by the display subroutine delivered with the ST6240 Starter Kit library (please read the README file provided in the SK6240LIB directory). A character is defined by 4 x 4 bit words = 16 bits. To optimize the character set size in Data ROM, it is useful to compact these 16 bits into 2 bytes, however this method increases the display routine complexity. ;value 2 to digit 0 COM1 addr (E1, LSB) ;value E to digit 0 COM2 addr (E7, LSB) ;value 7 to digit 0 COM3 addr (ED, LSB) ;value 0 to digit 0 COM4 addr (F3, LSB)
44/49
48
LCD Interface
For the ST6240 Starter Kit demo routines, the character set is defined as follows (for example character A): CHAR_A. .byte 22 .byte EE .byte 77 .byte 00 The character is displayed using the following routine: disp_A_0 ldi RWSR, CHAR_A.w;set Data ROM Window register ldi X, CHAR_A.d call disp_0 disp_0 ld E1, (X) inc X ld E7, (X) inc X ld ED, (X) inc X ld F3, (X) ;X set to point to CHAR_A ;subroutine that displays digit 0 ; output value 2 to digit 0 COM1 ;(E1, LSB) ;X set to second byte of CHAR_A ;output value E to digit 0 COM2 ;(E7, LSB) ;X set to third byte of CHAR_A ;output value 7 to digit 0 COM3 ;(ED, LSB) ;X set to fourth byte of CHAR_A ;output value 0 to digit 0 COM4 ;(F3, LSB)
Four bytes are used to define a character, with MSB and LSB equal to the 4 bit definition values. In this way, MSB and LSB are easily distinguished using the AND instruction for masking the non-relevant nibble. 9.5.3 Complete Message Display You can simplify the definition of complete messages using the AST6 .ASCIZ directive. This directive returns the ASCII code pattern of the characters indicated ended by NULL). To enable you to use the .ASCIZ directive, the ST6240 character set is pre-defined in the Data ROM so that it becomes simple to access a mapped character definition through the character's ASCII code. One Data ROM window contains 64 bytes. As a character definition map requires 4 bytes, 16 characters can be defined in a whole window. This corresponds to a page of ASCII codes (represented by the MSB of the ASCII code).
45/49
49
LCD Interface
For example characters @, A, B through O, whose ASCII codes are 40,41,42 through 4F (Hex) respectively, represent the ASCII code page 4, and fill a Data ROM window as shown below: .ORG x00;beginning of a window 0 CHAR_@.byte 22;address 0 in the window .byte AA .byte BB .byte 44 1 CHAR_A.byte 22;address 3 in the window .byte EE .byte 77 .byte 00 through F CHAR_O.byte 22;address 3C in the window .byte 66 .byte 66 .byte 44;last address (3F) in the window For example, the ASCII code of character A is 41 (hex): * 4 specifies the Data ROM window number * 1 indexes the number of the character in the Data ROM window The available LCD character set that is delivered with the ST6240 Starter Kit library is defined using this method. This allows the asci_dis subroutine to display a character defined by its ASCII code and Mdis_mes subroutine to display a complete message, built using the ASCIZ AST6 directive, on the LCD panel. Refer to the files SK6240LI.INI and SK6240LI.ASM in the SK624XLI directory for a description of these subroutines.
46/49
50
Hardware Information
10 HARDWARE INFORMATION
10.1 Part List
Part U1 U2 U3 U4 U5 U6 U7, U8 U9 U10 XT1 RV1 D1, D2, D3 D4 D5 Z1 LD1, LD2 T1, T3 T2 T4 L1 C1, C2, C10, C15 C16,C17,C18,C20,C23,C25 C3, C4, C7, C8, C9, C11, C12, C13, C14 C5, C6 C19, C21 C22 C24 C26 SW1 JP1 to JP6 74LS244 8MHz oscillator ST62T40B MCU ST62E46B MCU socket 74LS04 LCD panel 78L05 Voltage Regulator 7805 Voltage Regulator Keyboard 32.768 KHz crystal 10K resistor trimmer 1N4148 diode BYV 10-20 Schottky 1N4004 diode 8.2V Zener diode Red LED BC547B transistor BC557B transistor BD236 transistor Self 2x2H 100nF (Cd) 100nF 100pF 100pF 15pF 1.0nF 22F 10F 1F Push-button jumpers Device Part R1, R16 R2, R11, R28 R3 R4, R26 R5, R8 R6 R7, R9 R10, R27 R12 R13 R14 R15 R17 R18 R19 R20 R21 R22 R23 R24, R25 R29 RS1, RS5 RS2 RS3, RS4 RV1 P1 P2 J1 J2 J3 J4 100 1K 47 390 10K Not connected 4.7K 560 68 75 82 7.5K 120 150 2.7K 3.3 180 220 270 1.2K 820 3.3K SIL8 Array 10K SIL9 Array 150 SIL8 Array 10K resistor trimmer Header 2x8 SUBD25-M Connector 2x15 pins connector 2x30 pins connector Female Jack plug 2nd power supply conn. Device
10.2 Starter Kit Board Schematic See next page
47/49
51
1
GND 2 2 GND VDD GND VPP VDD HE10-16DM USER S I / O I N ' TERFACE VDD J1 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 U3 VDD GND VDD GND 1 1 VDD + C24 D4 JP6 MW2X1C 1 2 10MF-CT-16V 1 2 2 R10 560 BC557B-PNP-45V 1 3 T2 12 2 1 C25 100NF 2 3 1
U7 78L05 1 3 I O G ND C18 TO 92 100NF VCC 1 C17 100NF RV1 10K-RV PA6/TRO PA5/TM2 OSCP PA7/SDOP RESETP/ 1 3 5 7 9 11 13 15 2 4 6 8 10 12 14 16 MW1X1C MW1X1C I N SI TU PR G CO O. NNECTO R P1 GND 2
1
1
1
1
3
2
2
J3 D1 D3 21 1N4148 R9 1 4.7K 2 22 2 C16 100NF 1 4.7K GND DZ 8.2V 1 32 GND 1 G9 9 1 Sol der B i dge r 2 74LS04 E NVPP Level com i bi l i t y pat G8 2 S der Br i dge ol GND + 1 VCC 1 SW1 Re s e t Pu s h 5 4 1 2 VDD GND 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 RESETP/ 2 1K 2 S der Br i dge ol G3 FOUT Sol der Br i dge 8MHZ-OSC OSC32I 1 2 3 31 1 2 EMC_F 2 RS2 GND 2 3 4 5 6 7 8 9 20 U1 R3 1 47 C11 100PF 2 1 OSCIN46B GND LD1 LED-RED-5MM 10K-SIL9-8R-B C6 15PF F1 GND 1 VDD 1 G4 XT1 2 OSC32O 1 MW2X1C 1 C5 15PF 2 2 1 32.768KHZ-XT-P 3 2 1 74LS04 U2 GND G5 1 R28 1 3 GND C12 100PF U5A GND 1 1 2 1 1 C8 100PF 2 C7 100PF 2 R2 1K C26 2 1 1MF-ER-63V 1 1 GND 10K T3 G1 8 2 1 1 2 2 R8 VPP PA4 PA6/TRO U5D GND R7 4.7K Z1 R6 R5 6 T1 10K U5B GND 3 4 ENVDD 1 22 1 S42 S41 PC7/S40 PC6/S39 PC5/S38 PC4/S37 PC3/S36 PC2/S35 PC1/S34 PC0/S33 S32 S31 S30 S29 S28 S27 1 2 2 1N4148 D2 1 1N4148
C19 3
L1
1N4004
3.3
4
1
2
2
2
JACK
GND
J4
GND
2 21 1
22MF-EA-25V
1.0NF
SELF 2x2.2yH
2
C22 GND U8 78L05 1 3 I O G ND TO 92 C20 100NF 2
U5C
BYV 10-20 SCHO
100PF
1 32 BC547B-NPN-45V
2
1
BC547B-NPN-45V
RS4
GND
Sol der Br i dge
1
2
2
150-SIL8-4R-B
C9 100PF
S43 S44 S45 S46 S47 S48 COM4 COM3 COM2 COM1 VLCD1/3 VLCD2/3 VLCD PA7/Ain PA6/Ain PA5/Ain PA4/Ain VPP/TM PA3/Ain PA2/Ain PA1/Ain PA0/Ain VDD VSS GND U5F 13 74LS04 ST62T40B GND 12 RS OSCOUT OSCIN WDON NMI TIMER PB7/Sout PB6/Sin PB5/Scl PB4 PB3/Ain PB2/Ain PB1/Ain PB0/Ain OSC32out OSC32in
8 6 4 2 2 C3 100PF 2
7 5 3 1
RESETP TM2 PPINT
S der Br i dge ol 2
RESET/ OSCOUT OSCIN WDON NMI TIMER PB7 PB6
OSC32I OSC32O PB0 PB1 PB2 PB3 PB4 PB5 JP3 2 I RQ JP4 MW2X1C 2
R1
1
1
2
SDOP
3 2 1
2
PC i n t e r f a c e c o n n e c t o r Pa r a l l e l Po r t P2 1 14 2 D0 15 3 D1 16 4 D2 17 5 D3 18 6 D4 19 7 D5 20 8 D6 21 9 D7 22 10 23 11 24 12 25 GND 13 S der Br i dge ol 2 1
1
VCC D1 ( di sabl es VPP) D4 ( di sabl es RESE ) T/ VDD
2
1
DD) D0 ( enabl es V
AKEY U10 68 R12 11 75 R13 R4 390 82 R14 1 1 1 2 14 2 2 1 2 K0 K1 K2
G7 E NVPP Level com i bi l i t y pat
2
1
8 6 4 2
7 5 3 1
G6
3.3K-SIL8-4R-B
GND
RS1
2
2
VDD GND 1 19 1G 2G 10 74LS244
TROMIN TM2 OSCPI ( SDO 46B) PA7/SDOP P ( SDO 40B) PA0 P PPINT OSCPI TROMIN 1A1 1A2 1A3 1A4 2A1 2A2 2A3 2A4 1Y1 1Y2 1Y3 1Y4 2Y1 2Y2 2Y3 2Y4
2
1
1
2
2
1
L CD Pi n s Pr o t e c t i o n i f Co mb i - Po r t PC0 - 7 i s u s e d D5.C D5.A D4.C D4.A D3.C D3.A D2.C D2.A D1.C D1.A COM4 COM3 LCD VIM878 D4.D D4.B D3.D D3.B D2.D D2.B D1.D D1.B COM1 COM2 D5.D D5.B JP2 S19 S17 S15 S13 S11 S9 COM4 COM3 17 18 15 16 13 14 11 12 S23 S21 9 10
1
2
S24 S22 26 25 24 23 22 21 20 19 S20 S18 S16 S14 S12 S10 COM1 COM2 PA7/SDOP PA6/TRO PA5/TM 2 VPP RESET/ VDD GND OSCIN46B
2
52
TP1 TP2 1 R20 2 BD236-PNP-60V 1 T4 2 U9 LM7805 1 3 I O G ND C23 TO 220 100NF PC2/S35 PC3/S36 PC4/S37 PC5/S38 PC6/S39 PC7/S40 S41 S42 PSS OSC32O PB1 PB3 PB5 PB7 OSCIN PA3 PA5/TM2 PA7/SDOP GND PC1/S34 PC0/S33 S3 2 S3 1 S3 0 S2 9 S2 8 S27
48/49
RESET/ OSC32I PB0 PB2 PB4 PB6 TIMER OSCOUT WDON 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 MW2X15C Not used U5E 11 74LS04 10 S43 S44 S45 S46 S47 S48 COM4 COM3 COM2 COM1 VLCD1/3 VLCD2/3 VLCD PA7/SDOP PA6/TRO PA5/TM 2 PA4 VPP6240 PA3 PA2 PA1 G2 PA0 S26 S25 S24 S23 S22 S21 S20 S19 S18 S17 S16 S15 S14 S13 S12 S11 S10 S9 S8 S7 S6 S5 S4 PSS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 S26 S25 S2 4 S2 3 S22 S21 S2 0 S1 9 S1 8 S1 7 S1 6 S15 S14 S1 3 S1 2 S1 1 S10 S9 S8 S7 S6 S5 S4 PSS JP5 MW1X3C PO LL R11 1K VDD 2 4 6 8 11 13 15 17 18 16 14 12 9 7 5 3 PA6/TRO PA5/TM2 OSCP SDOP SDOP NMI PA2 PA1 100 GND VDD VCC U4 S39 S37 D8.D D8.B D7.D D7.B D6.D D6.B 30 29 28 27 32 31 S32 S30 S28 S26 34 33 S36 S34 S35 S33 3 4 D7.C D7.A D6.C D6.A 5 6 7 8 S31 S29 S27 S25 1 2 S40 S38 U6 D8.C D8.A 36 35 SDI P5 6 S OCK E T C10 100NF GND VDD C15 100NF GND C2 100NF GND VDD C1 100NF GND VDD 120 150 180 220 270 390 560 820 R16 R17 R18 R21 R22 R23 R26 R27 R29 1.2K R25 2.7K R19 7.5K R15 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 3 5 6 7 9 2 10 2 11 2 13 2 15 2 16 2 12 2 8 4 GND 17 K3 K4 K5 K6 K7 K8 K9 KA KB KC KD KE KF COM KEYBOARD 1 3 5 7 9 11 13 15 MW2X8C 2 4 6 8 10 12 14 16 S40 S39 S38 S37 S36 S35 S34 S33 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 PC3/S36 PC4/S37 PC5/S38 PC6/S39 PC7/S40 S41 S42 S43 COM4 COM3 COM2 COM1 VLCD1/3 VLCD2/3 VLCD Ain/PA7 Ain/PA6 Ain/PA5 Ain/PA4 TEST/Vpp VDD VSS RESET OSCout OSCin NMI PB7/Sout PB6/Sin ST6246B PC2/S35 PC1/S34 PC0/S33 S32 S31 S30 S29 S28 S27 S26 S25 S16 S15 S14 S13 S12 S11 S10 S9 PSS OSC32in OSC32out PB0/Ain PB1/Ain PB2/Ain PB3/Ain PB4 PB5/Scl 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 j u mp e r s 2. 54
2
R24
LD2
12
1
1.2K
LED-RED-5MM
D5
1
2
2 3 1
1
2
C21 1.0NF
+
Hardware Information
ED102
C14
5
GND
2
1
74LS04
ENVPP
C13 100PF 74LS04
8 6 4 2
7 5 3 1
OSCPI TROMIN
RS3
150-SIL8-4R-B
REM/
C4 100PF
100
SUBD25C-F-COUDE
GND
GND
RS5
8 6 4 2
7 5 3 1
3.3K-SIL8-4R-B
J2
US S LCD I NTE ER' RFAC E
JP1
1 2 3
PRO G PROG/ REM/ SIM/
S47 S45 S43 S41 PC6/S39 PC4/S37 PC2/S35 PC0/S33 S31 S29 S27 S25 S23 S21 S19 S17 S15 S13 S11 S9 S7 S5
S48 S46 S44 S42 PC7/S40 PC5/S38 PC3/S36 PC1/S34 S32 S30 S28 S26 S24 S22 S20 S18 S16 S14 S12 S10 S8 S6 S4
MW1X3C
USER
PC7/S40 PC6/S39 PC5/S38 PC4/S37 PC3/S36 PC2/S35 PC1/S34 PC0/S33
COM2 COM1 VDD VLCD1 /3
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
COM4 COM3 VLCD VLCD2/3
MW2X30C
14
f e ma l e
Hardware Information
Notes:
Information furnished is believed to be accurate and reliable. However, SGS-THOMSON Microelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of SGS-THOMSON Microelectronics. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. SGS-THOMSON Microelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of SGS-THOMSON Microelectronics. (c)1998 SGS-THOMSON Microelectronics - All rights reserved. Printed in France by Imprimerie AGL Purchase of I2C Components by SGS-THOMSON Microelectronics conveys a license under the Philips I2C Patent. Rights to use these components in an I2C system is granted provided that the system conforms to the I2C Standard Specification as defined by Philips. SGS-THOMSON Microelectronics Group of Companies Australia - Brazil - Canada - China - France - Germany - Italy - Japan - Korea - Malaysia - Malta - Morocco - The Netherlands Singapore Spain - Sweden - Switzerland - Taiwan - Thailand - United Kingdom - U.S.A.
49/49
5


▲Up To Search▲   

 
Price & Availability of 5745

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X