ST STM8L1528-EVAL User Manual Download Page 19

UM1000

Demonstration applications

Doc ID 17964 Rev 1

19/23

3.8.3 Wave 

player 

demo

The STM8L15x microcontroller has an embedded DAC which can be used to generate 
output signals. 

In this demo, any wave file stored under the USER folder in the microSD card can be 
opened using the file system PetitFatFS and transferred to the internal RAM by block (512 
bytes) using the DMA and the SPI interface. Timer 4 (TIM4) triggers the DAC to generate 
the wave signal. The voice sampling period is read from the Wave File Header. An audio 
amplifier is connected to the DAC interface to play the stored wave files. This demo reads all 
wave files from “USER” directory and displays only the .WAV files having the following 
format:

Audio Format: PCM (an uncompressed wave data format in which each value
represents the amplitude of the signal at the time of sampling.)

Sample rate: may be 8000, 11025, 22050 or 44100 Hz.

Bits Per Sample: 8-bit (Audio sample data values are in the range [0-255]).

Number of Channels: 1 (Mono)

The maximum wave files number that can be read from the microSD card is 3 files selected 
by alphabetic order.

When the Stored wave is selected from the Audio Player submenu by pressing the 

SEL 

on 

the joystick, The following message remains displayed unless 

SEL

 is pressed.

Figure 44.

Stored wave message

When 

SEL

 is pressed, the system checks if an SD card memory is available in the 

connector CN15. If there is no card detected, the Stored Wave demo will not start and the 
message shown in 

Figure 45

 is displayed on the LCD for two seconds then the Audio Player 

submenu is 

displayed again

.

Figure 45.

Stored wave message

Otherwise, if SD card is detected in the connector CN15 the available wave interface is 
displayed as shown in 

Figure 46

.

Figure 46.

Available wave message

Audio Player

Stored Wave

SD Card Not

Present

Available Wave
USER/xxxxx.WAV

www.BDTIC.com/ST

Summary of Contents for STM8L1528-EVAL

Page 1: ...stored in the Flash program memory of the microcontroller The firmware is based on the STM8L15x firmware library and provides an example of how to use this library It is divided into various smaller...

Page 2: ...e time 7 3 4 2 Setting the date 8 3 4 3 Setting the alarm 9 3 5 Thermometer demo 10 3 6 IDD measurement demo 11 3 7 Low power demo 12 3 7 1 Run mode 12 3 7 2 Wait for interrupt mode 12 3 7 3 Wait for...

Page 3: ...nt the keywords in bold indicate user actions on the joystick 5 way switch and the RV3 potentiometer The present document follows the conventions shown in Table 1 Up Up Up Up Up Up Left Right Left Rig...

Page 4: ...menu items on the left SEL Enters submenu UP Exits from a submenu 2 4 STM8L1528 EVAL board jumper configuration To be able to run the STM8L1528 EVAL demo correctly configure the following STM8L1528 EV...

Page 5: ...part of the demonstration firmware STM8L1528 Welcome message Main menu HELP HELP CALENDAR Date THERMOMETER About Adjust Show Time Adjust Show Alarm Adjust Show Low Power Audio Audio Player Voice Recor...

Page 6: ...sage The main menu is then activated and the message shown in Figure 4 is displayed Figure 4 Main menu 3 3 Help mode Pressing SEL from the main menu enters the Help mode The following messages are dis...

Page 7: ...displayed to show the current time value see Figure 6 2 Enter the first digit of the hour field Pressing the joystick UP increments the current digit value Pressing the joystick DOWN decrements the cu...

Page 8: ...digit value Pressing the joystick DOWN decrements the current digit value The digit value is limited to a range depending on the date field month day or year 3 After selecting the digit value press SE...

Page 9: ...is displayed Figure 10 Alarm Adjust message Alarm show Select the Alarm show option to display the current alarm After power up the default alarm time 00 00 00 is displayed till the Alarm adjust optio...

Page 10: ...When the joystick RIGHT is pressed the temperature in degrees Fahrenheit is displayed on LCD screen as shown in Figure 14 for two seconds then the temperature in degrees Celsius is displayed again Fi...

Page 11: ...own in Figure 16 is displayed Figure 16 Temperature sensor error message 3 6 IDD measurement demo The STM8L15x microcontroller features an ADC peripheral It measures the IDD current in Run mode by usi...

Page 12: ...mode submenu contains four submenu items 8 MHz the application runs at 8 MHz 4 MHz the application runs at 4 MHz 2 MHz the application runs at 2 MHz 16 MHz the application runs at 16 MHz Press SEL to...

Page 13: ...hen the alarm time is reached the system exits from WFI mode the system clock frequency is set to 16 MHz and the application execution resumes The message shown in Figure 23 is then displayed on the L...

Page 14: ...e system exits from WFE mode and the application execution resumes The message shown in Figure 27 is then displayed on the LCD screen Figure 27 Exit from WFE with comparator interrupt message Note If...

Page 15: ...upt wakes up the device then all LEDs are ON and a sound is played for 10s The RTC alarm wakes up the MCU from Active halt mode The LEDs blink until SEL is pressed from the Active halt menu see Figure...

Page 16: ...Halt mode the system clock is set to 16 MHz and the application execution resumes The following message is displayed on the LCD Figure 33 Exit from Halt with EXTI message A Comparator 1 interrupt can...

Page 17: ...the following message is displayed on the LCD screen Figure 36 Start voice recorder message This message remains displayed until SEL is pressed The STM8L15x then starts erasing the voice data previous...

Page 18: ...bmenu by pressing the SEL on the joystick The following message remains displayed unless SEL is pressed Figure 41 Audio Player menu message When SEL is pressed the STM8L15x starts playing the voice an...

Page 19: ...time of sampling Sample rate may be 8000 11025 22050 or 44100 Hz Bits Per Sample 8 bit Audio sample data values are in the range 0 255 Number of Channels 1 Mono The maximum wave files number that can...

Page 20: ...and the menu shown in Figure 47 is displayed When the audio stream is stopped the stream position is reset and the menu shown in Figure 44 is displayed Note If the SD card is removed the demo will sto...

Page 21: ...folder to your own SD memory 4 2 Programming the demonstration To upgrade the demonstration firmware running on your board perform the following steps 1 Download the latest version of STM8L1528 EVAL d...

Page 22: ...mo ADC1 IDD measurement Voice recorder DAC Audio Player COMP 1 Low power External interrupts EXTI Low Power GPIO All demo Clock controller All demo I2C1 Thermometer Audio Player TIM1 Voice recorder TI...

Page 23: ...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 UNLESS EXPRES...

Reviews: