ST7 FAMILY
ST7MDT20 EVALUATION BOAR D
EXERCISE MANUAL
Release 1.8
Ref: DOC-ST7MDT20-EVx
ST7 FAMILY
ST7MDT20 EVAL BOAR D
EXERCISE MANUAL
July 2002
REF- DOC -ST7MD T20-EV x
1
USE IN LIFE SUPPORT DEVICES OR SYSTEMS MUST BE EXPRESSLY AUTHORIZED.
STMicroelectronics PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN
LIFE SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS WRITTEN APPROVAL OF
ST Microe lectron ics. As used herein:
1. Life support devices or systems are those
w hich (a) are intended for surgical impla nt into
the body, or (b) support or sustain life, and
whose failure to perform, when properly used in
accordance with instructions for use provided
with the product, can be reasonably expected
to result in significa nt injury to the user.
2. A critical compone nt is any comp onent of a life
support device or system whose failure to
perform can reasonably be expected to cause
the failu re of the life support dev ice or system ,
or to affe ct it s saf e ty or eff ectivene ss.
July 2002 5/33
Rev. 1.8
ST7 MDT20 Evaluation Board
Exer cis e Ma nual for t he S T 7 M DT2 0 E val B oard
INTRODUCTION
This document is intended for people getting started with ST7 microcontrollers or who are
writing ST7 Ass embly or C Code for the f irst time. It gives practical guidelines for performin g
the exercises using the ST7 MD T20 Eval Board and allows users to get to know ST7 periph-
erals and software tools.
The “MCU ON CD” CD-ROM containing the tutorial exercises is incl uded in this package. The
tutorial exercise installation procedure will create all the resource files (located in the INIT di-
rectory) and source file s for the solutions (locat ed in the RE SULT directo ry) on the PC hard
disk drive, as w ell as the batch files required to compile, assemble and link. This manual and
the associated exercises are also available on ST Internet site (http://mcu.st.com). To simpli fy
the use of the Hiware C exercises, select the default configuration when installing the soft-
ware.
To install the tutorial exercises, insert the MCUonCD into the disk driver, the autorun program
is then executed. Click on “Ins tall your Developm ent Tools”, then click on “S T7 Tools”, fina lly
click on “Tutorial exercises”.
To help explain the exercises, the MDT20 Evaluation Board may be used. This evaluation
board is described in the following sections.
Two MDT20 evaluation boards are available:
ST7MDT20-EVY/xx: that’s the one which was existing under the previous sales type:
ST7MDT2-TRAIN/xx with the socket Yamaichi (IC149) mounted on it (refer to 1.3
Connection). You have to use the DB200 adaptor to be able to put the emulator (EMU2B)
probe (with the DB389 adaptor) or a device (with the DB379 adaptor). The “xx” stands for the
power supply ty pe (EU, UK or U S).
ST7MDT20-EVC/xx: that’s the new board with the CAB socket mounted on it, avoiding to
use adaptors to wo r k in emulation mode or device mode. The CAB soc ket is also delivered
with the EMU3 emulators supporting the TQFP64 14*14 pac kage.
6/33
Table of Contents
33
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1 ST7 MDT 20 EVAL BOARD DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.1 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 P OW ER SUPPLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 CONNECTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.1 S T7M DT20-E VY/xx (Yamaichi socket) . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.2 S T7M DT20-E V C/xx (CAB socket) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 OSCILLATION SYST EM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 CAN DEVICE COMMUNICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6 S PI SERIAL COMM UNICATIO N . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.7 IS P (IN-SITU P ROGRA MMING) CONNECTIO N . . . . . . . . . . . . . . . . . . . . . . . . 13
1.8 S CI DE VICE COMMUNICAT ION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9 I/O PORT FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.1 P ort A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.2 P ort B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.3 P ort C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.4 P ort D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.5 P ort E . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.9.6 P ort F . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10JUMPER DESC RIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10.1Jum per J2 - External Voltage Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10.2Jum per J4 - External Oscillator System . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10.3Jum per J5 - SCI Enable/Di sable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.10.4Jum per J6 - MCU Voltage Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.10.5Jum per J7 - Buzzer Enable/Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.10.6Jum pers J9, J10, J11 - LED Enabl e/Disable . . . . . . . . . . . . . . . . . . . . . . 16
1.10.7IS P Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.10.8NMI Pull-down/Pull-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2 SOFTWARE INSTALLATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7/33
Table of Contents
2.1 ST7 ASSEMBLY TOOLCHAIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2 S TVD 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3 HIWARE AND COSMIC DEMO VERSIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4 TU TORIAL EXERCISES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 TRAINING EXERCISE S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.1 EXERCISE 1: ASSEMBLER SYNTA X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2 EXERCISE 2: USE OF T HE 16-BIT TIMER IN ASSEMBLY L ANGUAGE . . . . 21
3.3 EXERCISE 3: USE OF THE 16-BIT TIMER IN HIWARE C LANGUAGE . . . . . 22
3.3.1 Purpos e of the Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.3.2 How to Use the Hiware C Demo Program . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4 E XERCISE 4: USING T HE ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.5 E XERCISE 5: USING T HE SPI DR IVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.6 E XERCISE 6: USING T HE SCI DRIVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4 APPEN DIX 1: ST72334 REGISTER AND MEMORY M APPING FILE . . . . . . . . . . . 27
5 APPEN DIX 2: SCHEMATIC DIAGRAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
8/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1 ST7 MDT20 EVA L BOA RD DESCRI PTION
The ST7 MDT20 Eval Board has been designed to support either an emulator probe or an ST7
device (FLASH, R OM) in a TQFP pac kage. To do this, a reset system and a 16-MHz crystal
are connected to dedicated pins.
1.1 OVERVIEW
This board can be used without any modifications to test and verify all the exercises given in
this manu al. Addit ional hardware functions can be im plemented by installing compo nents in
the wrapping zone.
For more details refer to the schematic drawing in the appen dix.
Figure 1. Overview of the ST7 MDT20 Eval B oar d
Power Supply
Connector J2: Jumpe r used
to change th e
reference voltage
TQFP-64 connector
for emulator probe,
FLASH or ROM
Push Buttons tying
low pin s PA0 , PB0 ,
PB4 and PF 2 for
external interrupts
Reset
Button SPI Memory
& Connector
Trimmer
connected
on PD0
CAN
Connector
Buzzer
ISP
Ports A to F
7-segment
LED display
connected
to PD7:1
SCI
Output Pins
Connector
Connector
9/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1.2 POW ER SUPPLY
This board is supplied with an AC/DC converter and a 5-volt regulator (V CC = 5 V). The refer-
ence voltage can be changed by removing jumper J2 and connecting the new reference
volta ge as shown in Figure 2.
Figure 2. How to C hange the Board Reference V oltage
When the em ulator pr obe is connected, the LEDs can be activated (w hen bi ts PB7:5 are set)
and the port s ignals will be displayed, ev en if the board is not powered-on. However, the board
must be supplied with 5 Volts (pins VCC & GN D ) in ord er for the ADC and push-button switch
to be operational.
LM
7805
From external generator
MDT20 Eval Board MDT2 Eval Board
1 - Remove jumper J2.
LM
7805
MDT2 0 Eval Board
2 - Connect the new reference volt age.
J2 J2
VCC
EXT VCC
EXT
10/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1.3 CONNECTION
1.3.1 ST7MDT20- EVY/xx ( Yamaichi socket)
This board is delivered with a Yamaichi socket (IC149). All connectors required for an emula-
tion strategy ar e included either in the em ulator pac kage (DB 407, DB3 89) or in the develop -
ment kit package (DB404).
In order to use the MDT20 in Device mode, contact your nearest ST sales office and order the
DB379 connector.
11/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1.3.2 ST7MDT20- EVC /xx (CAB socket)
This boar d is delivered with a CAB socket. This socket has been c hosen for EMU3 generation
of emulators because they avoid the user to use different adaptors to work in emulation mode
or in device m ode. In emulation mode, the user has just to remove the socket top and to plug
the em ulator probe on the CAB socket m o unted o n the boar d. In device mode, the user h as
just to put the device on the s ocket mounted o n the boar d and to close it with the sock et top
provided.
Part No.
R
S
S
S
S
S
R
S
S
S
S
S
S
S
S
S
S
S
R
R
S
S
S
R
R
R
R
S
S
S
S
S
S
S
S
R
S
S
A
A' B
B' C
C' Dn1
n1'
Pitch
Pins
S=Square
R=Rectangular
EQ
Q' S
H
0,18
0,18
0,18
0,20
0,18
0,20
0,18
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,23
0,23
0,23
0,23
0,25
0,23
0,25
0,25
0,25
0,25
0,25
0,23
0,23
0,23
0,23
0,25
0,5
0,25
0,25
0,25
0,25
0,25
0,25
19
24
29
35
31
45
43
63
15
19
19
19
29
19
29
19
29
19
29
24
35
39
41
11
19
24
29
29
25
37
31
35
39
43
51
51
59
10
10
15
15
15
23
15
23
12
18
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,8
0,8
0,8
0,5
0,5
0,5
0,5
0,8
0,8
0,8
0,8
0,75
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,75
0,75
0,5
0,75
0,75
0,2
0,2
0,2
0,2
0,2
0,2
0,2
0,35
0,35
0,35
0,35
0,35
0,35
0,35
0,35
0,35
0,35
0,35
0,6
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,25
0,5
0,5
0,5
0,5
0,5
0,5
11,22
13,20
15,42
17,22
15,40
21,40
21,20
30,00
13,95
15,80
15,35
16,57
23,07
15,35
21,25
15,91
21,85
16,77
23,07
21,00
30,30
30,30
30,30
8,40
13,40
15,12
21,20
21,80
15,40
21,40
19,40
21,20
25,24
25,24
29,40
30,00
33,90
11,20
12,22
16,20
15,20
16,20
22,40
15,96
22,00
16,60
22,60
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,23
0,23
0,23
0,25
0,25
0,25
0,25
0,23
0,23
0,23
0,23
0,30
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,18
0,25
0,23
0,30
0,25
0,30
0,30
19,00
21,00
23,00
25,00
23,55
29,55
29,00
37,50
22,10
24,10
24,10
23,75
30,25
23,75
30,25
23,75
30,25
23,75
30,25
28,10
38,70
38,70
38,70
17,00
21,00
23,00
29,00
29,00
24,00
30,00
27,00
29,00
33,00
33,00
37,00
37,00
41,00
19,70
19,70
23,70
23,70
23,70
30,10
23,70
30,10
23,80
29,80
12,65
14,65
16,60
18,65
17,20
23,20
22,65
31,15
15,75
17,75
17,75
17,40
23,90
17,40
23,90
17,40
23,90
17,40
23,90
21,75
31,70
31,70
31,70
10,65
14,65
16,60
22,65
22,65
17,65
23,65
20,65
22,65
26,65
26,65
30,65
30,65
34,65
13,35
13,35
17,35
17,35
17,35
23,75
17,35
23,75
17,45
23,45
12,1
14,1
16,0
18,1
16,1
22,1
22,1
30,6
14,6
16,6
16,6
16,25
22,75
16,25
22,75
16,25
22,75
16,25
22,75
20,6
30,6
30,6
30,6
17,2
23,2
9,1
14,1
16,0
22,05
22,05
16,1
21,1
20,1
22,05
26,1
26,1
30,1
30,1
34,1
12,2
13,3
17,3
16,2
17,3
23,3
17,3
23,3
1,0
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,5
0,8
0,8
0,8
0,8
0,8
0,8
0,65
0,65
0,65
0,65
0,65
0,65
0,65
0,65
0,65
0,65
0,65
0,4
0,4
0,4
0,4
0,4
0,4
0,4
64
48
80
100
120
120
128
128
144
160
176
208
208
240
44
44
64
64
80
80
64
80
80
100
100
100
100
100
144
160
168
80
100
120
144
156
176
256
3303275
3303276
3303277
3303278
3303279
3303280
3303281
3303295
3303296
3303297
3303298
3303299
3303300
3303301
3303302
3303303
3303304
3303305
3303282
3303283
3303284
3303285
3303286
3303287
3303288
3303289
3303290
3303291
3303292
3303293
3303294
3303311
3303312
3303306
3303307
3303308
3303309
3303310
3303231
3303232
3303233
3303234
3303235
3303236
3303237
3303249
3303250
3303250
3303251
3303251
3303251
3303251
3303252
3303253
3303254
3303255
3303259
3303238
3303239
3303240
3303241
3303241
3303243
3303242
3303244
3303245
3303246
3303247
3303247
3303248
3303260
3303261
3303256
3303262
3303257
3303257
Series
Q2101
Series
Q2001
Series Q2101
Series Q2001
Q2101
Q2001
Contact
Beryllium copper ,
nickel 2,5 µm, gold 0,25 µm
Insulator Body
Liquid cristall Polymer (LCP), UL 94 V0
Temperature
Continual operation
Resistance to solder heat
Reflow
Vaper phase
-25 to + 85°C
240°C, 20 Sec.
220°C, 60 Sec.
The QFP-Socket Cover comes with 4 screws
M2x6 and the QFP-Base Socket comes with a
screwdriver.
The Sockets are JEDEC Pad compatible and
compact in design.
Please check Dimension Q because several versions are availiable.
B
A
B'
A'
M2
6,5(±0,5)
C
C'
7,0
13,5(±0,5)
E
Q
Q'
recom. pad design
K (C +1,0)
G (C - 2D)
PITCH H
G'
K'
1
K
G
n x PITCH
1
n x PITCH
1
PITCH
PITCH
'
1
Q
Q'
S
D
0,2
1,85
QFP-Socket Cover Series Q2101
QFP-Base Socket Series Q2001
Page
44.
15
Mechanical life/cycles
Rated Voltage
Contact Resistance
Insulation Resistance
Current Carring Capacity
(per contact)
100
100 VRMS
< 70 m
> 5 x 108
0,5 A
cab-Produkttechnik GmbH & Co KG, Postfach 19 04, D-76007 Karlsruhe, Telefon +49/721/6626-0, Fax +49/721/6626-219, www .cabgmbh.com
12/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1.4 OSCILLATION SYSTEM
The ST7MDT 20 Eval Board is designed to be used with an on-board 16-MHz crystal. But an-
other clock s ignal can be used by connecting the correspondin g oscillator to the OSC IN p in.
To do this, rem ove j umper J 4 a nd connec t the external clock s ignal gener ator to the OSC IN
pin as shown in Figure 3.
Figure 3. How to Change the Oscillator Frequency
1.5 CAN DEVICE COMMUNICATION
A C A N tran s ceive r ( L96 15 o r U435 ) i s c onn ecte d to the m ic ro cont rol ler CA N pi n (pins PE 2
and PE3). In order to supply power to the CAN transceiver, the “APPLI VD D” jumper must be
connected to the W5 connector.
The R x_CAN pin of the MC U can be di sconnected fro m the transceiver by rem oving jumper
J12 and the CAN sp eed is s elected according to the configuration of jumper W4. A 120-ohm
terminating resistor is validated w hen jumper J13 is connected.
1.6 SPI SERIAL COMMUNICATION
An external EEPROM memor y w ith an SPI serial interface is connected to the SPI pins of the
ST7 socket as shown in the following figure. But the serial EEPROM can be disconnected and
the SPI bus used for other communications. This hardware configuration is explained in Appli -
cation Note AN97 0 “SP I Communi cati on Betw een ST7 and E2PRO M”.
1 - Remove jumper J4.
MDT20 Eval Board
16 M H z
XT1
From exte rnal generator
J4
16 M H z
XT1
J4
2 - Connect the external clock signal.
MDT 20 Eva l Board
13/33
ST7 MDT20 EVAL BO ARD DESCRIPTION
Figure 4. How to Use the SPI Co nn ect ion
1.7 ISP (IN-SITU PROGRAMMING) CONNECTION
The IS P connec tor is used t o progra m Fla sh devices usin g ISP prot ocol. If an S T p rogram -
ming tool is being used, connector JP1 must be plugged to the cable provided by the ST pro-
gramming tool and the board has to be pow ered-on.
Figure 5. ISP Connections
This connector can also be us ed with a tool other than th e one prov ided by ST. In this c ase,
use the connections as described in Figure 5.
MD T20 Eval Board
1
SPI
JP8
2
MOSI
MISO
SCK
M95040
ST7 SPI
pins
Install all the jumpers on the SPI connector.
PB3 MDT20 Eval Board
1
SPI
JP8
2
GND
MOSI
MISO
SCK
M95040
ST7 SPI
pins
Remove the jumpers and use the left-hand
PB3
Using the embedded SPI EEPROM Using the SPI Bus
GND
side connector.
MDT20 Eval Board
1ISP
JP1
29
10
ST Programming Tool Cable
MDT 20 Eva l Board
1ISP
29
10
ISPDATA
ISPCLK
RESET
ISPSEL
Other Progra mming Tool Cable
JP1
14/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1.8 SCI DEVICE COMMUNICATION
The D B9 conne ctor can b e us ed to link the ST7 M DT20 E val Boa rd to a PC , for example. A
“MAX232 component is used to fit the ST7 TTL output to the line level of a PC serial con-
nector.
1.9 I/O PORT FUNCT IONS
All I/O port pins are accessible through external connectors (connector JP3 for port A, JP4 for
port B, JP5 for port C, JP6 for port D, JP2 for port E, JP7 for port F).
1.9.1 Port A
The PA0 pin can be used to generate an exter nal interrupt (EI0). It is connected to the ground
through push-button switch SW1.
Pins PA2 and PA3 are used to validate the 7-segment LED displays (useful for multiplexing).
1.9.2 Port B
Pins PB5, PB6, PB7 are connected to 3 LEDs.
Pins PB0 and PB4 can be used to generate an external interrupt (EI2 and EI3). These pins are
connected to the ground through push-button switches SW3 and SW4.
Table 1. Port B Alternate Functions (ST72511 only)
1.9.3 Port C
Table 2. Port C Alternate Functions
1.9.4 Port D
This port is connected to the 7-segment LED which is validated with a ‘1’ logical value on pins
PA2 and PA3.
PB0 PWM3 PWM Output 3
PB1 PWM2 PWM Output 2
PB2 PWM1 PWM Output 1
PB3 PWM0 PWM Output 0
PB4 ARTCLK PWM-ART External Clock
PC0 OCMP2_B Timer B Output Compare 2
PC1 OCMP1_B Timer B Output Compare 1
PC2 ICAP2_B Timer B Input Capture 2
PC3 ICAP1_B Timer B Input Capture 1
PC4 MISO SPI Master In Slave Out Data
PC5 MOSI SPI Master Out Slave In Data
PC6 SCK SPI Serial Clock
PC7 SS SPI Slave Select
15/33
ST7 MDT20 EVAL BO ARD DESCRIPTION
Table 3. Port D Alternate Functions
1.9.5 Port E
This p ort is co nnected to bo th the S CI trans ceiver (ST232 or MAX 232) and t he CAN tra ns-
ceiver (available only on ST72511, ST72512, ST72532), as desc ribed in the following table.
Table 4. Port E 0Alternate Functions
1.9.6 Port F
The PF2 pin can be used to generate an external i nterrupt (EI1). It is connected to the ground
through the push-button switch.
Table 5. Port F Alternate Functions
1.10 JUMPER DESCR IPTION
1.10.1 Jumper J2 - External Voltage Supply
Please refer to Sec tion 1.2.
1.10.2 Jumper J4 - External Oscillator System
Please refer to Sec tion 1.4.
PD0 AIN0 Analog Input 0
PD1 AIN1 Analog Input 1
PD2 AIN2 Analog Input 2
PD3 AIN3 Analog Input 3
PD4 AIN4 Analog Input 4
PD5 AIN5 Analog Input 5
PD6 AIN6 Analog Input 6
PD7 AIN7 Analog Input 7
PE0 TDO SCI Transmit Data Out
PE1 RDI SCI Receive Data In
PE2 CANTX CAN Transmit Data Output
PE3 CANRX CAN Receive Data Input
PF0 CLKOUT Main Clock Output (Fosc/2)
PF 1 BEEP Beep Signal Output
PF3 O CMP2_A Timer A Output Compare 2
PF4 O CMP1_A Timer A Output Compare 1
PF5 ICAP2_A Timer B Input Capture 2
PF6 ICAP1_A Timer B Input Capture 1
PF7 EXTCL K_ A Timer A Exte rn al C lock So u rce
16/33
ST7 MDT20 EVAL BOARD DESCRIPTION
1.10.3 Jumper J5 - SCI Enable/Disable
In order to use the SCI peripheral device, these 2 jumpers must be connected; otherwise, it is
recommended that they be remo ved from the board. Please refer to Figure 4.
1.10.4 Jumper J6 - M CU Vo ltage Supply
This jumper is dedicated to the MCU power supply only. When it is removed, it can be used,
for ex ample, to measure the curr ent consumption of the MCU by c onnecting a DC-ammeter i n
parallel.
1.10.5 Jumper J7 - Buzzer En able/Disable
This jumper enables the buzzer to be used once it is connected to pin PF1.
1.10.6 Jumpers J9, J10, J11 - LED Enable/Disable
These 3 jumpers are used to connect the three LEDs (D5, D6 and D7) to pins PB5, PB6 and
PB7. It is recommended that the jumpers be removed from the board if this feature is not used.
1.10.7 ISP Connector
Please refer to Sec tion 1.7.
1.10.8 NMI Pull-down/Pull-up
A pull-down (or, pull-up) is applied on pin NMI if a jum per is connected between pins 2-3 (or,
pins 1-2) on the board.
17/33
SOFT W ARE IN STALLATION
2 SOFTW ARE INSTALLATION
The following software packages must be installed in order to do the exercises:
– ST7 Assem bly Toolchain,
– STVD7 Debugger,
– C-Compiler (Hiware and Cosmic Eval uation versions).
2.1 ST7 ASSEMBLY TOOLCHAIN
The ST7 Assembly Toolchain can be directly installed on the PC using the “MCU ON CD” CD-
ROM (W elcome.exe file) or downloaded f rom the ST Internet site (http://mcu.st.com).
When the installation is completed, click on the Finish button and then reboot the P C so that
that the autoexec.bat modifications can be taken into account.
2.2 STVD7
The STVD7 is the new 32-bit debugger developed by ST . This is a basic IDE ( Integrated De-
velopme nt Environm ent) to ol, which is used to edi t, bui ld and deb ug a pplicati ons in a s ingle
environment.
The STV D7 prog ram can be direc tly i nsta lled on the P C u sing the MCU O N C D ” CD -RO M
(Welcome.exe file) or dow nloaded from the ST Internet site (http://mcu.st.com).
2.3 HIWARE AND COSMIC DEMO VERSIONS
These two third-par ty companies have developed a C- compiler for us e with ST7 microcontrol-
lers. An evaluation version of each compiler can be di rectly installed on the PC using the
“MCU O N CD ” CD-ROM (Welcome.exe file) or dow nloaded from each of their respe ctive In-
ternet sites (http://www.hiware.com and http://www.cosmic-software.com).
2.4 TUTORIAL EXERCISES
The exercises can be installed using the “MCU ON CD” CD-ROM (“Install your Development
Tools”, “ST7 Tools”, “ST Demo Boards” and “ST7 Evaluation Board”).
18/33
TRAINING EXERCISES
3 TRAINING EXERCISES
3.1 EXERCISE 1: ASSEMBLER SYNTAX
The purpose of the first exercise i s to improve your knowledge of ST 7 Assembler syntax and
the STVD7 environment.
1. Launch the STVD7 Sim u lator:
Configure the Toolchain paths as requested. The ST assembly toolchain path is already
entered. For Hiware, the correct path is C:\Hiware\prog and for Cosmic: C:\Program
Files\cosmic software\st7eval\cxst7 (if the default paths were selected during the installation
procedure). A Browse function is also available to find the correct path.
Create a new project:
C lick on “File, New Works pace” and enter the requested information (see Figure 7.)
Click on the “Source D irectory tab in the Workspace w indow and doub le click on th e di-
rectory: the default user directory is selected by default.
2. Modify the files located in the following directory (C:\exerci se\init\asm, see Figure 6.) to cor-
rect the assembler syntax. Some sy ntax errors have been introduced by replacing correct di-
rectives or lines of code by ‘?????’.
3. When the file has been corrected, write the compile.bat batch file to assemble, link and
create a new *.s19 file (assign a new name to the file). The batch file also generates the S19,
SYM, MAP and OBJ files. For further assistance, please refer to the Technical Manual.
4. Then, click on “Project, Build”, or directly on the Build shortcut, to build your application.
5. Detect ed errors ar e listed i n the Output window. Click on the error to di splay the li ne of code.
Correct the error and then rebuild.
6. To deb ug, simpl y clic k on t he blue “D” displ ayed in the t oolbar. The n select “Too ls, MCU
Configuration” in order to configure the MCU (ST72334N4) and the option byte (Watchdog
software,...).
Now, the rest is up to y ou...
19/33
TRAINING EXERCISES
Figure 6. Assembler Syntax Resource Files
20/33
TRAINING EXERCISES
Figure 7. STVD 7 New Workspace Project Settings
21/33
TRAINING EXERCISES
3.2 EXERCISE 2: USE OF THE 16-BIT TIMER IN ASSEM BLY LAN GU AGE
Starting with a similar program frame (New Project: File, New Workspace), design a s oftware
program for the ST72334N4 that:
1. Generates a PW M signal on pin PF4 (40-kHz frequency , 20% duty cycle).
2. Generates an interrupt every period and toggles pin PB0 defi ned as a push-pull output
(square wave at 20 kHz).
Refer to the ST72334 datasheet for t he correct use of the tim er in PWM m ode.
Since the MCU uses a 16-MHz cr ystal, it must be configur ed in Normal mode and the “ Divider
by 2” function must be selected for the timer clock in order to have the best accuracy.
W rite a main program that:
C onfigures pin PF0 as a push-pull output.
Enters the calculated value for the pulse length and the period length in TAOC1R and
TAOC2R registers using the datasheet formula.
C onfigures the 16-bit timer in PWM m ode.
Enabl es the interrupt process and w aits for interrupts.
W rite an interrupt routine that toggles pin PFO and clears interrupt flags ICF1and ICF2.
In this exercise, the entire structure is given, but only the comment lines have been kept. The
correct ST7 code mus t be written by using only the comments.
3. Check the validity of your software progra m by displaying the signal on pins PF0 and PF 4
with an oscillosc ope or by using the ST 7 Waveform Editor after an STVD7 simulation.
When an application is run on the simulator, a port.out file that contains all the pin changes is
automatically generated. It is used to check the operation of the application without using any
hardware.
22/33
TRAINING EXERCISES
The following tim ing diagram should be obtained:
Figure 8. PWM Timing Diagram
The hard ware registers and mapping file (ST72334.asm) are printed in the appendix. The la-
bels of the hardwar e registe rs are also listed i n this sec tion. The r esource fi les are shown in
Figure 9.
Figure 9. Timer R esource Files
3.3 EXERCISE 3: USE OF THE 16-BIT TIMER IN HIWARE C LANGUAGE
3.3.1 Purpose of the Exercise
The purpose of this exercise is to use the Hiware C Toolchain to write a program that performs
the same PW M functions as in the previous exercise, but using the following resources.
PF4
PF0
025
50 t (us)
23/33
TRAINING EXERCISES
Figure 10. C-Language Timer Resource Files
The linker parameter file (enviro.prm) and the m akefile (enviro.mak) file have been placed in
the working directory. If an editor such as Winedit is used in place of the STVD7 program,
please refer to Application Note AN 989 ‘Starting with ST 7 Hiware C’ available on Internet
(http://mc u.st.com . Then select “ST7”, “Technical Docum entation”, “Application Note s”.)
The Default.env and Project.ini fil es are used to configure the Hiware C Toolchain and the text
editor. These two files are automatically created by the Hiware setup program in the Configu-
ration dialog box.
All files are ready-for-use, except for the m ain.c and
itenviro.c files. In order to be able to use
these files, the following procedure must be completed:
In th e main.c
file, wr ite the instructions that:
C onfigure pin PF0 as a push-pull output.
Enter the calculated value for the pulse length and the period length in TAOC1R and
TAOC2R registers using the datasheet formula.
C onfigure the 16-bit timer in PW M m ode.
Enabl e the interrupt process and wait for interrupts.
24/33
TRAINING EXERCISES
W rite an interrupt function in
itenviro.c file that:
Toggles pin PFO.
C lears in terrupt flags IC F1 and IC F2.
3.3.2 How to Use the Hiware C Demo Program
The Hiware C Compiler demo can be directly i nstalled on the PC using the “MCU ON CD” CD-
ROM (W elcome .exe file) or downloaded from their Internet site (http://www.hiware.com).
When the instal lation is completed, open the HIWARE TOOLS icons in the group of HIWARE
demo icons (Start Menu) and click on the first icon displayed in the Hiware tools toolbar.
Figure 11. HiWare Tools Toolbar
This i con opens the
Configuration
dial og box. Click on
New bu tton
and enter the application di-
rector y (C:\ exercise \init\C33 4) and the var ious ta bs (refe r to Ap plica tion N ote AN 989), th en
click on
OK
.
This acti on creates or updates the pr oject.ini and defaul t.env fil es l ocated in the appl ication di -
rectory.
An editor is not required for the Hiware Tool box which is just used to create the default.env
and project.ini files.
Once the Hiware configuration parameters are entered, open the STVD7 program (simulator
or developm ent kit) and create a new project by specifying the Hiware toolchain in the project
settings window.
The correct configuration is listed in the technical m anual.
3.4 EXERCISE 4: USING THE ADC
The purpose of this exercise is to write li nes of code in C language that are able to read an an-
alog voltage and to show the resu lt in hex value on the two 7-segment LED displays by multi-
plexing.
The the ST72334 C-environment is located in the C:\e xercise\init\ADC directory. Click on the
“ADC.wsp” project in this directory and the resource files are displayed as shown in Figure 12.
25/33
TRAINING EXERCISES
Figure 12. ADC Resource Files
Only the “main.c” program mus t be compl eted, acc ording to the explanatory comm ents.
Table “tab[16]” contains the configuration for the 7-segment LED displays. When addressing
tab[i], the corresponding digit i is accessed when P DDR is pushed.
Label “lab1” is an infinite loop. It starts a new conversion, waits until it is completed, and
store the tens and ones unit value into the i and j register s. Then, it outputs the i and j values
on Port D, and decreases a counter so that the result is displayed on the LEDs. Then, it
starts again.
A high level on output PA3 ( output PA2, r espectively) selects the tens (ones, respec tively)
value on the de dicated 7-segment LED display.
3.5 EXERCISE 5: USING THE SPI DRIVER
The purpose of this exerc ise is to use the SPI driv er to program the embedded SPI EEPROM.
The str uct ure o f the m ain m odu le and t he b atch f ile f or ef ficie nt HI WA RE C l an guage c om -
piling as wel l as the ST72334 resource directory are loca ted in the SP I directory.
First, open the “SPI.wsp” project file.
The resource files are displayed as shown in Figure 13.
Figure 13. SPI Resource Files
26/33
TRAINING EXERCISES
You have to complete the “main.c” and “itenviro.c” progr ams, according to the explanatory
comments.
The first step is to send “value[3]” into the EEPROM, starting at the address 0x00. Each value
has to b e displaye d on the 7-segment LED display. Then , by pres sing push- button switches
EI1, EI2 or EI3, the previously sent value must be read at the 0x00, 0x01 and 0x02 addresses,
and the result must be displayed on the 7-segment LED display in hex value. If the 0x00
EEPRO M memory address is read, LED PB5 has to light up; LEDs PB6 or PB 7 LED have to
light up if the 0x01 or 0x02 m emory addresses are read.
3.6 EXERCISE 6: USING THE SCI DRIVER
The pu rpose of this exercise is to us e the S C I driver to comm unicate with y our P C, w ith the
help of the “Hyperterminal” software. The parameters for this software program must be cor-
rectly configured befor e use.
1) Click on “File Properties” and select the correct COM port.
2) In the “Settings” menu, check the “Windows Keys ” and “ANSI Emulation” check boxes.
3) In “File Properties Configure”, set the foll owing parameters: “Bits per second: 19200”,
“Data bits: 8”, “Parity: None”, “Stop bits: 1”, “Flow control: None”.
The ST72334 environment in HIWARE C language is located in the ex_SCI directory.
First, open the “SCI.wsp” project file.
Figure 14. SCI Resource Files
Then, complete the “main.c” program , acc ording to the explanatory comments.
The first step is to send “title[ ]” to the PC. Then, wait for eight characters to be entered before
sending i t bac k to the PC. Afterwards, the progr am starts ov er, and eight new characters must
be entered.
27/33
APPENDIX 1: ST72334 R egister an d Memory M apping File
4 APPENDIX 1: ST72334 REGISTER AND MEMORY MAPPING FILE
The following lists the content of the hardware register file: ST 72334.asm.
st7/
;************************************************************************
; TITLE: ST72334.ASM
; AUTHOR: CMG Microcontroller Application Team
; DESCRIPTION: ST72334 Register and memory mapping
; Define here the micro RAM & ROM Size according to the sales type:
; #define ST72334N2 1 ;=> 8K ROM, 384 bytes RAM also available for ST72334N2
#define ST72334N4 1 ;=> 16K ROM, 512 bytes RAM also available for ST72334N4
;************************************************************************
;************************************************************************
BYTES ; following addresses are 8 bit length
;********************************************************************
segment byte at 0-71 ’periph’
;********************************************************************
;**********************************************************************
; I/O Ports registers
;**********************************************************************
.PADR DS.B 1 ; port A data register
.PADDR DS.B 1 ; port A data direction register
.PAOR DS.B 1 ; port A option register
DS.B 1 ; not used
.PCDR DS.B 1 ; port C data register
.PCDDR DS.B 1 ; port C data direction register
.PCOR DS.B 1 ; port C option register
DS.B 1 ; not used
.PBDR DS.B 1 ; port B data register
.PBDDR DS.B 1 ; port B data direction register
.PBOR DS.B 1 ; port B option register
DS.B 1 ; not used
.PEDR DS.B 1 ; port E data register
.PEDDR DS.B 1 ; port E data direction register
.PEOR DS.B 1 ; port E option register
DS.B 1 ; not used
.PDDR DS.B 1 ; port D data register
.PDDDR DS.B 1 ; port D data direction register
.PDOR DS.B 1 ; port D option register
DS.B 1 ; not used
.PFDR DS.B 1 ; port F data register
.PFDDR DS.B 1 ; port F data direction register
.PFOR DS.B 1 ; port F option register
DS.B 1
reserved0 DS.B 8 ; unused
1
28/33
APPENDIX 1: ST72334 Regist er and Memory M a pping File
**********************************************************************
; Miscellaneous 1 register
;**********************************************************************
.MISCR1 DS.B 1 ; miscellaneous register 1
;**********************************************************************
; SPI registers
;**********************************************************************
.SPIDR DS.B 1 ; SPI data register
.SPICR DS.B 1 ; SPI control register
.SPISR DS.B 1 ; SPI status register
reserved1 DS.B 5 ; unused
;**********************************************************************
; Main Clock Registers
;**********************************************************************
.MCCSR DS.B 1; Main Clock Control/Status register
;**********************************************************************
; Watchdog Registers
;**********************************************************************
.WDGCR DS.B 1 ; Watchdog control register
.CRSR DS.B 1; clock, reset, supply control/status register
;**********************************************************************
; EEPROM Register
;**********************************************************************
.EECSR DS.B 1 ; Data-EEPROM Control/Status register
reserved2 DS.B 4 ; unused
;**********************************************************************
; Timer A registers
;**********************************************************************
.TACR2 DS.B 1 ; timer A control register 2
.TACR1 DS.B 1 ; timer A control register 1
.TASR DS.B 1 ; timer status register
.TAIC1HR DS.B 1 ; timer A input capture 1 high register
.TAIC1LR DS.B 1 ; timer A input capture 1 low register
.TAOC1HR DS.B 1 ; timer A output compare 1 high register
.TAOC1LR DS.B 1 ; timer A output compare 1 low register
.TACHR DS.B 1 ; timer A counter high register
.TACLR DS.B 1 ; timer A counter low register
.TAACHR DS.B 1 ; timer A alternate counter high register
.TAACLR DS.B 1 ; timer A alternate counter low register
.TAIC2HR DS.B 1 ; timer A input capture 2 high register
.TAIC2LR DS.B 1 ; timer A input capture 2 low register
.TAOC2HR DS.B 1 ; timer A output compare 2 high register
.TAOC2LR DS.B 1 ; timer A output compare 2 low register
;**********************************************************************
; Miscellaneous 2 register
;**********************************************************************
.MISCR2 DS.B 1 ; miscellaneous register 2
;**********************************************************************
; Timer B registers
;**********************************************************************
.TBCR2 DS.B 1 ; timer B control register 2
.TBCR1 DS.B 1 ; timer B control register 1
.TBSR DS.B 1 ; timer B status register
.TBIC1HR DS.B 1 ; timer B input capture 1 high register
29/33
APPENDIX 1: ST72334 R egister an d Memory M apping File
.TBIC1LR DS.B 1 ; timer B input capture 1 low register
.TBOC1HR DS.B 1 ; timer B output compare 1 high register
.TBOC1LR DS.B 1 ; timer B output compare 1 low register
.TBCHR DS.B 1 ; timer B counter high register
.TBCLR DS.B 1 ; timer B counter low register
.TBACHR DS.B 1 ; timer B alternate counter high register
.TBACLR DS.B 1 ; timer B alternate counter low register
.TBIC2HR DS.B 1 ; timer B input capture 2 high register
.TBIC2LR DS.B 1 ; timer B input capture 2 low register
.TBOC2HR DS.B 1 ; timer B output compare 2 high register
.TBOC2LR DS.B 1 ; timer B output compare 2 low register
;**********************************************************************
; SCI registers
;**********************************************************************
.SCISR DS.B 1 ; sci status register
.SCIDR DS.B 1 ; sci data register
.SCIBRR DS.B 1 ; sci baud rate register
.SCICR1 DS.B 1 ; sci control register 1
.SCICR2 DS.B 1 ; sci control register 2
.SCIERPR DS.B 1 ; sci extended receive prescaler register
DS.B 1 ; reserved
.SCIETPR DS.B 1 ; sci extended transmit prescaler register
reserved5 DS.B 24 ; unused
;**********************************************************************
; ADC registers
;**********************************************************************
.ADCDR DS.B 1 ; adc data register
.ADCCSR DS.B 1 ; adc control status register
;**********************************************************************
segment byte at 80-FF ’ram0’ ;Zero Page
;**********************************************************************
WORDS ; following addresses are 16 bit length
;**********************************************************************
; for ST72334J2 or ST72334N2 with 8K ROM & 384 bytes RAM
#ifdef ST72334N2
segment byte at 100-1FF ’stack’
segment byte at E000-FFDF ’rom’ ;
#endif
;**********************************************************************
;**********************************************************************
segment byte at C00-CFF ’eeprom’ ;EEPROM area
;**********************************************************************
;**********************************************************************
; for ST72334J4 or ST72334N4 with 16K ROM & 512 bytes RAM
;
#ifdef ST72334N4
segment byte at 100-1FF ’stack’
segment byte at 200-27F ’ram1’
30/33
APPENDIX 1: ST72334 Regist er and Memory M a pping File
segment byte at C000-FFDF ’rom’
#endif
;**********************************************************************
;**********************************************************************
segment byte at FFE0-FFFF ’vectit’
;**********************************************************************
end
31/33
APPENDIX 2: SCHEMATIC DIAGRAMS
5 AP PENDIX 2: SCH EM ATIC DIAGRAMS
Figure 15. MDT20 Eval Board (Part 1)
.
D
PA
0
PA1
PA2
PA3
PA
4
PA5
PA6
PA7
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
PC0
PC1
PC2
PC3
PC4
PC5
PC6
PC7
P
D
0
P
D
1
P
D
2
P
D
3
P
D
4
P
D
5
PD6
P
D
7
PE
0
PE1
PE2
P
E
3
P
E
4
P
E
5
PE6
PE7
P
F
0
PF1
P
F
2
PF3
P
F4
P
F
5
PF6
P
F
7
PE3
PE2
PE4
PE5
P
E
6
PE7
PB1
PB2
PB3
PB5
P
B
6
PB7
PD0
P
D
1
P
D
2
PD3
PD4
P
D
5
PD6
P
D
7
PF1
PF3
PF4
PF5
PF6
PF7
PC0
PA7
PA6
PA5
PA4
PA3
PA2
PA1
PC7
PC6
PC5
PC4
PC3
PC2
PC1
POWE
R
_1
2
V
PF0
PB5
PB6
PB7
PE0
PE1
ISPSEL
NMI
VCC P
F
1
ISPSEL
ISPCLK PC6
PC5 MOSI
IS
PD
ATA PC4
PC6 S
C
K
PC
4M
ISO
P
B
3
NMI
M
C0PF0
VC
C
ÿP
P
D
3
PD1
PA3
PD1
P
D
2
PA2
PD7
PD4
PD6
PD2
PD6
PD4
PD5
PD3
PD5
PD7
R
T
S
NMI VCC
/RESET
/RES
E
T
PB0
PF2
PB4
Vin
PA0
VCC
VCC
VC
C
VC
C
VCC
VCC
VC
C
VCC
VCC
VCC
VCC ÿP
VCC
V
C
C
ÿP
VCC ÿP
V
CC ÿP
VC
C
ÿP
JP6
8 H EA DER
1
2
3
4
5
6
7
8
JP2
8 H EA DER
1
2
3
4
5
6
7
8
JP7
8 HEADE
R
1
2
3
4
5
6
7
8
R17
10K
C
2
2
1
00PF
U3
MAX232
13
8
11
1
0
1
3
4
5
2
6
12
9
14
7
16
15
R1IN
R2IN
T1IN
T2IN
C1+
C1-
C2
+
C2-
V+
V-
R1OUT
R2OUT
T1OUT
T2
O
UT
V
C
C
GND C10
100NF
U1
LM7805/TO
1
2
3
VIN
GND
VOUT
D2
1N4004
1
2
J1
P
H
ONEJACK
2
3
1
J4
OSC EXT
1 2
P1
CON
N
ECTOR DB
9
5
9
4
8
3
7
2
6
1
D1
LED-GREE
N
J
2
V
CC EXT
1
2
RV1
10K
13
2
C
3
100NF
C
2
1
00NF
+
C5
1
00
ÿ
F
-C
T
-
16
V
+
C1
100 ÿF-EA-25V
R
4
1K8
R5 1K8
R
6
1K8
D
5 LED-Red-3
mm
-2ma
D6 LED-Red-3mm-2ma
D
7 LED-Red-3
mm
-2ma
Q1
B
C54
7
A
1
23Q2
B
C
547A
1
23
R1
33
0
J
3
NMI
1
JP1
ISP ENA
12
34
56
78
910
JP8
SP
I
ENA
12
34
56
78
91
0
U5 7 Seg
1
2
3
4
5
6
7
8
D1
D2
D3
D4
D5
D6
D7
GND
U4 7 Seg
1
2
3
4
5
6
7
8
D1
D
2
D
3
D4
D
5
D6
D7
GND
J6
B2S
1 2
J
7
B
2S
1
2
U8
M95040
1
2
3
4
5
6
7
8
/S
Q
/W
Vss
D
C
/
H
O
LD
VC
C
J9 B2S
1 2
J10 B2S
1 2
J11 B
2
S
1 2
LS
1
B
UZZ
ER
1
2
EI 0
EI 1
EI
2
EI 3
U
2
ST72511R
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
31
3233
3
4
35
3
6
37
38
39
4
0
41
4
2
4
3
4
4
45
4
6
49
5
0
51
5
2
4
7
48
5
3
5
4
55
5
6
57
6
0
5
9
58
6
1
6
2
6
3
64
PE4 (HS)
PE
5
(
H
S)
PE6 (HS)
PE
7
(
H
S)
PB0 / PWM3
PB1 /P
WM
2
PB2 / PWM 1
PB3 / PWM0
PB4
/
A
RT
CL
K
PB5
PB6
PB
7
AI
N
0
/
P
D
0
AIN1 / PD1
AIN2
/
PD2
AI
N
3
/
P
D
3
AIN4
/
PD4
AIN5
/
PD5
AIN6 / PD6
AI
N
7 / P
D
7
Vdda
Vssa
Vdd_3
Vss_3
PF0 / M
C
O
PF1 / BEEP
PF2
PF3 / OC MP2_A
PF4 / OC MP1_A
PF5
/
ICAP2_A
PF6 (HS) / ICAP1_A
PF7 (
H
S)
/ EX
T
C
LK_A Vdd_0
Vss_0
O
C
MP2_B / PC0 (
H
S)
O C M P1_B / PC1 (
H
S)
I
CA P 2_B / P
C
2 (
H
S)
I
CA P 1_B / P
C
3 (
H
S)
MIS
O
/ P
C
4
MOSI / PC5
SCK / PC6
/S S /
PC7
PA0
PA1
P
A
2
PA3
PA4 (HS)
PA5 (HS)
PA6 (HS)
P
A
7 (HS
)
Vdd
_
1
Vss_1
Vpp
/Reset
nc
NM
I
Vss_2
Vdd_2
O
SC1
OS
C
2
T
D
O
/
P
E0
RDI / P
E
1
CANT
X
/ P
E
2
CANRX / PE3
R
3
4K7
C2
4
10
0
PF
C26
100PF
C7
15PF
C4
15PF
R
12 4K7
Y116
m
hZ
R14 4K7
R13 4K7
R9 4K7
R1
5
1K
C13
100NF
C14
100NF
J5B B2S
1 2
C11
100NF
C
8
1
00NF
C6
100NF
JP5
8 H EA DER
1
2
3
4
5
6
7
8
JP4
8 H EA DER
1
2
3
4
5
6
7
8
JP
3
8 H EA DER
1
2
3
4
5
6
7
8
R2 4K7
W1
1
2
3
1
2
3
J5A B2S
1 2
C27
100PF
+
C16
1ÿF 16V
+
C12
1ÿF
1
6V
+
C15
1ÿF 16V
+
C9
1
ÿ
F 16V
D
4
2V4
D3
2
V
4
TP6
CON5
1
2
3
4
5
J8
MCO
1
C25
1
0
0
PF
S
W
4
EI
3
1 2
SW3
EI2
1 2
SW1
EI0
1 2
SW5
/RE
S
ET
1 2
SW2
SW EI1
1 2
R
10
4K7
C23
100PF
PF0
PF2
PF3
PF
1
PF4
PE3
PE2
RE
S
_4
9
22
VDD_APPLI
RT
S
R
ES_4
9
22
32/33
APPENDIX 2: SCHEMATIC DIAGRAMS
Figure 16. MDT20 Eval Board (Part 2)
CAN
SLOW
CAN
S
PEED
SELE
C
T
C_H
C_L
F
AS
T
P
O
WER
CH
PF3
SCLK
DOUT
P
F2
Vi
n
V
2
CH
V3
P
F1
CAN[0..3]
TH
RTS
TL D
IN
C
L
T
H
CL
PF
0
INT
PF4
SCLK
DOUT
IN
T
DI
N
T
L
VDD
RE
S
_435
V
D
D
_
C
AN
RE
S
_4922
V
DD_C
A
N
V
DD
V3V2
VD
D
VDDV
CC
W3
M
W2
X
1
C
1 2
+
C17
10
ÿ
F-
C
T-35V
+
C19
10ÿF-CT-16V
W2
MW2X4C
1
2
34
56
7
8
T
P1
1
2
1
2
R11
120
R7
3
.9K
+
C2
0
10ÿF-CT-16V
J
12 B2
S
1 2
U6
U435
1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
GND
V1
V2
V3
V
S
CH
T
L
CL
TH
GN
D
GND
W
A
K
E
I
N
T
RE
S
SCK
L
DIN
DOU
T
TxD
RxD
GND
R8
3.9K
P
2
5
9
4
8
3
7
2
6
1
J13 B2S
1 2
U7
L9615
1
2
3
4 5
6
7
8
TX0
G
ND
Vs
R
X
0R
X
1
C_L
C
_H
ASC
TP
5
1
2
1
2
W4
1
2
3
1
2
3
+
C1
8
1ÿF-CT-25V
R
16
10
K
C21
100NF
G1
GOUTTE C
O
NTAC
T
W5
M
W2
X
3C
1
3
5
2
4
6
RE
S
_RE
G
P
E
2
PE3
PF0
PF2
PF3
PF1
P
F4
RTS
RES_492
2
V
D
D_
AP
PLI
33/33
APPENDIX 2: SCHEMATIC DIAGRAMS
“THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH INFORMATION
REGARDIN G THE IR PRO DUCT S IN OR DER FO R THEM TO SAV E TIME . AS A RES ULT, STMIC ROEL ECTR ONI CS
SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO
ANY CLAIMS ARISING FROM THE CONTENT OF SUCH A NOTE AND/OR THE USE MADE BY CUSTOMERS OF
THE INFORMATION CONTAINED HEREIN IN CONNEXION WITH THEIR PRODUCTS.
Information furnished is believed to be accurate and relia ble. However, STMicroelectronics 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 i m pl i cation or otherwis e unde r any patent or p atent rights of STMi croel ectroni cs. Spec i ficati ons mentioned in thi s pub lic ation are s ubj ect
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authoriz ed for use as cri t i cal compone nts in life support device s or syst em s without the express written appr oval of STM i cro el ectronics.
The ST logo is a registered trademark of STMicroelectronics
2002 STMicroelectronics - All Rights Reserved.
Pur ch ase of I2C Components by STMicroelectronics conveys a license under the Philips I2C Pa te nt. Rights to us e these components in an
I2C sys tem is granted pro vi ded t hat the system conform s to the I2C Standard Specification as defined by Philips.
STMic roelectronics Group of Companies
Aust ralia - Brazi l - Canada - Chin a - F i nland - F ranc e - Germany - Hong Kong - Ind i a - Is rael - Ital y - J apan
Malaysi a - M al ta - Morocco - Si ngapor e - Spain - Sweden - Switzerland - Unit ed Kingdo m - U. S. A.
http://www.st.com