UM0817 User Manual - kontest.ru · UM0817 User Manual STM8S-DISCOVERY ... 32 KB Flash, 2 KB RAM, 1...
Transcript of UM0817 User Manual - kontest.ru · UM0817 User Manual STM8S-DISCOVERY ... 32 KB Flash, 2 KB RAM, 1...
February 2010 Doc ID 16361 Rev 2 1/17
UM0817User Manual
STM8S-DISCOVERY
IntroductionThe STM8S-DISCOVERY is a quick start evaluation board which helps you to discover the STM8 features, and to develop and share your own application. It is based on an STM8S105 and includes an embedded debugger, ST-LINK, and a touch sensing button. Numerous applications are available from the STM8S-Discovery web page.
Features■ STM8S105C6T6 microcontroller, 32 KB Flash, 2 KB RAM, 1 KB EEPROM
■ Powered by USB cable between PC and STM8S-DISCOVERY
■ Selectable power of 5 V or 3.3 V
■ Touch Sensing button, TS1
■ User LED, LD1
■ Extension header for all I/Os
■ Wrapping area for users own application
■ Embedded ST-LINK for STM8S
■ USB interface for programming and debugging
■ SWIM debug support
Figure 1. STM8S-DISCOVERY evaluation board
www.st.com
Contents UM0817
2/17 Doc ID 16361 Rev 2
Contents
1 Quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Hardware and layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 STM8S105C6T6 microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 ST-LINK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.1 Using the ST-LINK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.2 Using the ST-LINK on other STM8S applications . . . . . . . . . . . . . . . . . . 8
2.3 Power supply and power selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Single touch sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Daughterboard connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Electrical schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
UM0817 Quick start
Doc ID 16361 Rev 2 3/17
1 Quick start
It is very simple to get started using the STM8S-DISCOVERY, just follow these four steps:
1. Connect the STM8S-DISCOVERY to a PC with a USB cable.
2. Press the TS1 button, and observe LED LD1 blinking.
3. Press the TS1 button to change blinking speed.
4. Visit www.st.com/stm8s-discovery and follow the tutorial, then discover other applications.
The STM8S-DISCOVERY helps you develop and share your own application. You can discover more of the STM8S features by downloading and executing the proposed programs in the project list.
Note: The software code corresponding to this application is available under the name Discover in the project list of the STM8S-Discovery web page.
Hardware and layout UM0817
4/17 Doc ID 16361 Rev 2
2 Hardware and layout
The STM8S-DISCOVERY is designed around the STM8S105C6T6 microcontroller in an LQFP48 package. It has two distinct sections that may be separated, the STM8S105C6T6 module and the ST-LINK module.
Figure 2 illustrates the connections between the STM8S105C6T6 and its peripherals (ST-LINK, touch-sensing button, LED and connectors).
Figure 3 helps you to locate these features on the STM8S-DISCOVERY board, as well as the potential point of separation (for more details refer to Section 2.2.2: Using the ST-LINK on other STM8S applications).
Figure 2. Hardware block diagram
STM8S105C6T6
UM0817 Hardware and layout
Doc ID 16361 Rev 2 5/17
Figure 3. Top layout
USB connector
ST-LINK JTAG
USB data transfer LED
ST-LINK core
SWIM connectorST-
LIN
K m
odul
e
Possible separation pointLED (LD1)
Power supply jumper
External Osc. (16 MHz)
STM8S105C6T6
Touch sensing button (TS1)
Wrapping area
SO16 footprint
ST
M8S
105C
6T6
mod
ule
Hardware and layout UM0817
6/17 Doc ID 16361 Rev 2
2.1 STM8S105C6T6 microcontroller
Figure 4. STM8S105C6T6 package
This device provides the following benefits:
● Reduced system cost
– Integrated true data EEPROM for up to 300 K write/erase cycles
– High system integration level; internal clock oscillators, brown-out reset, watchdog.
● Performance and robustness
– 16 MHz CPU clock frequency
– Up to 38 I/Os on a 48-pin package including 16 high sink outputs
– Robust I/O immune against current injection
– Independent watchdogs with separate clock source
– Flexible clock control, 4 master clocks (HSI, LSI, HSE and external HSE)
– Clock security system
– A family of products for applications with 2.95 V to 5.5 V operating supply
● Short development cycles
– Applications scalability across common family product architecture with compatible pinout, memory map and modular peripherals.
– Full documentation and a wide choice of development tools
– Standard S/W library for firmware and touch sensing development quick start
– Numerous application notes and firmware examples available
● Product longevity
– Advanced core and peripherals made in state-of-the-art technology
– Low power modes (wait, active-halt, halt)
– Auto wake-up timer for active halt
– Permanently active, low consumption
● Other features
– Nested interrupt controller with 32 interrupts
– Up to 37 external interrupts on 6 vectors
– 2 x 16-bit general purpose timers; with 2+3 CAPCOM channels (IC, OC or PWM)
– Advanced control timer: 16-bit, 4 CAPCOM channels, 3 complementary outputs, dead- time insertion and flexible synchronization
– 8-bit basic timer with 8-bit prescaler
– UART with clock output for synchronous operation, Smartcard, IrDA, LIN
– SPI interface up to 8 Mbit/s
– I2C interface up to 400 Kbit/s
– Analog-to-digital converter 10-bit, ±1 LSB ADC with up to 10 multiplexed channels
The STM8S105C6T6 8-bit microcontroller offers:
1 Kbyte true data EEPROM32 Kbytes of Flash program memory
2 Kbytes RAM
UM0817 Hardware and layout
Doc ID 16361 Rev 2 7/17
Figure 5. STM8S105 block diagram
For more information see the STM8S105xx datasheet (Doc ID 14771) on the ST website.
Hardware and layout UM0817
8/17 Doc ID 16361 Rev 2
2.2 ST-LINK The ST-LINK provides a USB interface for programming and debugging using a single wire interface module (SWIM). The ST-LINK module of the STM8S-DISCOVERY also supplies 5 V and 3.3 V to the STM8S105C6T6 module.
2.2.1 Using the ST-LINK
Figure 6. Typical configuration
Note: The driver for ST-LINK is installed automatically when the USB is connected.
For information about debugging and programming features refer to ST-LINK UM0627, UM0036 STVD and RN0011 STVP. For information about SWIM refer to UM0470.
2.2.2 Using the ST-LINK on other STM8S applications
You can connect your ST-LINK to other STM8S applications in 2 ways.
● By removing the solder bridges: This way uses the ST-LINK without breaking the PCB. Unsolder the two solder bridges SB1 and SB2 under the SWIM connector. See Figure 7. You can re-solder the two bridges at a later date thus keeping the STM8S-DISCOVERY usable.
● By removing it from your board: This way constitutes a good alternative to programming the STM8S devices in other applications. See Figure 8.
Note: This ST-LINK only supports the STM8S family. Do not use it with other STM8 families.
Figure 7. ST-LINK without breaking the PCB
Hardware requirements:- USB cable type A to B- Computer with Windows 2000, XP or Vista OS
ST Toolset (ST Visual Develop and ST Visual Program)Software requirement:
which support ST-LINK SWIM
Remove SB1 and SB2 solder bridges
UM0817 Hardware and layout
Doc ID 16361 Rev 2 9/17
Figure 8. Separated ST-LINK module
Warning: By removing this module you will lose power supply on the STM8S105C6T6 evaluation board. In consequence, you will not be able to program and use the STM8S105C6T6 board without a SWIM cable and an external power supply.
To reconnect your STM8S105C6T6 use connector CNn see Section 3: Daughterboard connection.
2.3 Power supply and power selectionThe power supply is provided by a USB connector. Jumper JP1 selects the VDD value (5 V or regulated 3.3 V) see Figure 9.
Figure 9. Power selection
SWIM STLink
STM8S105C6 eval boardSTM8S105C6T6
VDD = 5 V
VDD = 3.3 V
Hardware and layout UM0817
10/17 Doc ID 16361 Rev 2
2.4 Single touch sensing A touch sensing button TS1 is available on the STM8S-DISCOVERY (see Figure 10).
Figure 10. Touch sensing schematic
To disable the touch sensing interface and to use PC1, PC2 and PC3 as standard I/O, you need to unsolder the 2-1 connection and solder 2-3 connection on SB4 and SB3, you also need to unsolder the R2 resistor.
RC acquisition principle
The RC acquisition method detects a human touch on key touch sensor (TS1) by measuring the small variation of the touch electrode capacitance. Electrode capacitance is periodically charged and discharged through a fixed resistor (R6).
The capacitance value depends on the following parameters: electrode area (A), relative dielectric constant of the insulator (eR), the relative permittivity of air (e0) and the distance between the two electrodes.
For more information about touch sensing please refer to AN2927.
UM0817 Daughterboard connection
Doc ID 16361 Rev 2 11/17
3 Daughterboard connection
Four 12-pin male headers CN1, CN2, CN3 and CN4 are connected to the STM8S105C6T6 microcontroller. See the following tables for pin assignments.
Table 1. CN1 pinout
Pin number(Cn1)
Pin number(chip)
Pin name
Typ
e
Main function Alternate function
1 1 NRST IO Reset
2 2 OSCIN/PA1 IO Port A1
3 3 OSCOUT/PA2 IO Port A2
4 4 Vssio_1 S I/O ground
5 5 Vss S Digital ground
6 6 VCAP S 1.8V regulator capacitor
7 7 Vdd S Digital power supply
8 8 Vddio_1 S I/O power supply
9 9 PA3 IO Port A3
10 10 PA4 IO Port A4
11 11 PA5 IO Port A5
12 12 PA6 IO Port A6
Table 2. CN2 pinout
Pin number(Cn2)
Pin number(chip)
Pin name
Typ
e
Main function Alternate function
1 25 PE5 IO Port E5 SPI master / slave
2 26 PC1/TS1 IO Port C1Timer 1 - channel 1 / UART2 synchronous clock
3 27 PC2/TS1_load IO Port C2 Timer 1 - channel2
4 28 PC3 IO Port C3 Timer 1 - channel 3
5 29 PC4 IO Port C4 Timer 1 - channel 4
6 30 PC5 IO Port C5 SPI clock
7 31 Vssio_2 S I/O ground
8 32 Vddio_2 S I/O power supply
9 33 PC6 IO Port C6 SPI master out / slave in
10 34 PC7 IO Port C7 SPI master in / slave out
11 35 PG0 IO Port G0
12 36 PG1 IO Port G1
Daughterboard connection UM0817
12/17 Doc ID 16361 Rev 2
*
Table 3. CN3 pinout
Pin number(Cn3)
Pin number(chip)
Pin name
Typ
e
Main function Alternate function
1 13 Vdda S Analog power supply
2 14 Vssa S Analog ground
3 15 PB7 IO Port B7 Analog input 7
4 16 PB6 IO Port B6 Analog input 6
5 17 PB5 IO Port B5 Analog input 5
6 18 PB4 IO Port B4 Analog input 4
7 19 PB3 IO Port B3 Analog input 3
8 20 PB2 IO Port B2 Analog input 2
9 21 PB1 IO Port B1 Analog input 1
10 22 PB0 IO Port B0 Analog input 0
11 23 PE7 IO Port E7 Analog input 8
12 24 PE6 IO Port E6 Analog input 9(2)
Table 4. CN4 pinout
Pin number(Cn4)
Pin number(chip)
Pin name
Typ
e
Main function Alternate function
1 37 PE3 IO Port E3 Timer 1 – break Input
2 38 PE2 IO Port E2 I2C data
3 39 PE1 IO Port E1 I2C clock
4 40 PE0 IO Port E0 Configurable clock output
5 41 PD0/LED IO Port D0 Timer 3 - channel 2
6 42 PD1/SWIM IO Port D1 SWIM data interface
7 43 PD2 IO Port D2 Timer 3 - channel 1
8 44 PD3 IO Port D3 Timer 2 - channel 2
9 45 PD4 IO Port D4 Timer 2 - channel 1
10 46 PD5 IO Port D5 UART2 data transmit
11 47 PD6 IO Port D6 UART2 data receive
12 48 PD7 IO Port D7 Top level interrupt
UM
0817E
lectrical schem
atics
Doc ID
16361 Rev 2
13/17
4 Electrical schematics
Figure 11. STM8S-DISCOVERY
STMicroelectronicsTitle:
Number: Rev: Sheet ofA.1(PCB.SCH) Date: 5/6/2009MB867 1 3
STM8S-Discovery
RESET#ST_LINK_SWIM
U_MCUMCU.SchDoc
RESET#ST_LINK_SWIM
U_ST_LINKST_LINK.SCHDOC
SB1SB2
UM
0817E
lectrical schem
atics
Doc ID
16361 Rev 2
14/17
Figure 12. STM8S-DISCOVERY MCU
1
1
2
2
3
3
4
4
STMicroelectronicsTitle:
Number: Rev: Sheet ofA.1(PCB.SCH) Date: 8/24/2009
NRST1
OSCIN/PA12
OSCOUT/PA23
Vssio_14
Vss5
VCAP6
Vdd7
Vddio_18
PA39
PA410
PA511
PA612
Vdd
a13
Vss
a14
PB7
15
PB6
16
PB5
17
PB4
18
PB3
19
PB2
20
PB1
21
PB0
22
PE7
23
PE6
24
PE5 25PC1 26PC2 27PC3 28PC4 29PC5 30Vssio_2 31Vddio_2 32PC6 33PC7 34PG0 35PG1 36
PE3
37PE
238
PE1
39PE
040
PD0
41PD
142
PD2
43PD
344
PD4
45PD
546
PD6
47PD
748
U1STM8S105C6T6
MB867 2 3
STM8S-Discovery MCU
C4
20pF
C320pF
X116MHz
R5 60
1 23 45 67 89 1011 12
CN1
Header 6X2H
12
LD1Green
VDD
R1510
C2
1nF
R610K
R4 1M
R2 10K
TS1TS_PAD
<----ESD resistor close to MCU pad
<----Touch Sensing diameter 8mm
<----Active shield
12
3
JP1
U5V
+3V3 VDD
R710K[N/A]
VDD
C110nF
NRSTPA1PA2
PA3PA4PA5PA6
VCAP
C5
680nF
VDD
VDDL1
BEAD C61uF
C7100nF
VDDA
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
PE0
PE1
PE2
PE3
PE5PE
6PE
7PC1PC2PC3PC4PC5
PC6PC7PG0PG1
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PD7
VDD
C8100nF
C9100nF
C10100nF
RESET#
ST_LINK_SWIM
1 23 45 67 89 1011 12
CN3
Header 6X2H
1 23 45 67 89 1011 12
CN2
Header 6X2H
1 23 45 67 89 1011 12
CN4
Header 6X2H
NRST PA1PA2
PA3 PA4PA5 PA6
VCAP
VDDVDD
VDDA
PB0PB1PB2PB3PB4PB5PB6PB7
PE6PE7
PE5 EX_PC1PC2 EX_PC3PC4 PC5
VDDPC6 PC7PG0 PG1
PE0PE1PE2PE3
PD0 PD1PD2 PD3PD4 PD5PD6 PD7
Top
RightLeft
Down
Extension connector
213
SB3solder bridge
213
SB4solder bridge
EX_P
C1
EX_PC3
SB5
UM
0817E
lectrical schem
atics
Doc ID
16361 Rev 2
15/17
Figure 13. STM8S-DISCOVERY ST-LINK (SWIM only)
1
1
2
2
3
3
4
4
STMicroelectronicsTitle:
Number: Rev: ShA.1(PCB.SCH) Date: 6/25/2009
VBAT1
PC132
PC143
PC154
OSC_IN5
OSC_OUT6
/RST7
VSSA8
VDDA9
PA010
PA111
U2_TX12
U2_
RX
13
U2_
CK
14
S1_C
K15
S1_M
ISO
16
S1_M
OSI
17
PB0
18
PB1
19
PB2/
BO
OT1
20
PB10
21
VSS
_123
VD
D_1
24
PB12 25
PB11
22
S2_CK 26S2_MISO 27S2_MOSI 28PA829PA9 30PA10 31PA11 32PA12 33JTMS 34VSS_2 35VDD_2 36
JTC
K37
JTD
I38
JTD
O39
JNR
ST40
PB5
41PB
642
PB7
43B
OO
T044
PB8
45PB
946
VSS
_347
VD
D_3
48
U2STM32F103C8T6
20pFC16
20pFC15
1 2X2
8MHz+3V3
U2_TX
U2_
RX
U2_
CK
M25_CS
VCC 1
D- 2
D+ 3
GND 4
SHELL 0
SHELL 0
CN6
USB-typeB connector
U5V
USB_DMUSB_DP
USB_DMUSB_DP
STM_RST
T_J
TC
K
T_JTCK
T_J
TD
OT
_JT
DI
T_JTMS
+3V3
STM_JTMS
ST
M_J
TC
KS
TM
_JT
DI
ST
M_J
TD
OS
TM
_JR
ST
+3V3
OSC_INOSC_OUT
U1_TXU1_RX
1345678
CN5
JTAG
STM_JRST
STM_JTDOSTM_JTDI STM_JTMSSTM_JTCK
T_N
RS
TT
_JR
ST
LD2
RED
ST_LINK_LED
R19
4K7
R20
4K7
AIN_1C11100nF
R16
100K
R181K5
R21 22R22 22
R17
510
R15
100K
+3V3
+3V3
VDD
+3V3
+3V3
+3V3
SWIMSWIM_RST
SWIM_INSWIM_RST_IN
SW
IM_I
N
SW
IM_I
N
SW
IM_I
N
SW
IM
SW
IM
SW
IM_R
ST
_IN
SW
IM_R
ST
AIN_1
MCU
USB
VDD
RESET#ST_LINK_SWIM
MB867
STM8S-Discovery ST_LINK (SWIM only)
R9 220R8 220
SWIM_PULLUP_CTL
ST_LINK_LED
+3V3
R14 47R13 47
R12680
C13104P
C17104P
C184.7uF
C194.7uF
Vin3 Vout 2
1
U4LD1117-3V3
C14104P
C12104P
U5V
1234
CN7
Header 4
VDD
SWIM
LED
Revision history UM0817
16/17 Doc ID 16361 Rev 2
5 Revision history
Table 5. Document revision history
Date Revision Changes
05-Oct-2009 1 Initial release.
12-Feb-2010 2 Section 2.4: RC acquisition principle modified.
UM0817
Doc ID 16361 Rev 2 17/17
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve theright to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at anytime, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes noliability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of thisdocument refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party productsor services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of suchthird party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIEDWARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIEDWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWSOF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOTRECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAININGAPPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY,DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVEGRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately voidany warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, anyliability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2010 STMicroelectronics - All rights reserved
STMicroelectronics group of companies
Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America
www.st.com