UM1510 STMICROELECTRONICS | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 69
Technical content
Datasheet sections
- 1 Functional description
- 1.1 Power control
- 1.2 Clocking
- 1.3 Reset control
- 1.4 Debug JTAG interface
- 1.5 Serial wire debugger interface
- 1.6 Embedded ST -LINK
- 1.7 Display devices
- 1.7.1 LCD
- 1.7.2 LCD Glass
- 1.7.3 LEDs
- 1.8 Interfaces
- 1.8.1 RS232
- 1.9 IrDA
- 1.10 Miscellaneous peripherals
- 1.10.1 Joystick
- 1.10.2 Push-buttons
- 1.10.4 Audio
- 1.10.5 MicroSD card
- 1.10.6 Serial EEPROM
- 1.10.7 M24LR64 dual Interf ace EEPROM (RF/I²C)
- 1.10.8 SRAM
- 1.10.9 NOR Flash
- 1.10.10 Temperature sensor
- 1.10.11 STM32L152D-EVAL board jumper configuration
- 2 Running the demonstration
- 2.1 Menu
- 2.1.1 Demo startup
- 2.1.2 Navigation
- 2.2 Clock sources
- 2.2.1 Clock control
April 2012 Doc ID 022713 Rev 1 1/69 UM1510 User manual STM32L152D-EVAL demonstration firmware Introduction This user manual describes the demonstration firmware running on the STM32L152D-EVAL evaluation board, which can be used to evaluate the capabilities of the STM32L152ZD(T6) microcontroller and on-board peripherals. This demo contains many applications that can be easily reused, such as RTC calendar, file system FAT implementation on SD Card, Wave player with STM32 I2S peripheral, voice recording, automatic measure of the power consumption in several operating modes, Dual Interface EEPROM applications (ESL and DataLogger), temperature sensor interfacing and TFT LCD. The STM32L152D-EVAL board is delivered with the demonstration programmed in the internal Flash memory, and all the files needed by the demonstration are programmed in the MicroSD card. The demonstration is executed at each reset (board power-up, external reset, etc.). In case the STM32L152D-EVAL board was not factory-programmed or the demonstration application was erased, the Bootloader, IAP or USB DFU can be used to program this file. For more details, refer to Section 3: STM32L152D-EVAL demonstration package and Section 4: STM32L152D-EVAL demonstration programming. Note: Before you execute the demonstration, make sure that all EVAL board jumpers are well configured. For more details, refer to Section 1.10.11: STM32L152D-EVAL board jumper configuration. This demonstration firmware and other such firmware are available for download from the STMicroelectronics website: www.st.com.
1 Functional description
to try out the major functions of the STM32L152ZD(T6) microcontroller. Figure 1 summarizes the main functional blocks of the evaluation board. Figure 1. Evaluation board overview
1.1 Power control
UM1510 Functional description Doc ID 022713 Rev 1 7/69
1.2 Clocking
Two clock sources are available on the STM32L152D-EVAL evaluation board:
- 32 kHz crystal for embedded RTC and glass LCD
- 8 MHz crystal for the STM32L152ZD main clock system
1.3 Reset control
The reset can be generated by hardware or software:
- Reset button: activates the RESET input when pressed
- JTAG reset
1.4 Debug JTAG interface
Software debug is done via the standard ARM® JTAG connection: 20-pin IDC (insulation displacement connector) for connection to the standard ARM host interface.
1.5 Serial wire debugger interface
The Serial Wire Debug Port (SWD-DP) provides a 2-pin (clock + data) interface to the AHP- AP port.
1.6 Embedded ST-LINK
An embedded ST -LINK is integrated on the board as an embedded in-circuit debugger and programmer for the STM32L152ZD MCU.
1.7 Display devices
1.7.1 LCD
A color LCD module is mounted on the STM32L152D-EVAL board. It is interfaced through the embedded FSMC peripheral.
1.7.2 LCD Glass
An LCD Glass module is mounted on the STM32L152D-EVAL board. It is interfaced through the embedded LCD Glass peripheral.
1.7.3 LEDs
Four general-purpose LEDs are available. They are used as a display.
Functional description UM1510 8/69 Doc ID 022713 Rev 1
1.8 Interfaces
1.8.1 RS232
The STM32L152 evaluation board (STM32L152D-EVAL) provides one on-board RS-232 serial port. RS232 port (USART1) is accessed via CN1 connectors.
1.9 IrDA
The STM32L152D-EVAL evaluation board supports IrDA communication. The interface is mounted on USART1.
1.10 Miscellaneous peripherals
1.10.1 Joystick
Four-direction joystick with a selection key.
1.10.2 Push-buttons
The STM32L152D evaluation board (STM32L152D-EVAL) provides only one push-button (key). This key can be used as a user push-button, a tamper push-button or a wakeup push- button (to wake-up the processor from a low-power mode). 1.10.3 12-bit analog-to-di gital converter (ADC) Varistor: ADC channel (ADC1_IN18) connected to an on-board variable resistor. The variable resistor provides a voltage in the range of 0 V to 3.3 V.
1.10.4 Audio
The STM32L152D-EVAL evaluation board supports stereo audio play thanks to an audio DAC CS43L22 connected to both I2S2 ports, and one channel of DAC in microcontroller STM32L152ZD. For the audio output, an audio jack is available on the board and connected to the CS43L22 output. The U3 microphone is connected to ADC internal through OPAMP1.
1.10.5 MicroSD card
The STM32L152D-EVAL evaluation board has a MicroSD card connector connected to the SDIO peripheral.
1.10.6 Serial EEPROM
The STM32L152D-EVAL evaluation board includes a serial EEPROM connected to the SPI1 peripheral.
UM1510 Functional description Doc ID 022713 Rev 1 9/69
1.10.7 M24LR64 dual Inte rface EEPROM (RF/I²C)
The M24LR64 dual Interface EEPROM daughter board implemented on the module is the M24LR64-R. The daughter board can be connected on CN12 to STM32L152ZDT6 via I2C bus. I²C device Select of the M24LR64 is 1010 E2E1E0. For more details about the M24LR64 memory addressing in I²C mode, please refer to the M24LR64 datasheet.
1.10.8 SRAM
The STM32L152D-EVAL evaluation board includes a 512Kx16 SRAM connected to bank2 of FSMC interface.
1.10.9 NOR Flash
The STM32L152D-EVAL evaluation board provides a 128-Mbit of Nor Flash connected to bank1 of FSMC interface.
1.10.10 Temperature sensor
The STM32L152D-EVAL evaluation board includes an I2C temperature sensor connected to the I2C1 peripheral.
1.10.11 STM32L152D-EVAL boa rd jumper configuration
To be able to run the STM32L152D-EVAL demo correctly, configure the following STM32L152D-EVAL board jumpers as follows:
- JP1: fitted in PSU position
- JP2: fitted in LDR position
- JP4: fitted in RS232 position
- JP5: fitted in VDD position <->3.3 V
- JP6, JP8: fitted in position 1<->2
- JP7: fitted in position 1<->2
- JP10: fitted in IDD position
- JP14 I2C_SMB: fitted
- The LCD Glass should be in IO position.
Running the demonstration UM1510 10/69 Doc ID 022713 Rev 1
2 Running the demonstration
2.1 Menu
Figure 2 shows the menu system of the STM32L152D demonstration. The main menu is shown on the left-hand side. The UP , DOWN, RIGHT and LEFT joystick directions allow the user to navigate between items in the main menu and the submenus. To enter a submenu, press the SEL push-button. The SEL push-button designates the action of vertically pressing the top of the joystick, as opposed to moving it horizontally UP , DOWN, RIGHT or LEFT. To exit a submenu, select the Return menu and press SEL.
UM1510 Running the demonstration Doc ID 022713 Rev 1 11/69 Figure 2. Structure of the demonstration menus
Applications
EEPROM (RF/I2C) DataLogger Return ESL Voice Recording Player Return Record IDD RUN 1 MHz mode IDD RUN 32 MHz modeMain menu
2.1.1 Demo startup
shown in Figure 3. is displayed on the LCD screen. Figure 3. SD card check The demo continues only if an SD card is inserted. does not start and the message shown in Figure 4 is displayed on the LCD screen. Figure 4. Warning message displayed and the ST logo appears on the LCD (see Figure 5).
Figure 5. ST logo Then, after 1 second, an STM32 presentation slide is displayed on the LCD screen. Figure 6. STM32L presentation slide press SEL and follow the setting sequence. The message shown in Figure 7 appears on the LCD screen. Figure 7. Time and date configuration
2 If the time configuration has already been done, then the number of elapsed days (higher
screen. It is soon followed by the current date.
using the UP , DOWN, RIGHT and LEFT joystick directions to select the required submenu. corresponding to the selected icon is displayed. Figure 8. Main menu The icons shown in Figure 8 are taken from http://commons.wikimedia.org/wiki/Crystal_Clear. display and all the corresponding submenus are listed below, as shown in Figure 9. Figure 9. Corresponding submenus
2.1.2 Navigation
and back navigation, as described in Figure 10.
Figure 10. Navigating in the demonstration menus
- The UP , DOWN, RIGHT and LEFT push-buttons are used to perform circular navigation in the main menu and the current menu items.
- The SEL push-button selects the current item.
- The UP and DOWN push-buttons are used for vertical navigation in the submenus.
- To return to the upper menu, go to the Return line and press SEL. Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7 Item 8 Item 9 Item 10 Item 11 Item 12 Item 3 Item 3.1 Right Left Right Left Right Left Right Left Right Left Right Left Right Left Right Left Right Left Left Left Left Right Right Down Up Down Up Down Up Down Up Down Up Down Up Down Up Down Up Up Up Up Up Right Down Down Down Down Item 3.2 Item 3.n Return ... Item 3.1.1 Item 3.1.2 Item 3.1.n Return ... Select Select Select ai15162
Running the demonstration UM1510 16/69 Doc ID 022713 Rev 1
2.2 Clock sources
2.2.1 Clock control
The STM32L152ZD’s internal clocks are derived from the HSE (clocked by the external 8 MHz crystal). In this demo application, the various system clocks are configured as follows:
- System clock is set to 32 MHz: the PLL is used as the system clock source: 32 MHz (1 wait state, Flash memory prefetch buffer enabled).
- HCLK frequency is set to 32 MHz.
- Timer clock (TIMCLK) is set to 32 MHz.
- USB clock is set to 48 MHz.
- ADC clock is set to 16 MHz.
- PCLK1 is set to 32 MHz.
- PCLK2 is set to 32 MHz. Only the RTC is clocked by a 32 kHz external oscillator. Figure 11 illustrates the clock tree organization for this demo.
Figure 11. Clock tree diagram
32 MHz max
16 MHz
48 MHz USBCLK
48 MHz SDIOCLK
2.2.2 Clock failure
message shown in Figure 12 is displayed on the LCD screen. Figure 12. No HSE clock detected clock, if no clock is detected. Figure 13 is displayed on the LCD screen. Figure 13. Standby mode entered Note: The demo does not restart as long as the 8 MHz crystal is not present. must be connected before starting the demo.
UM1510 Running the demonstration Doc ID 022713 Rev 1 19/69
2.3 STM32L152ZD(T6) resources
2.3.1 Peripherals
All used peripherals are described in Table 1.
2.3.2 Interrupts
Table 2 shows all the enabled interrupts. Table 1. STM32L152ZD(T6) demo peripherals GPIO All applications + LEDs NVIC All applications using interrupts PWR IDD measure RCC All applications + Demo kernel RTC Calendar + Applications (StopWatch and Timer) FSMC Color LCD SysTick Generate 10 ms time base TIM2 LED toggling SDIO MicroSD TIM3 and TIM4 Voice recording ADC1 Voice recording + IDD measure SPI1 SPI Flash DAC LDR (define the comparator level) USB USB mass storage OPAMP3 Low pass filter for the Audio demo COMP LDR (Brightness level) Table 2. STM32L152ZD demo interrupts
2.3.3 External interrupts
Table 2. STM32L152ZD demo interrupts (continued) Table 3. STM32L152ZD demo external interrupts
2.3.4 Internal memory size
Figure 14. Internal Flash memory organization
2.3.5 External memory organization
- STFILES: this directory contains all the required demo media files (icons, waves and slides). User files located in this folder cannot be handled by demo; only default files are managed.
- USER: this is a user folder. The user can add his/her own files here to be played inside the demo menus (pictures and waves). This folder is used only by the Image Viewer and Wave Player submenus. For more details on the various files properties, please refer to Section 2.4.3: Image Viewer submenu and Section 2.4.4: Wave Player submenu.
- REC: this directory contains the voice recorded wave file “Rec_wave.wav“.(This Folder will be created when the Voice Recording application is run). Note: The STFILES directory and its internal files are mandatory for demo startup. FatFs is a generic FAT file system module for small embedded systems. The FatFs is written in compliance with ANSI C and completely separated from the disk I/O layer. For more details, refer to the following link: http://elm-chan.org/fsw/ff/00index_e.htmltml. EXTI line 17 RTC Alarm (interrupt mode, rising edge) EXTI line 20 RTC wake up (interrupt mode, rising edge) EXTI line 22 Comparator (interrupt mode, rising and falling edge)
Table 3. STM32L152ZD demo external interrupts (continued)
Figure 16. SD card removal
2.4 Demo applications
The following section provides a detailed description of each part of the demonstration. Note: In the demonstration, the core runs at HCLK = 32 MHz. depending on the core clock.
2.4.1 Product presentation
accompanied by its speech, and so on until the last slide. displayed on the LCD screen. Figure 17. Product presentation is ready to start
- Playing time: 6 min 16 s
- File number: 14 wave files
- File names: WAVE_Si (i designed the slide index)
- Format tag: PCM
- Channels: Stereo
- Sample rate: 8 kHz
- Bits per sample: 16 bits Note: If any wave files of the promotion presentation speech is not loaded in the dedicated memory, the message shown in Figure 20 is displayed on the LCD screen.
Figure 20. No loaded wave file message shown in Figure 21 is displayed. Figure 21. End of slide show joystick key to exit and return to the Product presentation submenu.
2.4.2 Calendar
interrupts, and a periodic programmable wakeup flag with interrupt capability.
Figure 24. Time Show submenu select the Return line and press the SEL push-button. This submenu is divided into two items that allow the user to display or set the current date.
- Date Adjust: select this item after each power-up in order to set the current date. If the time and date have not been configured before, a message is displayed, prompting the user to set the time and date or to exit to the upper submenu. The user is requested to set the current date to be stored in the application memory. The date is displayed as Y ear, Month, Week Nbr, Day Nbr (number of the day in the year) with the selected day shown in the month. There is no default date since the user has to set the date at least once. Once the submenu has been selected, the user starts by setting the year, then the month and the day of the selected month. The month and the year are selected using the UP or DOWN push-button. For the day, the UP , DOWN, RIGHT and LEFT push- buttons can be used. Press the UP push-button to display the current value plus one; press the DOWN push-button to display the previous value. To confirm the selected month, press the SEL push-button. The display then jumps to the year configuration. The same procedure is applicable for the year configuration. After configuring the day, press the SEL push-button to store the entered value and exit to the Date submenu. The current date value is then shown and you can change the setting if required. The messages shown in Figure 25, Figure 26 and Figure 27 are successively displayed on the LCD when this submenu is selected.
Figure 31. Message displayed if time and date need setting infinite loop on LCD Glass STM32L, Time and Date. resistor connected to COMP2.
2.4.3 Image Viewer submenu
embedded FSMC interface. The application is a successive display of stored images.
- Bit depth: 16 bits (RGB)
- Size: 240x320 Select Image Viewer to display the submenu shown in Figure 32.
Figure 32. Image Viewer submenu When Image Viewer is selected, a list box of images is displayed as shown in Figure 33.
Figure 33. STM32 Image Viewer Listbox stopped and the listbox shown in Figure 33 is displayed. submenu shown in Figure 32 is displayed. from the MicroSD card is 25 images, selected in alphabetic order.
2.4.4 Wave Player submenu
CS43L22 connected to I2S2 port and controlled by I2C1 interface. Figure 34. Audio Playback architecture
Figure 37. Wave Player Now Playing submenu volume value is updated each time the volume level is changed.
- Press the SEL push-button to pause/play the audio stream.
- Press the LEFT push-button to stop the audio stream.
- Press the RIGHT push-button to exit the audio stream.
- Press the DOWN push-button to decrease the volume level.
- Press the UP push-button to increase the volume level. When the audio stream is finished or the RIGHT push-button is pressed, the menu in Figure 36 is displayed. If the RIGHT push-button is pressed, the Wave Player is stopped and the submenu shown in Figure 35 is displayed. Note: The audio files provided within this package are based on a free music download from www.DanoSongs.com website.
2.4.5 Voice Recording
OPAMP1 acts as a low pass filter.
Figure 40. Starting voice record The recorded wave file properties are displayed on the right side of the submenu.
2.4.6 IDD Measure
Internal VREF measurement. This value is used to compute the IDD current. in Figure 41 is then displayed on the LCD screen.
Figure 61. Reset Bias Value (Procedure Start) submenu submenu and the message shown in Figure 56 is displayed on the LCD screen.
2.4.7 Thermometer
Figure 62. Thermometer submenu selected temperature value is displayed in Celsius and Fahrenheit, as shown in Figure 63. Press any key to return to the Thermometer submenu.
Figure 65. Temperature sensor error
2.4.8 USB Mass Storage Submenu
a full-speed interface to a USB host PC. with the PC and to run the mass storage demo using an MSD card. Figure 66. USB Mass Storage submenu appears on the LCD screen until the cable is plugged in.
Figure 67. USB Mass Storage submenu selected push-button, the message shown in Figure 68 is displayed on the LCD. Figure 68. USB cable connected STM32L152-EVAL board. The user can transfer files between the MSD and the PC.
2.4.9 Dual interfac e EEPROM (RF/I²C)
Figure 73. ESL setting menu that a special price is proposed. Check the blank logo if no special price is applied. or decreased, or the blank arrow if no indication is required. Price: Display the product price. Ascii Text Line 1 and Line 2: Display the name and a brief description of the product. parameters in RF mode using the CR95HF RFID reader/writer demo board. written into the M24LR64 is displayed in the ESL panel of the PC ESL demo application. Note: For more details about this PC Software, please refer to user manual UM0853. M24LR64 memory organization (ESL application).
Figure 74. DataLogger block diagram Table 4. M24LR64 memory organization (ESL application)
microcontroller in I²C mode and displayed on the STM32L252 eval board LCD screen. reader/writer demo board and be displayed in the PC DataLogger software application. “Developing your M24LR64-R datalogger application for temperature acquisition“.
- From the STM32L125D evaluation board, select the DataLogger submenu and then
Figure 75. DataLogger dialog box
- From the application software side, choose “DataLogger“ application and then follow
the steps described on the user manual, UM0925. the evaluation board and also on the PC software interface.
Figure 76. DataLogger curve and documentation, visit the dual interface EEPPROM page on www.st.com. documentation and associated resources, visit the CR95HF web page on www.st.com.
2.4.10 Applications
used for many applications, such as StopWatch and Timer. Select Applications to display the submenu shown in Figure 77.
Running the demonstration UM1510 58/69 Doc ID 022713 Rev 1 Timer application This application simulates a precise Hourglass. It measures the passage of a few time units (sub-seconds, seconds or minutes). For this application, an interactive human interface has been developed using STM32L152D_EVAL ’s LCD and push-buttons to allow the user to use StopWatch with real-time display. After startup, the Hourglass is full and the default timer is one minute. Using the UP and DOWN push-buttons, the user can change the Timer duration (the timer duration must be higher than 13 seconds). Figure 79. Timer submenu
- press the joystick RIGHT button to start the timer.
- press again the joystick RIGHT button to stop the timer.
- press the joystick LEFT button to reset the timer.
- press the joystick UP/DOWN button to adjust the timer (UP and DOWN are only used when the Timer is reset). LDR application The STM32L152ZD(T6) microcontroller has an embedded comparator which can be used in combination with the DAC peripheral for more applications, such as the measuring of light intensity (using the LDR sensor). When the LDR submenu is selected, the message shown in Figure 80 is displayed. StopWatch
Figure 80. Light Intensity Level According to the light intensity level, the icons are changed and also the progress bar.
2.4.11 Help
Figure 81 is then displayed on the LCD screen. Figure 81. Help menu
- If Menu Navigation submenu is selected, the message shown in Figure 82 is displayed. Menu Navigation Return Jumpers Config Help
Figure 88. Jumpers config menu-5 submenu and the message shown in Figure 81 is displayed on the LCD screen.
2.4.12 About submenu
submenu is selected, the message shown in Figure 89 is displayed on the LCD screen. Figure 89. About submenu improvement procedure in the user manual.
3 STM32L152D-EVAL demonstration package
subfolders shown in Figure 90 and described below. Figure 90. STM32L152D-EVAL demo package directory tree
UM1510 STM32L152D-EVAL demonstration package Doc ID 022713 Rev 1 65/69 1. Libraries: contains all the subdirectories and files that make up the core of the STM32L1xx Standard Peripheral library V1.0.0: CMSIS – CM3\\CoreSupport: contains the Cortex-M3 files – CM3\\DeviceSupport\\ST\\STM32L15x: contains the STM32L1xx CMSIS layer files STM32L1xx_Stdperiph_Driver – inc subfolder contains the Standard Peripheral library header files – src subfolder contains the Standard Peripheral library source files STM32_USB-FS-Device_Driver – inc subfolder contains the USB Full Speed Peripheral library header files – src subfolder contains the USB Full Speed Peripheral library source files 2. Project STM32L152D-EVAL – Binary: contains the binary image of the demonstration that can be used to program the binary image to the internal Flash memory using IAP , plus the media files required to run the demo (Binary\\Media) – EWARM: contains preconfigured projects for the EWARM toolchain – MDK-ARM: contains preconfigured pr ojects for the MDK-ARM toolchain – RIDE: contains preconfigured projects for the RIDE toolchain – TrueSTUDIO: contains preconfigured projects for the Atollic toolchain – HiTOP: contains preconfigured projects for the HiTOP toolchain – inc: contains the Demo header files – src: contains the Demo source files 3. Utilities – STM32L152-EVAL: contains the LCD, and other STM32L152D-EVAL board- related drivers
4 STM32L152D-EVAL demonstration programming
4.1 Programming the media files
Figure 91. SD Card directory organization the content of the Binary\\Media folder to his/her own SD memory.
4.2 Programming the demo
Y ou can program the demonstration using four methods.
4.2.1 Using Bootloader
application note AN2606 STM32™ microcontroller system memory boot mode .
4.2.2 Using IAP
IAP application note AN3310 STM32L1xx in-application programming using the USART.
UM1510 STM32L152D-EVAL demonstration programming Doc ID 022713 Rev 1 67/69
4.2.3 Using USB DFU
To program the demonstration's binary image into the internal Flash memory, you have to use the stm32l152d-eval_fw_v1.0.0.dfu file located under Project\\STM32L152D- EVAL\\Binary with USB DFU. For more details, please refer to user manual UM0424 STM32 USB-FS-Device development kit.
4.2.4 Using preconfigured projects
■ Select the folder corresponding to your preferred toolchain (MDK-ARM, EWARM, RIDE, TASKING or TrueSTUDIO). ■ Open the STM32L152D_EVAL project and rebuild all sources. ■ Load the project image through your debugger. ■ Restart the evaluation board (press B1: reset button).
5 Revision history
Table 5. Document revision history 02-Apr-2012 1 Initial release.