UM1079 User manual STM32L1 discovery kits: STM32L-DISCOVERY and 32L152CDISCOVERY Introduction The STM32L-DISCOVERY (order code STM32L-DISCOVERY) and the 32L152CDISCOVERY (order code STM32L152C-DISCO) help you to discover the STM32L ultra low power features and to develop and share your applications. The STM32LDISCOVERY and 32L152CDISCOVERY are based on an STM32L152RBT6 (128 Kbytes of Flash memory) and an STM32L152RCT6 (256 Kbytes of Flash memory), respectively. They include an ST-LINK/V2 embedded debug tool interface, LCD (24 segments, 4 commons), LEDs, pushbuttons, a linear touch sensor, and four touchkeys. In this document, STM32L1 discovery refers both to the STM32L-DISCOVERY and to the 32L152CDISCOVERY. STM32L-DISCOVERY and 32L152CDISCOVERY kits are functionally equivalent. The difference is the internal Flash memory size (128 Kbytes or 256 Kbytes). Figure 1. STM32L1 discovery board April 2013 DocID018789 Rev 3 1/39 www.st.com Contents UM1079 Contents 1 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2 Quick start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.3 Development toolchain supporting the STM32L1 discovery . . . . . . . . . . . 8 2.4 Demonstration software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.5 Order codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4 Hardware and layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.1 STM32L152RBT6 or STM32L152RCT6 microcontroller . . . . . . . . . . . . . 14 4.2 Embedded ST-LINK/V2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.2.1 Using the ST-LINK/V2 to program/debug the STM32L on board . . . . . 18 4.2.2 Using the ST-LINK/V2 to program/debug an external STM32L application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.3 Power supply and power selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.4 LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.5 Pushbuttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.6 Linear touch sensor/touchkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.7 Built-in IDD measurement circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.7.1 High IDD range mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.7.2 Low IDD range mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.7.3 IBIAS current measurement procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.8 Solder bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.9 LCD (24 segments, 4 commons) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5 Extension connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6 Mechanical drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7 Electrical schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 2/39 DocID018789 Rev 3 UM1079 8 Contents Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 DocID018789 Rev 3 3/39 List of tables UM1079 List of tables Table 1. Table 2. Table 3. Table 4. Table 5. Table 6. Table 7. Table 8. Table 9. 4/39 ON/OFF conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Functions executed when clicking B1 button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Jumper states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Debug connector CN2 (SWD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Solder bridges. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 LCD connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 MCU pin description versus board function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 DocID018789 Rev 3 UM1079 List of figures List of figures Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14. Figure 15. Figure 16. Figure 17. Figure 18. Figure 19. Figure 20. STM32L1 discovery board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Hardware block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Top layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Bottom layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 STM32L152RBT6 or STM32L152RCT6 package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 STM32L152RBT6 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 STM32L152RCT6 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Typical configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 STM32L1 discovery connections image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 ST-Link connections image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 STM32L1 discovery IDD measurement circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 STM32L1 discovery low IDD range measurement timing diagram . . . . . . . . . . . . . . . . . . . 23 LCD segment mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 STM32L1 discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 STM32L1 discovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 ST-LINK/V2 (SWD only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 32L152CDISCOVERY MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 STM32L1 discovery LCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 STM32L1 discovery IDD measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 STM32L1 discovery linear touch sensor/touchkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 DocID018789 Rev 3 5/39 Conventions 1 UM1079 Conventions Table 1 provides the definition of some conventions used in the present document. Table 1. ON/OFF conventions Convention 6/39 Definition Jumper JP1 ON Jumper placed between pin 2 and 3 Jumper JP1 OFF Jumper placed between pin 1 and 2 Solder bridge SBx ON SBx connections closed by solder Solder bridge SBx OFF SBx connections left open DocID018789 Rev 3 UM1079 2 Quick start Quick start The STM32L1 discovery is a low-cost and easy-to-use development kit to quickly evaluate and start a development with an STM32L ultra low power microcontroller. Before installing and using the product, please accept the Evaluation Product License Agreement from www.st.com/stm32l1-discovery. For more information on the STM32L1 discovery and for demonstration software visit www.st.com/stm32l1-discovery. 2.1 Getting started Follow the sequence below to configure the STM32L1 discovery board and launch the Discovery application: 1. Check jumper positions on the board: JP1 and CN3 must be ON (Discovery selected) (see Figure 3 on page 12). 2. Connect the STM32L1 discovery board to a PC with a USB cable to power the board. Red LED LD2 (PWR) and LD1 (COM) are then lit up. 3. Function 1 is executed. Each click on user button B1 changes the executed function as described in Table 2 on page 7. A 4-LED bar shows the function being performed (1 to 4 bars can be switched ON). Depending on the function selected, the voltage value, the linear touch sensor position, the touchkey status, or the STM32L current consumption is displayed on the LCD. Table 2. Functions executed when clicking B1 button Function LED LD3/4 Bar status Value displayed on LCD 1 LD3 and LD4 blink Measured STM32L VDD voltage 2 LD3 ON Linear touch sensor position from 0 to 100% 3 LD4 ON Status of the 4 touchkeys Main function Voltage measurement Touch sensing DocID018789 Rev 3 7/39 Quick start UM1079 Table 2. Functions executed when clicking B1 button (continued) Function LED LD3/4 Bar status Value displayed on LCD Main function STM32L consumption measured in Run mode (4 MHz) 4 STM32L consumption measured in Sleep mode (4 MHz) STM32L consumption measured in Run mode (32 KHz) 5 LD3 and LD4 OFF STM32L consumption measured in low power sleep mode (32 KHz) STM32L consumption measured in Stop mode, RTC ON STM32L current consumption measurement 6 STM32L consumption measured in Stop mode, RTC OFF 7 STM32L consumption measured in Standby mode To study or modify the Discovery project related to this demonstration, visit www.st.com/stm32l1-discovery and follow the tutorial. Discover the STM32L features, download and execute programs proposed in the list of projects. This site also contains examples from which you can develop your own applications. 2.2 2.3 System requirements • Windows PC (XP, Vista, 7) • USB type A to Mini-B USB cable Development toolchain supporting the STM32L1 discovery • 2.4 • Altium TASKING™ VX-Toolset ® Atollic TrueSTUDIO • IAR EWARM • Keil™ MDK-ARM Demonstration software The demonstration software is preloaded in the board Flash memory. It uses the built-in IDD measurement feature of the STM32L1 discovery to automatically measure and display on the LCD the MCU consumption in Run and low power modes.it also allows to demonstrate touch sensing functionalities such as linear touch sensor or touchkeys. The latest versions of this demonstration source code and associated documentation can be downloaded from www.st.com/stm32l1-discovery. 8/39 DocID018789 Rev 3 UM1079 2.5 Quick start Order codes To order the STM32L ultra low power discovery board, refer to Table 3. Table 3. Device summary Part number Order code Description Board number marked on silkscreen STM32L-DISCOVERY STM32L-DISCOVERY(1) Discovery kit based on STM32L152RBT6 MB963 B 32L152CDISCOVERY STM32L152C-DISCO Discovery kit based on STM32L152RCT6 MB963 C 1. STM32L-DISCOVERY is replaced by STM32L152C-DISCO. DocID018789 Rev 3 9/39 Features 3 UM1079 Features The STM32L1 discovery offers the following features: • An STM32L152RBT6 (128 Kbyte Flash memory, 16 Kbyte RAM, 4 Kbyte data EEPROM) or STM32L152RCT6 (256 Kbyte Flash memory, 32 Kbyte RAM, 8 Kbyte data EEPROM) microcontroller in a 64-pin LQFP package • On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone STLINK/V2 (with SWD connector for programming and debugging) • Board power supply: through USB bus or from an external 3.3 or 5 V supply voltage • External application power supply: 3 V and 5 V • IDD current measurement • LCD • 10/39 – DIP28 package – 24 segments, 4 commons Four LEDs: – LD1 (red/green) indicating USB communication – LD2 (red) indicating that 3.3 V power supply is ON – Two user LEDs, LD3 (green) and LD4 (blue) • Two pushbuttons (user and reset) • One linear touch sensor and four touchkeys • Extension header for LQFP64 I/Os for quick connection to prototyping board and easy probing DocID018789 Rev 3 UM1079 Hardware and layout The STM32L-DISCOVERY and 32L152CDISCOVERY are designed around an STM32L152RBT6 and STM32L152RCT6, respectively. Both microcontrollers are packaged in an LQFP64. Figure 2 illustrates the connections between the STM32L152 microcontroller and its peripherals (ST-LINK/V2, pushbutton, LED, LCD, linear touch sensor, touchkeys, and connectors). Figure 3 on page 12 and Figure 4 on page 13 help you to locate these features on the STM32L1 discovery kits. Figure 2. Hardware block diagram -INI 53" 37$ %MBEDDED 34,).+6 34-,2"4 34-,2#4 )/ )/ 2%3%4 'REEN,%$ ,$ (EADER )/ (EADER 4 Hardware and layout " 234 " 53%2 "LUE,%$ ,$ )$ $ -EASUREMENT ,INEARTOUCHSENSOR TOUCHKEYS ,#$SEGMENTSCOMMONS -36 DocID018789 Rev 3 11/39 Hardware and layout UM1079 Figure 3. Top layout ,$ #/#. 37$CONNECTOR ,$ 072 34,).+6 #.34,).+$)3#/6%29 SELECTOR 6POWER SUPPLYINPUTOUTPUT 6POWER SUPPLYINPUTOUTPUT ,#$ SEGMENTS )$$MODULE 3" )$$MEASUREMENT *0 )$$MEASUREMENT 3""//4 34-,2"4 OR34-,2#4 *066"!4SELECTOR OPTIONALNOTMOUNTED 3" "53%2 3" "2%3%4 " RESETBUTTON " USERBUTTON ,$ BLUE,%$ ,$ GREEN,%$ ,INEARTOUCHSENSOR TOUCHKEYS -36 1. Pin 1 of CN1, CN2, P1 and P2 connectors are identified by a square. 12/39 DocID018789 Rev 3 UM1079 Hardware and layout Figure 4. Bottom layout 3"3"3"3" RESERVED 3".234 3"34-?234 3"3"3"3" DEFAULT 3"37/ 0CONNECTOR 0CONNECTOR 3")$$ MEASUREMENT *0)$$ 3"3" 8CRYSTAL 3""//4 3"-# 3"3" 8CRYSTAL 3" 6$$POWEREDFROM6 3" "ATTERYENABLE #2 BATTERYHOLDER OPTIONAL -36 1. Pin 1 of CN1, CN2, P1 and P2 connectors are identified by a square. DocID018789 Rev 3 13/39 Hardware and layout 4.1 UM1079 STM32L152RBT6 or STM32L152RCT6 microcontroller The STM32L152RBT6 ultra low power microcontroller features 128 Kbyte of Flash memory, 16 Kbyte of RAM and 4 Kbyte of data EEPROM, while the STM32L152RCT6 features 256 Kbyte of Flash memory, 32 Kbyte of RAM and 8 Kbyte data of EEPROM. Both devices embed RTC, LCD, timers, USART, I2C, SPI, ADC, DAC, and comparators. Figure 5. STM32L152RBT6 or STM32L152RCT6 package 34-,2"4OR34-,2#4 OR+BYTESOF&LASHMEMORY OR+BYTESOF2!OR+BYTESOFDATA%%02/- ,1&0XMM -36 This device provides the following benefits: • Ultra low power proprietary 130 nm technology: Speed and power consumption independent of MCU power supply, and ultra low leakage • Ultra Low power design (clock gating, low-power Flash with power-off capability): Reduced overall Run and Wait mode current consumption by turning off clocks of unused peripherals or Flash • Sub 1 µA hardware RTC and AWU system unit: Ultra Low power modes for applications requesting regular wake up • Up to 6 low power modes: Suitable for many applications from complete switch off to continuous monitoring at ultra low frequency • Advanced and flexible clock system (multiple internal and external clock sources) Switch and adjust frequency and clock sources on the fly depending on application needs • Direct memory access on board (up to 12 DMA channels): Autonomy for peripherals, independent from core; can switch off Flash memory and CPU (large current consumption contributors) while keeping peripherals active • Ultra Low power and ultrasafe features (POR, PDR, BOR, PVD) allowing integrated application safety and security • Unique identifier to enhance user data confidentiality/reliability • Ultrafast wakeup from lowest consumption low-power mode allowing fast switching from static and dynamic power modes • Analog functional down to 1.8 V, and programming down to 1.65 V • Full functionality over the complete VDD range For more information, refer to the STM32L152RBT6 and STM32L152RCT6 datasheets available on ST website. 14/39 DocID018789 Rev 3 UM1079 Hardware and layout Figure 6. STM32L152RBT6 block diagram TRACECK, TRACED0, TRACED1, TRACED2, TRACED3 @V DD J T AG & SW Trace controller ETM pbus Flash obl Int erface Cortex-M3 CPU Ibus F ma x : 32 MH z Db us MP U S yst em NV IC GP DMA A HBP CL K AP BP CL K HC L K FC LK @V DD A Supply monitoring BOR/V V DDA / VSS A PLL & X T AL O S C 1-24 MHz clock management OSC_IN OSC_OUT RC HS RC MS Power reset REFINT PV D IWDG RC LS Standby interface @VD D A Int Co mp 1 COMP2 _IN- /IN+ V SS @V DD A =32 MHz VR EF O UTPU T V DD =1. 65 V to 3.6 V 128 KB Flash 4 KB data EEPROM RAM 16 KB 7 c hannels NRST PO WE R VO LT. R E G. B us Matrix NJT R ST JT D I JT CK/ S WCLK JTMS /S WDAT JTDO as A F V CO R E RT C AW U Backup register max Co mp 2 X T A L 32 kHz AHB:F Power-up/ Power-down OS C32 _IN OS C32 _OUT RTC_AFIN RTC_OUT, RTC_TS,RTC_TAMP P A [15:0 ] GPIOA P B [15:0 ] GPIOB P C [15:0 ] GPIOC PD[ 15:0] GPIOD TIM2 4 Ch an nels PE[1 5:0 ] GPIOE TIM3 4 Ch an nels PH[2 :0 ] GPIOH TIM4 4 Ch an nels V LC D Backup interface AH B2 83A F EXT. IT WKU P MOSI ,MIS O, SC K, NS S as AF SPI 1 @V DD A 12-bit ADC IF Te mp s ens or APB1 : F 24 A F V DDREF _ADC * V SS REF_ ADC * US ART 1 AP B2 : F ma x =32 MHz RX ,T X , C T S, R T S, S mar tC ar d as AF AHB 2 AHB/APB1 ma x =32MHz AHB/APB2 LCD step-up converter US B RAM 512 B US ART 2 RX ,TX, C T S, R T S, S m artCa rd as A F US ART 3 RX ,T X , CT S , RT S , S m artC ard a s AF SP I2 MO S I,MIS O, S CK, NS S as AF I2C 1 SC L, S D A as AF I2C 2 S C L, SD A, SMB us ,P MB us as AF USB 2.0 FS device WWDG LCD 8x4 0 (4x44 ) General purpose timers 2 Channe ls TI M9 1 C hannel TI M10 1 Channel TI M11 V LCD =2.5 V to 3.6 V US B_DP US B_DM SEG x COM x @V DD A BA SI C T IME RS TIM6 12-bit DAC1 DAC_OUT1 as AF 12-bit DAC2 DAC_OUT2 as AF IF IF TIM7 M Ai15687h DocID018789 Rev 3 15/39 Hardware and layout UM1079 Figure 7. STM32L152RCT6 block diagram TRACECK, TRACED0, TRACED1, TRACED2, TRACED4 J TA G & S W m ax : 32 MHz D bu s S ys tem NV IC G P D MA 7 c h an n els E E² obl Interfac e f MP U @ VDD 33 P O WE R OR E VO L T . R E G . Ibus M3 C P U B us Matrix 5 M/5S NJTRST JTDI J T CK /S WC LK J T MS /S WDAT J TDO as A F V DDC T race C ontroller E T M pbus EE P R O M 64 bit Supply monitoring P DR @ VDD 33 X TAL O S C 1-24 MHz G P D MA2 5 c h an n els AH B P C L K APB PC L K HC L K FC L K Cap. sens C O MPx_ INx G P C om p PU / PD P A [15:0] @VDDA G P IO P O R T A P B [15:0] G P IO P O R T B P C [15:0] G P IO P O R T C S tandb y interface R C MS I Int X T A L 32k Hz L SAI @RC VDD B ac k up i nterfac e @ VDD 33 L CD B oos ter G P IO P O R T G 115 A F E X T .IT WKU P MOS I,MIS O , S CK ,NS S as A F S P I1 AHB/APB2 4 C hannels US B S RA M 512 B T IME R 6 MAX Temp s ens or T IME R 7 1 C hannel T IME R 10 1 C hannel T IME R 11 Sit)P I3/I2S 2x (8x 16b MO S I,MIS O, S CK ,NS S ,WS ,C K MCK ,S D as A F I2C 1 S C L ,S D A as A F I2C 2 S C L ,S DA ,S MB us ,P MB us as A F US B 2. 0 F S dev ic e Cap. sensing L CD 8x 40 O P A MP 1 T IME R 9 R X ,T X , C T S , R T S , S martC ard as A F MO S I,MIS O, S CK ,NS S ,WS ,C K MCK ,S D as A F APB1: f APB2: f General purpose timers US A R T 3 Sit)P I2/I2S 2x (8x 16b WinWA T CH D OG IF = 32 MHz 12bit AD C US A R T 2 R X ,T X , C T S , R T S , S m artC ard as A F AHB/APB1 US AR T 1 @VDDA V S S R E F _AD C * US B _DP US B _DM Px S E Gx C O Mx @VDDA O P A MP 2 12bit DAC 1 DAC_OUT1 as AF 12 bit DAC 2 DAC_OUT2 as AF IF IIFF VINP VINM VOUT 16/39 T IME R 4 G P IO P O R T H G P IO P O R T F 2 C hann els 4 C hannels 4 C hannels T IME R 5 (32 bits ) P F [15 :0] 40 A F V D DR E F _AD C * 4 C hannels G P IO P O R T E P G [15:0] R X ,T X , C T S , R T S , S martC ard as A F V L C D =2.5V to 3.6V T IME R 3 MAX P H[2:0] T A MPER G P IO P O R T D = 32 MHz P E [15:0] O S C 32_ IN O S C 32_ OUT RTC_OUT R T C V 2 B ack up reg 12 8 AW U T IMER2 P D [15:0] O S C _IN O S C _OUT WD G 32K VL C D P VD PLL & Clock Mgmt RC HS I B OR AHB :F m ax =32 MHz VDD A / VS S A NRST P DR @VDDA Supply monitoring B O R / B g ap VS S Vref 256 KB P R OG RA M 8KB DA T A 8KB B OO T S RA M 32K V D D 33=1.65V to 3.6V VINP VINM VOUT DocID018789 Rev 3 MS19482V4 UM1079 4.2 Hardware and layout Embedded ST-LINK/V2 The ST-LINK/V2 programming and debugging tool is integrated on the STM32L1 discovery. The embedded ST-LINK/V2 can be used in 2 different ways according to the jumper states (see Table 4 on page 17): • Program/debug the MCU on board, • Program/debug an MCU in an external application board using a cable connected to SWD connector CN2. The embedded ST-LINK/V2 supports only SWD for STM32 devices. For information about debugging and programming features refer to user manual UM1075 which describes in detail all the ST-LINK/V2 features. Figure 8. Typical configuration (ARDWAREREQUIREMENTS 53"CABLETYPE!TOMINI" COMPUTERWITH7INDOWS806ISTAOR $EVELOPMENTTOOLCHAIN !LTIUM4!3+).'684OOLSET !TOLLIC4RUE345$)/ )!2%7!2+EIL-$+!2- Table 4. Jumper states Jumper state Description Both CN3 jumpers ON ST-LINK/V2 functions enabled for on board programming (default) Both CN3 jumpers OFF ST-LINK/V2 functions enabled for external application through CN2 connector (SWD supported). DocID018789 Rev 3 17/39 Hardware and layout 4.2.1 UM1079 Using the ST-LINK/V2 to program/debug the STM32L on board To program the STM32L on board, simply plug in the two jumpers on CN3, as shown in Figure 9 in red, but do not use the CN2 connector as that could disturb communication with the STM32L152 microcontroller of the STM32L1 discovery. Figure 9. STM32L1 discovery connections image 0INOF#. 37$CONNECTOR #.JUMPERS/. -36 18/39 DocID018789 Rev 3 UM1079 4.2.2 Hardware and layout Using the ST-LINK/V2 to program/debug an external STM32L application It is very easy to use the ST-LINK/V2 to program the STM32L on an external application. Simply remove the 2 jumpers from CN3 as shown in Figure 10, and connect your application to the CN2 debug connector according to Table 5. Note: SB100 must be OFF if you use CN2 pin 5 in your external application. Table 5. Debug connector CN2 (SWD) Pin CN2 Designation 1 VDD_TARGET VDD from application 2 SWCLK SWD clock 3 GND Ground 4 SWDIO SWD data input/output 5 NRST RESET of target MCU 6 SWO Reserved Figure 10. ST-Link connections image 0INOF#. 37$CONNECTOR #.JUMPERS/&& -36 DocID018789 Rev 3 19/39 Hardware and layout 4.3 UM1079 Power supply and power selection The power supply is provided either by the host PC through the USB cable, or by an external 5 V or 3.3 V power supply. The D1 and D2 protection diodes allow the EXT_5V and EXT_3V pins to be used independently as input or output power supplies (see Figure 3 on page 12): • EXT_5V and EXT_3V can be used as output power supplies when the application board is connected to pins P1 and P2. In this case, the EXT_5V and EXT_3V pins deliver a 5 V or 3 V power supply and power consumption must be lower than 100 mA. • EXT_5V and EXT_3V can also be used as input power supplies e.g. when the USB connector is not connected to the PC. In this case, the STM32L1 discovery board must be powered by a power supply unit or by auxiliary equipment complying with standard EN-60950-1: 2006+A11/2009, and must be Safety Extra Low Voltage (SELV) with limited power capability. Battery powered (optional) In addition, the STM32L1 discovery board has been designed to run from a CR2032 standalone battery (no connection with USB or other power supply is required). By default, no battery holder is mounted on the board and SB21 and SB22 are configured in their default state (see Table 6: Solder bridges on page 24). Follow the procedure below to power the STM32L1 discovery from the battery: 1. Solder a B7410AP2L battery holder from LOTES on CR1. 2. Configure SB100 OFF. 3. Remove both jumpers from CN3 (see Figure 10) 4. Select the battery as power supply. Two solutions are possible: a) Solder bridge: Configure SB21 OFF, and SB22 ON. No header is required on JP2. b) Jumper: Configure SB21 and SB22 OFF. Solder a header on JP2, identical to JP1 on the top side, and set a jumper between VDD and VBAT to power the STM32L152 MCU. Note: In this configuration, it is possible to power the STM32L from the board 3 V supply voltage by setting a jumper between VDD and 3V. 5. Plug the CR2032 battery into CR1 holder. You can now run the demonstration. Warning: 4.4 20/39 Wrong solder bridge configuration can damage board components. LEDs • LD1 COM: LD1 default status is red. LD1 turns to green to indicate that communications are in progress between the PC and the ST-LINK/V2. • LD2 PWR: red LED indicates that the board is powered. • User LD3: green LED is a user LED connected to the I/O PB7 of the STM32L152 MCU. • User LD4: blue LED is a user LED connected to the I/O PB6 of the STM32L152 MCU. DocID018789 Rev 3 UM1079 4.5 4.6 Hardware and layout Pushbuttons • B1 USER: User pushbutton connected to the I/O PA0 of the STM32L152 MCU. • B2 RESET: Pushbutton is used to RESET the STM32L152 MCU. Linear touch sensor/touchkeys To demonstrate touch sensing capabilities, the STM32L1 discovery includes a linear touch sensor which can be used either as a 3-position linear touch sensor or as 4 touchkeys. Both functionalities are illustrated in the demonstration software (see Table 2: Functions executed when clicking B1 button on page 7). 3 pairs of I/O ports are assigned to the linear touch sensor/touchkeys. Each pair must belong to the same analog switch group: • PA6, PA7 (group 2) • PC4, PC5 (group 9) • PB0, PB1 (group 3) To minimize the noise, these pairs are dedicated to the linear touch sensor and the touchkeys and are not connected to external headers. To design a touch sensing application, refer to the following documentation and firmware: 4.7 • For details concerning I/O ports, refer to the STM32L152RBT6 or STM32L152RCT6 datasheet. • For information on software development, see DISCOVER application software on http://www.st.com/stm32l1-discovery. • For more detail concerning touch sensing application design and layout, refer to AN2869 -Guidelines for designing touch sensing applications. • STM32 touch sensing library available from http://www.st.com/stm32l1-discovery. Built-in IDD measurement circuit The STM32L1 discovery built-in IDD measurement circuit allows the consumption of the STM32L152 to be measured and displayed on the LCD Glass while the MCU is in Run or low power modes. Note: • JP1 ON: the STM32L152 is powered through the IDD measurement circuit (default). • JP1 OFF: the STM32L152 is directly powered, IDD measurement circuit is bypassed. When jumper JP1 is removed the current consumption of the STM32L152 can be measured by connecting an ammeter between jumper pin 1 and pin 2 of JP1. For IDD measurement to be performed by the MCU itself, the circuit below is implemented on the STM32L1 discovery. Solder bridges SB1, SB2 and SB14 must be closed and JP1 must be ON.The low IDD range procedure (see Section 4.7.2) is recommended when the MCU is in low power mode and the IDD current does not exceed 60 μA. When the MCU operates in Run mode and can sink up to 30 mA, use the high IDD range procedure (see Section 4.7.1). DocID018789 Rev 3 21/39 Hardware and layout UM1079 Figure 11. STM32L1 discovery IDD measurement circuit )$$ -EASURE 6$$?-#5 ON OFF *0 2 + 6$$ 3 ' 3 ' 3" $ $ $ $ )$$?-EASUREMENT 2 + # U& 6$$ 3" 0! 2 + 6$$ # N& 5 )$$?7!+%50 5 ,8'#42 6$$ 5 2 ('342 6$$ 2 5 -! 8&%5+ 5 )/ /) # '.$ 6## 0! 1 6## 1 1 1 1 1 1 1 #,2 1 #) 1 #/ '.$ #/ -(#442 343$0&, 6$$ 2 + )$$?#.4?%. 3" # N& 2 + 0# 2 + /SCILLATOR FREQUENCY +(Z -36 4.7.1 High IDD range mode In high IDD range mode, the IDD current is measured using the operational amplifier MAX9938FEUK+ (U5) connected to the 2 Ω shunt resistor (R21). In this case IDD_CNT_EN remains high during measurement, so R22 remains in short-circuit during the measurement because FET transistor 1 of U20 remains ON permanently. 4.7.2 Low IDD range mode In low IDD range mode, the operational amplifier MAX9938FEUK+ (U5) is connected to the 1 KΩ shunt resistor (R22), controlled by FET transistor 1 of U20. In this case the counter 74HC4060 (U3) enabled by IDD_CNT_EN manages the measurement timing according to Figure 12 on page 23. Low IDD range measurement principle The principle used to measure the consumption current when the STM32L152 is in low IDD range mode is as follows: 1. Configure ADC to measure voltage on the IDD_Measurement pin. 2. Configure PA0 to serve as wakeup pin. 3. Enter low IDD range mode after setting IDD_CNT_EN (PC13) signal low. 4. IDD_WAKEUP rising edge wakes up the MCU after around 300 ms. 5. Start ADC conversion as soon as possible after wakeup in order to measure the voltage corresponding to Low power mode on capacitor C13. 6. Reset the counter by programming IDD_CNT_EN high (in less than 150 ms after the wakeup) to avoid the R22 1 KΩ resistor being connected later in Run mode. The measurement timing is given in Figure 12. In low IDD range mode, the 1 KΩ resistor is connected when FET transistor 1 of U20 goes OFF after entering low IDD range mode. The 22/39 DocID018789 Rev 3 UM1079 Hardware and layout Q13 output of the counter allows connecting the 1 KΩ resistor when the current IDD becomes very low. Figure 12 shows how the counter and FET transistor 1 of U20 ensure that, 150 ms after IDD_CNT_EN falling edge, the shunt resistor R22 is connected between VDD_MCU and the power supply to reduce the measurement range to 60 μA for the full scale. Then after another 150 ms required for current stabilization, R22 is shorted, the IDD measurement is stored in C13, and the MCU is woken up. After wakeup the MCU can measure the IDD current corresponding to the low power mode stored in C13. Figure 12. STM32L1 discovery low IDD range measurement timing diagram #LEAR 5COUNTER 5COUNTERENABLED ,OWPOWERMODE 2UNMODE 7AKEUP )$$ MEASUREMENT )$$?#.4?%. MS 1,/7?0/7%2?%. 5PIN MS MS 1)$$?7!+%50 15PIN -36 4.7.3 IBIAS current measurement procedure In Low IDD range mode, the bias current of the operational amplifier input (U5 pin 4) is not negligible compared to IDD current (typical IBIAS is ~240 nA). To obtain a reliable STM32L152 IDD measurement, it is mandatory to subtract the bias current from the low IDD current value since this current is not sunk by the MCU. IBIAS is measured during production test and stored in the MCU data EEPROM. The DISCOVER demonstration software, uses this value to display the correct IDD. The procedure for IBIAS measurement implemented in the demonstration software is: 1. Power off the board (disconnect the USB cable). 2. Set JP1 OFF. 3. Push down B1 (USER button), power on the board from the USB. 4. Wait at least 1 second before releasing B1, the LCD displays the IBIAS measurement. 5. Power off the board (disconnect the USB cable). 6. Set JP1 ON. The IBIAS value is stored in data EEPROM. The bias current is then subtracted from the IDD measured in IDD range mode. DocID018789 Rev 3 23/39 Hardware and layout 4.8 UM1079 Solder bridges Table 6. Solder bridges State(1) Description ON PH0, PH1 are connected to P1 (X3, C21, C22, R30 must not be fitted). OFF X3, C21, C22 and R30 provide a clock as shown in Section 7: Electrical schematics. PH0, PH1 are disconnected from P1. SB7,9,11,13 (DEFAULT) ON Reserved, do not modify. SB6,8,10,12 (RESERVED) OFF Reserved, do not modify. ON PA0, PA4, PC13 are used by the IDD measurement. JP1 ON. OFF PA0, PA4, PC13 are available and IDD module cannot be used JP1 OFF. OFF X2, C16, C17 and R28 deliver a 32 KHz clock. PC14, PC15 are not connected to P1. ON PC14, PC15 are only connected to P1. Do not remove X2, C16, C17, R28. ON B2 Pushbutton is connected to the NRST pin of the STM32L152 MCU. OFF B2 Pushbutton is not connected the NRST pin of the STM32L152 MCU. ON B1 Pushbutton is connected to PA0. OFF B1 Pushbutton is not connected to PA0. ON VDD is powered from 3 V, SB22 must be OFF. OFF VDD is not powered from 3 V, SB22 must be ON. OFF VDD is not powered by the CR2032 battery, SB21 must be ON. ON VDD is powered by the CR2032 battery, SB21 must be OFF. ON The NRST signal of the CN2 connector is connected to the NRST pin of the STM32L152 MCU. OFF The NRST signal of the CN2 connector is not connected to the NRST pin of the STM32L152 MCU. ON The SWO signal of the CN2 connector is connected to PB3. OFF The SWO signal is not connected. OFF No incidence on STM32F103C8T6 NRST signal. ON STM32F103C8T6 NRST signal is connected to GND. Bridge SB18,20 (X3 crystal)(2) SB1,2,14 (IDD_Measurement) SB15,16 (X2 crystal) SB5 (B2-RESET) SB4 (B1-USER) SB21 (VDD powered from 3 V) SB22 (Battery enable) SB100 (NRST) SB101 (SWO) SB102 (STM_RST) 24/39 DocID018789 Rev 3 UM1079 Hardware and layout Table 6. Solder bridges (continued) State(1) Bridge Description ON The BOOT0 signal of the STM32L152 MCU is held low through a 510 Ω pull-down resistor. OFF The BOOT0 signal of the STM32L152 MCU is held high through a 10 KΩ pull-up resistor. OFF The BOOT1 signal of the STM32L152 MCU is held high through a 10 KΩ pull-up resistor. ON The BOOT1 signal of the STM32L152 MCU is held low through a 510 Ω pull-down resistor. OFF STM32F103C8T6 MCO clock signal is not used. ON STM32F103C8T6 MCO clock signal is connected to OSC_IN of the STM32L152 MCU. SB3 (BOOT0) SB19 (BOOT1) (2) SB17 (MCO) 1. Default SBx state is shown in bold. 2. SB17 and SB20 are OFF to allow the user to choose between MCO and X3 crystal for clock source. DocID018789 Rev 3 25/39 Hardware and layout 4.9 UM1079 LCD (24 segments, 4 commons) This LCD allows the STM32L152 to display any information on six 14-segment digits and 4 bars, using all COMs. (See the LCD segment mapping in Figure 18 and pin connections in Table 7.) Note: This LCD also supports six 8-segment digits by only using COM0 and COM1. This configuration allows COM2 and COM3 to be used as I/O ports. In this case the 2 LCD pins must not be plugged into the LCD socket. To proceed with this configuration, remove the LCD carefully, slightly open the COM2 and COM3 pins (pin 13 and pin 14) of the LCD, then replug it in the socket. Characteristics overview: Note: • 24 segments and 4 commons • Drive method: multiplexed 1/4 duty, 1/3 bias • Operating voltage: 3 V • Operating temperature: 0 to 50°C • Connector: 28-pin DIL 2.54 mm pitch When the LCD is plugged, all I/O ports listed in Table 7 are unavailable. To use one of these as I/O, you must remove the LCD. Figure 13. LCD segment mapping 26/39 DocID018789 Rev 3 UM1079 Hardware and layout Table 7. LCD connections STM32L152 LCD Name Pin COM3 COM2 COM1 COM0 Name PA1 1 1N 1P 1D 1E LCDSEG0 PA2 2 1DP 1COLON 1C 1M LCDSEG1 PA3 3 2N 2P 2D 2E LCDSEG2 PB3 4 2DP 2COLON 2C 2M LCDSEG3 PB4 5 3N 3P 3D 3E LCDSEG4 PB5 6 3DP 3COLON 3C 3M LCDSEG5 PB10 7 4N 4P 4D 4E LCDSEG6 PB11 8 4DP 4COLON 4C 4M LCDSEG7 PB12 9 5N 5P 5D 5E LCDSEG8 PB13 10 BAR2 BAR3 5C 5M LCDSEG9 PB14 11 6N 6P 6D 6E LCDSEG10 PB15 12 BAR0 BAR1 6C 6M LCDSEG11 PB9 13 COM3 PA10 14 PA9 15 PA8 16 PA15 17 6J 6K PB8 18 6H PC0 19 PC1 LCDCOM3 COM2 LCDCOM2 COM1 LCDCOM1 COM0 LCDCOM0 6A 6B LCDSEG12 6Q 6F 6G LCDSEG13 5J 5K 5A 5B LCDSEG14 20 5H 5Q 5F 5G LCDSEG15 PC2 21 4J 4K 4A 4B LCDSEG16 PC3 22 4H 4Q 4F 4G LCDSEG17 PC6 23 3J 3K 3A 3B LCDSEG18 PC7 24 3H 3Q 3F 3G LCDSEG19 PC8 25 2J 2K 2A 2B LCDSEG20 PC9 26 2H 2Q 2F 2G LCDSEG21 PC10 27 1J 1K 1A 1B LCDSEG22 PC11 28 1H 1Q 1F 1G LCDSEG23 DocID018789 Rev 3 27/39 Extension connectors 5 UM1079 Extension connectors The male headers P1 and P2 can connect the STM32L1 discovery to a standard prototyping/wrapping board. STM32L152 GPI/Os are available on these connectors. P1 and P2 can also be probed by an oscilloscope, logical analyzer or voltmeter. Table 8. MCU pin description versus board function MCU pin Board function Main function Alternate functions LQFP 64 pin num. - - - - - BOOT0 - 60 NRST - 7 PA0 WKUP1/USART2_CTS/ ADC_IN0/TIM2_CH1_ETR /COMP1_INP 14 PA1 USART2_RTS/ADC_IN1/ TIM2_CH2/LCD_SEG0/ COMP1_INP 15 SEG0 16 PA2 USART2_TX/ADC_IN2/ TIM2_CH3/TIM9_CH1/ LCD_SEG1/COMP1_INP 16 SEG1 17 PA3 USART2_RX/ADC_IN3/ TIM2_CH4/TIM9_CH2/ LCD_SEG2/COMP1_INP 17 SEG2 18 PA4 SPI1_NSS/USART2_CK/ ADC_IN4/DAC_OUT1/ COMP1_INP 20 PA5 SPI1_SCK/ADC_IN5/ DAC_OUT2/ TIM2_CH1_ETR/COMP1_ INP 21 PA6 SPI1_MISO/ADC_IN6/ TIM3_CH1/TIM1_BKIN/ LCD_SEG3/TIM10_CH1/ COMP1_INP 22 PA6 PA7 SPI1_MOSI/ADC_IN7/ TIM3_CH2/TIM1_CH1N /LCD_SEG4/TIM11_CH1/ COMP1_INP 23 PA7 PA8 USART1_CK/MCO/ LCD_COM0 41 COM0 23 PA9 USART1_TX/LCD_COM1 42 COM1 22 PA10 USART1_RX/LCD_COM2 43 COM2 21 PA11 USART1_CTS/USBDM/ SPI1_MISO 44 X 20 PA12 USART1_RTS/USBDP/ SPI1_MOSI 45 X 19 JTMS/ SWDIO PA13 46 28/39 LCD glass Linear Touch Sensor Push button IDD LED SWD OSC Free I/O Power supply P1 EXT_ 3V 1 EXT_ 5V P2 1 6 NRST PA0 10 WAKE UP 15 Measure ment 19 X SWD IO DocID018789 Rev 3 20 18 UM1079 Extension connectors Table 8. MCU pin description versus board function (continued) MCU pin Board function Main function Alternate functions LQFP 64 pin num. JTCK/ SWCLK PA14 49 JTDI TIM2_CH1_ETR/PA15/ SPI1_NSS/LCD_SEG17 50 PB0 ADC_IN8/TIM3_CH3/ LCD_SEG5/COMP1_INP/ VREF_OUT 26 PB0 PB1 ADC_IN9/TIM3_CH4/ LCD_SEG6/COMP1_INP/ VREF_OUT 27 PB1 PB2/BOOT1 - 28 JTDO TIM2_CH2/PB3/TRACES WO/SPI1_SCK/COMP2_I NM/LCD_SEG7 55 SEG3 JNTRST TIM3_CH1/PB4/SPI1_MIS O/COMP2_INP/LCD_SEG 8 56 SEG4 10 PB5 I2C1_SMBAl/TIM3_CH2/ SPI1_MOSI/COMP2_INP/ LCD_SEG9 57 SEG5 9 PB6 I2C1_SCL/TIM4_CH1/ USART1_TX/LCD_SEG8 58 Blue 8 PB7 I2C1_SDA/TIM4_CH2/ USART1_RX/PVD_IN 59 Green 7 PB8 TIM4_CH3/I2C1_SCL/ LCD_SEG16/TIM10_CH1 61 SEG13 4 PB9 TIM4_CH4/I2C1_SDA/ LCD_COM3/TIM11_CH1 62 COM3 3 PB10 I2C2_SCL/USART3_TX/ TIM2_CH3/LCD_SEG10 29 SEG6 22 PB11 I2C2_SDA/USART3_RX/ TIM2_CH4/LCD_SEG11 30 SEG7 23 PB12 SPI2_NSS/I2C2_SMBA/ USART3_CK/LCD_SEG1 2/ADC_IN18/COMP1_INP / TIM10_CH1 33 SEG8 24 PB13 SPI2_SCK/USART3_CTS/ LCD_SEG13/ADC_IN19/ COMP1_INP/TIM9_CH1 34 SEG9 25 PB14 SPI2_MISO/USART3_RT S/LCD_SEG14/ADC_IN20 / COMP1_INP/TIM9_CH2 35 SEG10 26 PB15 SPI2_MOSI/TIM1_CH3N/ LCD_SEG15/ADC_IN21/ COMP1_INP/TIM11_CH1/ RTC_50_60Hz 36 SEG11 27 PC0 ADC_IN10/LCD_SEG18/ COMP1_INP 8 SEG14 11 PC1 ADC_IN11/LCD_SEG19/ COMP1_INP 9 SEG15 12 PC2 ADC_IN12/LCD_SEG20/ COMP1_INP 10 SEG16 13 LCD glass Linear Touch Sensor Push button IDD LED SWD OSC Free I/O Power supply P1 SW CLK P2 17 SEG12 16 21 SWO DocID018789 Rev 3 11 29/39 Extension connectors UM1079 Table 8. MCU pin description versus board function (continued) MCU pin Board function Main function Alternate functions LQFP 64 pin num. LCD glass PC3 ADC_IN13/LCD_SEG21/ COMP1_INP 11 SEG17 PC4 ADC_IN14/LCD_SEG22/ COMP1_INP 24 PC4 PC5 ADC_IN15/LCD_SEG23/ COMP1_INP 25 PC5 PC6 TIM3_CH1/LCD_SEG24 37 SEG18 27 PC7 TIM3_CH2/LCD_SEG25 38 SEG19 26 PC8 TIM3_CH3/LCD_SEG26 39 SEG20 25 PC9 TIM3_CH4/LCD_SEG27 40 SEG21 24 PC10 USART3_TX/LCD_SEG28 /LCD_SEG40/LCD_COM4 51 SEG22 15 PC11 USART3_RX/LCD_SEG2 9/LCD_SEG41/ LCD_COM5 52 SEG23 14 PC12 USART3_CK/LCD_SEG3 0/LCD_SEG42/ LCD_COM6 53 PC13 RTC_AF1/WKUP2 2 PC14 OSC32_IN 3 OSC32 _IN 5 PC15 OSC32_OUT 4 OSC32 _OUT 6 PD2 TIM3_ETR/LCD_SEG31/ LCD_SEG43/LCD_COM7 54 OSC_IN PH0 5 OSC_ IN 7 OSC_OUT PH1 6 OSC_ OUT 8 - - - GND 2 2 - - - GND 9 5 - - - GND 28 28 - - - VDD 3 30/39 Linear Touch Sensor Push button IDD LED SWD OSC Free I/O Power supply P1 P2 14 X 13 CNT_ EN 4 X DocID018789 Rev 3 12 UM1079 6 Mechanical drawing Mechanical drawing Figure 14. STM32L1 discovery XXXTUDPNTUNMDEJDPWFSZ .#$ -36 DocID018789 Rev 3 31/39 Electrical schematics UM1079 7 Figure 15. STM32L1 discovery 2 IDD_measurement.SchDoc U_Power PC13 PA0 PA4 ST_LINK.SCHDOC U_ST_L INK MCO PA14 PA13 EXT_5V EXT_3V NRST PB3 MCO PA14 PA13 EXT_5V EXT_3V NRST PB3 PC13 PA0 PA4 TCK/SWCL K TMS/SWDIO DocID018789 Rev 3 PC13 PC12 PA4 PA0 B P1 C 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 EXT_3V PC13 PC14 PC15 PH0 PH1 NRST PC0 PC1 PC2 PC3 PA0 PA1 PA2 PA3 PA4 PA5 PB2 PB10 PB11 PB12 PB13 PB14 PB15 VDD PA6 PA7 PB0 PB1 PC4 PC5 PA5 PA11 PA12 PB2 PB6 PB7 PC14 PC15 PD2 PH0 PH1 BOOT0 MCO NRST Header 28 6,#$ 0#7+50 0#/3#?). 0#/3#?/54 0(/3#?). 0(/3#?/54 .234 0# 0# 0# 0# 633! 6$$! 0!7+50 0! 0! T_NRS T T_SWO U_STM32L STM32 L.Sch Doc PA14 PA13 U_LCD_GH08172 LCD_GH0817 2.SchDoc PA14 PA13 PC13 PC12 PA4 PA8 PA9 PA10 PB9 PA0 PA1 PA2 PA3 PB3 PB4 PB5 PB10 PB11 PB12 PB13 PB14 PB15 PB8 PA15 PC0 PC1 PC2 PC3 PC6 PC7 PC8 PC9 PC10 PC11 PA6 PA7 PB0 PB1 PC4 PC5 PA5 PA11 PA12 PB2 PB6 PB7 PC14 PC15 PD2 PH0 PH1 PA8 PA9 PA10 PB9 COM0 COM1 COM2 COM3 PA1 PA2 PA3 PB3 PB4 PB5 PB10 PB11 PB12 PB13 PB14 PB15 PB8 PA15 PC0 PC1 PC2 PC3 PC6 PC7 PC8 PC9 PC10 PC11 SEG0 SEG1 SEG2 SEG7 SEG8 SEG9 SEG10 SEG11 SEG12 SEG13 SEG14 SEG15 SEG16 SEG17 SEG18 SEG19 SEG20 SEG21 SEG24 SEG25 SEG26 SEG27 SEG28 SEG29 PA8 PA9 PA10 PB9 PA1 PA2 PA3 PB3 PB4 PB5 PB10 PB11 PB12 PB13 PB14 PB15 PB8 PA15 PC0 PC1 PC2 PC3 PC6 PC7 PC8 PC9 PC10 PC11 EXT_5V PB9 PB8 BOOT0 PB7 PB6 PB5 PB4 PB3 PD2 PC12 PC11 PC10 PA15 PA14 PA13 PA12 PA11 PA10 PA9 PA8 PC9 PC8 PC7 PC6 BOOT0 MCO NRST PA0 NRST PB0 PB1 PA0 PC4 PC5 2 A B 1 2 3 4 5 6 7 8 9 10 11 12 13 14 -3XXXXX6Y 15 16 17 18 19 20 21 22 23 24 25 26 27 28 C Header 28 Rev C.1: - Silkscreen upda t e for the web site: "www.st.com/stm32l152c-discovery" - MCU replacement by STM32L152RCT 6 PA6 PA7 PB0 PB1 D STMicroelectronics PC4 PC5 Ti tle: STM3L-DISCOVERY Number:MB963 1 6$$? 633? 0! 0! 0! 0! 0! 0! 0# 0# 0# 0# 0" 0" 0" 0" 3 Rev: C.1(PC B .SCH) Date:2/15/2013 Sheet 1 of 6 4 32/39 -36 Electrical schematics D PA6 PA7 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 1 47 2 46 3 45 4 44 5 43 6 42 7 41 8 ,1&0 40 9 39 10 38 11 37 12 36 13 35 14 34 15 33 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 P2 U_SLIDER_PB SLI DER_PB.Sc hDoc NRST 4 0! 633? 6$$? 0! 0! 0! 0! 0# 0# 0" 0" 0" 0" 0" 633? 6$$? IDD_CNT_EN IDD_WAKEUP IDD_Measurement A 3 6$$? 633? 0" 0" "//4 0" 0" 0" 0" 0" 0$ 0# 0# 0# 0! 0! 1 1 2 3 4 TCK/SWCL K TMS/SWDIO PA14 PA13 NRST PB3 T_NRST SW IM_IN SW IM 8MHz R17 100K OSC_ IN OSC_OUT STM_RST B DocID018789 Rev 3 C11 100nF 3V R16 4K7 R15 4K7 100 VBAT PC13 PC14 PC15 OSCIN OSCOUT NRST VSSA VDDA PA0 PA1 PA2 VDD_2 VSS_2 JTMS/SW DIO PA12 PA11 PA10 PA9 PA8 PB15 PB14 PB13 PB12 36 35 34 33 32 31 30 29 28 27 26 25 3V R14 SB6 SB9 SB8 22 R102 SB11 SB10 SB13 SB12 T_NRST 22 R103 T_S WO D5 D3 D6 Z5V1 D4 Z5V1 B Ju mpers ON -- > DI SCOVERY Se l ected Ju mpers OFF --> ST-LINK Selected R100 100 3V VDD SB21 LD1 3V R12 1K 2 3 3V VDD VBAT COM 2 R2 3 5V BAT60JFILM 3V U1 Wired on Solde r Side Vin 3 INH C1 GND 1μF_X5R_0603 C2 100nF JP3 C D2 BAT6 0JFILM LD398 5M33R 5 Vout BYP ASS 4 U5V 1K5 10 USB_DM 10 USB_DP 100K 3V LD_BI COLOR_CMS 2 VCC DD+ ID GND SHEL L R8 R10 R9 R7 R1 _Gr een Not Fitted 1 4 0 100 5V D1 1 100 SB22 JP2 CR1 CR203 2 Holder Red R3 PWR U5V SWDIO Z5V1 LED_STLINK 1 2 3 4 5 0 STM_ JTMS CN3 Z5V1 LD2 RED CN1 SWCL K T_S WDIO_ IN C EXT_5V STM_JTCK 22 MCO T_JTMS T_JTCK 3V SB7 T_JTMS Header 6 STM_JTMS USB_DP USB_DM T_S WO LED_STLINK MCO A T_JTCK 22 1 SW IM_IN SWIM T_JRST T_JTCK T_JTDO T_JTDI T_NRST R13 1 2 3 4 5 6 U2 STM32F103C8T6 13 14 15 16 17 18 19 20 21 22 23 24 SB102 AIN_1 1 2 3 4 5 6 7 8 9 10 11 12 AIN_1 1 2 3 4 C8 20pF 2 R101 BAT6 0JFILM 48 47 46 45 44 43 42 41 40 39 38 37 3V C9 20pF X1 3V 1 D7 CN2 VDD_3 VSS_3 PB9 PB8 BOOT0 PB7 PB6 PB5 PB4/JN TRST PB3/JTDO PA15/JTDI JTCK/SWC LK Not Fitted R11 10K SWD SWD RESERVED 100K SB101 DEFAULT 10K Board Ident: PC13=0 T_SWO Not Fitted STM_JTCK R4 R6 SW IM_IN SW IM_RST SWIM_RST_ IN 10K PA3 PA4 PA5 PA6 PA7 PB0 PB1 PB2 /BOOT1 PB10 PB11 VSS_1 VDD_1 A R5 SB100 Electrical schematics 33/39 Figure 16. ST-LINK/V2 (SWD only) 3V C3 1μF_X5R_0603 C5 10nF_X7R_0603 EXT_3V C4 100nF 3V 5075BMR-05-SM C6 100nF D USB C7 100nF C12 100nF C10 100nF JP4 Ti tle: STM32L--DISCOVERYST-LINK/V2(SWD only) Number:MB963 2 3 Rev: C.1(PC B .SCH) Date:2/12/2013 Sheet 2 of 6 4 -36 UM1079 1 D STMicroelectronics 1 2 3 UM1079 Figure 17. 32L152CDISCOVERY MCU 4 X2 MC306-G-06Q-32.768 (manufacturer JFVNY ) C16 6.8pF A PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 PB8 PB9 PB10 PB11 PB12 PB13 PB14 PB15 26 27 28 55 56 57 58 59 61 62 29 30 33 34 35 36 C C17 6.8pF Must be close to the Crystal PA0/WKUP1/USART2_ CTS/A DC_I N0/TI M2_CH1_ETR/COMP1_ I NP PC15-OSC32_OUT PA1/USA RT2_ RTS/A DC_I N1/TIM2_CH2/LCD_SEG0/COMP1_I NP PC14-OSC32_I N PA2/USA RT2_ TX/A DC_IN2/TI M2_CH3/TI M9_CH1/ LCD_SEG1 / COMP1 _INP PC13 PA3/USA RT2_ RX/A DC_I N3/TI M2_CH4/ TI M9_CH2/LCD_SEG2/COMP1_ I NP PC12/USART3_CK/LCD_SEG30/LCD_SEG42 / LCD_COM6 PA4/SPI1_NSS/USART2_ CK/A DC_I N4/DAC_OUT1 / COMP 1_INP PC11/USART3_RX/LCD_SEG29/LCD_SEG41 / LCD_COM5 PA5/SPI1_SCK/A DC_IN5/DA C_OUT2/TIM2_CH1_ETR/COMP1_ I NP PC10/USART3_TX / LCD_S EG2 8/LCD_SEG40/LCD_COM 4 PA6/SPI1_MI SO/A DC_I N6/TI M3_CH1/ TI M1_BKI N/LCD_SEG3 / TI M10_CH1/COMP1_ I NP PC9/TI M3_CH4/LCD_SEG27 PA7/SPI1_MOSI /ADC_I N7/TI M3_CH2/ TI M1_CH1N/LCD_SEG4/T I M11_CH1/COMP1_I NP PC8/TI M3_CH3/LCD_SEG26 PA8/USA RT1_ CK/MCO/LCD_COM0 PC7/TI M3_CH2/LCD_SEG25 PA9/USA RT1_ TX/LCD_COM1 PC6/TI M3_CH1/LCD_SEG24 PA10/USART1 _RX/ LCD_COM2 PC5/A DC_I N15/LCD_SEG23/COMP1_I NP PA11/USART1 _CTS/USBDM/SPI1_MISO PC4/A DC_I N14/LCD_SEG22/COMP1_I NP PA12/USART1 _RTS/USBDP /S PI1_MOSI PC3 PA13/SWDIO PC2 PA14/SWCLK PC1 PA15/TIM2_CH1_ETR/P A 15/SPI1_NSS/LCD_SEG17 PC0 PB0/A DC_I N8/TI M3_CH3/LCD_SEG5/COMP1_ I NP/VREF_OUT PB1/A DC_I N9/TI M3_CH4/LCD_SEG6/COMP1_ I NP/VREF_OUT PB2/ BOOT1 PD2/TI M3_ETR/L CD_SEG31/LCD_SEG43/LCD_COM7 PB3/ TI M2_CH2/PB3/TRA CESWOSPI 1 _SCK/COMP2_ I NM/LCD_S EG7 PB4/ TI M3_CH1/PB4/SPI1_MI SO/COMP2_INP/LCD_SEG8 PB5/I 2C1_SMBA l /TIM3_CH2/SPI1_MOSI /COMP2_INP/LCD_SEG9 PB6/I 2C1_SCL/T I M4_CH1/US A RT 1_TX PB7/I 2C1_SD A /TIM4_CH2/ USA RT1_RX/PVD_I N PH0-OSC_IN PB8/ TI M4_CH3/I 2C1_SCL/LCD_SEG16/T I M10_CH1 PH1-OSC_OUT PB9/ TI M4_CH4/I 2C1_SDA/ LCD_COM3/T I M11_CH1 PB10/I2C2_SCL/US A RT3_ TX/TI M2_CH3/LCD_SEG10 NRST PB11/I2C2_SDA/USA RT3_RX/T I M2_CH4/LCD_SEG11 PB12/SPI2_NSS/I2 C2_SMBA/USA RT3_CK/LCD_ S EG1 2/ADC_IN18/COMP1_I NP/TI M10_CH1 PB13/SPI2_SCK/USA RT3_CTS/LCD_ S EG1 3/ADC_IN19/COMP1_I NP/TI M9_CH1 PB14/SPI2_MI SO/USART3 _RTS/LCD_SEG14/ A DC_I N20/COMP1_INP/TI M9_CH2 PB15/SPI2_MOSI /TIM1_CH3N/LCD_S EG1 5/ADC_IN21/COMP1_I NP/TI M11_CH1/RTC _ 50_60Hz BOOT0 4 3 2 53 52 51 40 39 38 37 25 24 11 10 9 8 PC13 PC12 PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 54 PD2 PC15 PC14 SB16 LD3 R39 PB7 330 Green LD4 R40 PB6 660 Bl ue B Not Fitted PD2 5 6 PH0-OSC_IN PH1-OSC_OUT 7 NRST C21 20pF R30 220 SB20 R26 60 X3 8MHz C22 20pF NRST BOOT0 PH1 SB18 510 PH0 MCO MCO SB17 C STM32 L152RCT 6 R27 10K BOOT0 SB3 Must be close to the Crystal BOOT0 U8B fcm1608-0603 BOOT1 VDD R32 10K PB2 13 C26 1uF C24 100nF L1 32 48 64 19 VDD_MCU 1 R31 510 C25 100nF C18 100nF C23 100nF R29 0 VDD VDDA VSSA VDD_1 VDD_2 VDD_3 VDD_4 VSS_1 VSS_2 VSS_3 VSS_4 12 31 47 63 18 VLCD STM32 L152RCT 6 C20 100nF C19 1uF D STMicroelectronics SB19 Ti tle: STM32L-DISCOVERY MCU Number:MB963 1 2 3 Rev: C.1(PC B .SCH) Date:2/15/2013 Sheet 3 of 6 4 -36 34/39 Electrical schematics D A PC15 PC14 SB15 PC13 PC12 PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 2 DocID018789 Rev 3 PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 PB8 PB9 PB10 PB11 PB12 PB13 PB14 PB15 14 15 16 17 20 21 22 23 41 42 43 44 45 46 49 50 1 1 B PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PA8 PA9 PA10 PA11 PA12 PA13 PA14 PA15 2 4 R28 0 U8A PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PA8 PA9 PA10 PA11 PA12 PA13 PA14 PA15 3 1 2 3 4 A A LCD PC3 PC2 PC6 PC1 PC7 PC0 PC8 PB8 PC9 PC10 PC11 PA15 PA8 15 COM1 B COM2 16 COM0 U4 GH08172T 14 SEG12 SEG11 COM3 13 18 19 20 21 17 12 SEG13 SEG10 11 SEG14 SEG9 10 SEG15 SEG16 SEG7 SEG8 9 8 23 22 SEG17 SEG6 7 24 SEG19 SEG18 SEG5 SEG4 5 6 26 28 25 SEG20 SEG21 SEG3 SEG2 4 3 SEG22 SEG23 SEG0 SEG1 2 DocID018789 Rev 3 1 27 PA9 B PA1 PA10 PA2 C PA3 PB3 PB4 PB5 PB10 PB9 PB15 PB14 PB13 PB12 PB11 C D D STMicroelectronics Ti tle: STM32L-DISCOVERY LCD Number:MB963 1 Electrical schematics 35/39 Figure 18. STM32L1 discovery LCD 2 3 Rev: C.1(PC B .SCH) Date:2/12/2013 Sheet 4 of 6 4 UM1079 -36 1 2 3 UM1079 Figure 19. STM32L1 discovery IDD measurement 4 A A IDD Measure VDD_MCU 1 2 on 3 1 off JP1 5 B R22 2(1%) 1K(1%) O/I VCC 3 C VDD S1 G1 S2 G2 PA0 SB1 D1 D1 D2 D2 8 7 6 5 C13 1uF VDD PA4 SB2 0 B VDD C14 100nF U3 IDD_WA KE UP 1 2 3 4 5 IDD_Measurement R19 10K U7 74LX1 G04CTR 2 DocID018789 Rev 3 5 VDD U20 R18 2 74H1G66STR 4 VDD R21 2 4 U5 MA X9938FEUK+ U6 3 1 I/O 4 C 3 GND R20 47K 1 2 3 4 5 6 7 8 Q12 Q13 Q14 Q6 Q5 Q7 Q4 GND VCC Q10 Q8 Q9 CLR CI CO CO M74HC4060TTR 16 15 14 13 12 11 10 9 VDD R25 10K IDD_CNT_EN PC13 SB14 C15 1nF R23 15K R24 30K C STS4DPF20L Oscillator frequency 30KHz D STMicroelectronics Ti tle: STM32L-DISCOVERY IDD_Measurement Number:MB963 1 2 3 Rev: C.1(PC B .SCH) Date:2/12/2013 Sheet 5 of 6 4 -36 36/39 Electrical schematics D 1 2 3 4 VDD Sli der 3 pos SLD_3 C30 PA0 PA7 PC4 PA6 PC5 GR P 2 GR P 9 GR P 3 USER & WAKE -UP Button PC5 PB1 C27 47nF R38 10K PC4 PA7 B C28 47nF 330 PB0 B PB1 C29 47nF R37 100K NRST NRST SB5 C31 C 100nF 3 2 DocID018789 Rev 3 VDD Not Fitted SLIDER 3 P ositions SW -PUSH -CMS B2 PA6 PB0 SB4 4 1 R34 10K R36 PA0 3 2 100nF R35 10K R33 10K A SW -PUSH -CMS B1 3 2 SLD_2 SLD_1 1 A 4 1 2 3 1 S1 Electrical schematics 37/39 Figure 20. STM32L1 discovery linear touch sensor/touchkeys C RES ET Button D D STMicroelectronics Ti tle: STM32L-DISCOVERY Linear Sensor and Push Button Number:MB963 1 2 3 Rev: C.1(PC B .SCH) Date:2/12/2013 Sheet 6 of 6 4 -36 UM1079 Revision history 8 UM1079 Revision history Table 9. Document revision history Date Revision 10-May-2011 1 Initial release. 24-June-2011 2 Added Chapter 6: Mechanical drawing. Modified Chapter 4.3: Power supply and power selection. 3 Added 32L152CDISCOVERY, related features. Updated STM32L-DISCOVERY url. Modified Section 2.2: System requirements, Section 2.5: Order codes, Section 4.1: STM32L152RBT6 or STM32L152RCT6 microcontroller, Section 4.2.1: Using the ST-LINK/V2 to program/debug the STM32L on board, and Section 4.2.2: Using the ST-LINK/V2 to program/debug an external STM32L application Updated Figure 1: STM32L1 discovery board, Figure 2: Hardware block diagram, Figure 3: Top layout, Figure 6: STM32L152RBT6 block diagram, Figure 13: LCD segment mapping and all schematics in Section 7. 19-Apr-2013 38/39 Changes DocID018789 Rev 3 UM1079 Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, 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 no liability 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 this document 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 products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third 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 IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. ST PRODUCTS ARE NOT AUTHORIZED FOR USE IN WEAPONS. NOR ARE ST PRODUCTS DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER’S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR “AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL” INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability 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. © 2013 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 DocID018789 Rev 3 39/39