ETC2 LPM11162 Audio module Datasheet

LPM11162 Audio Module
www.lpelettronica.it
Firmware version.2.1R
Doc. Rev.0 (04/12/10)
Features
Separate Analog/Digital Supplies for optimmum
performance
Typical 3.3V Supply Voltage
Non-volatile audio storage
Internal Flash Filesystem to store wave files
95 seconds of audio recording
11.025KHz sample rate
High quality voice/sounds reproduction
UART interface for programming/playback (SERIALMODE)
Input PIN reading for playback (KEY-MODE)
Analog audio output for playback
5KHz audio bandwidth
Small footprint device (20x28mm)
Low power consumption
Applications: automatic distributors, robots, industrial
controllers, entertainment, gadgets
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Description
LPM11162 is a simple integrated solution to store and reproduce high quality audio wave files in electronic circuits.
Typical applications are automatic distributors, robots, speaking devices, gadgets and in general all the devices
where it is required to program and play audio wave files.
The audio files (11KHz – 16bit) can be programmed in the internal 2Mbyte flash memory that is provided with an
advanced filesystem. Programming is done on the UART port using simple filesystem commands. The baudrate for
communication is programmable with the AutoBaudrate feature (up to 115200 bps).
The audio files can be reproduced on the analog ouput using the playback commands (SERIAL-MODE) or driving
some input PIN (pressing keys , driving relè or transistors, ecc).
Typical Application
DVCC-3.3V
DVCC-3.3V
AVCC-3.3V
DVCC
Microcontroller
4.7uF
AVCC
100nF
100nF
LPM11162
DGND DGND
UART-TX
UART-RX
UART-RX
UART-TX
IN
OUT
/BUSY
/RESET
4.7uF
AGND AGND
AUDIO-OUT
AMP
100nF
AGND
DGND
DGND
AGND
Figure 1 – Typical Application schematic
LPM11162
www.lpelettronica.it
Pin Diagram
12 11 10
9
8
7
1
4
5
6
2
3
Figure 2 – Pin Diagram (Top View)
Pin Description
Pin
number
1
Pin Name
Pin Type
Description
KEY2 - /BUSY
IN - OUT
2
/RESET
IN
3
4
5
DVCC
DGND
KEY1 - UART-TX
POWER
POWER
IN / OUT
In KEY-MODE this pin is named KEY2 and it is used
in combination with other KEY pins to play wave files
pressing keys.
In SERIAL MODE this is an active low Busy pin. This
signal is normally high, it is driven low by the module
during a command execution (Busy condition). New
commands are not accepted when the module is in Busy
state.
Active low Reset pin. Low level is reset condition, high
level is running condition.
Digital supply voltage.
Digital ground.
In KEY-MODE this pin is named KEY1 and it is used
in combination with other KEY pins to play wave files
pressing keys.
In SERIAL-MODE this is the UART transmit pin.
1
LPM11162
www.lpelettronica.it
6
KEY0 - UART-RX
IN
7
8
9
10
11
12
NC
AVCC
AUDIO-OUT
NC
AGND
NC
POWER
OUTPUT
POWER
-
In KEY-MODE this pin is named KEY0 and it is used
in combination with other KEY pins to play wave files
pressing keys.
In SERIAL-MODE this is the UART receive pin.
Not connected
Analog supply voltage.
Analog audio output signal (single ended).
Not connected
Analog ground.
Not connected
Table 1 – Pin Description
2
LPM11162
www.lpelettronica.it
Absolute Maximum Ratings
Stresses exceeding the absolute maximum ratings may damage the device. The device may not function or be
operable above the recommended operating conditions and stressing the parts to these levels is not recommended.
In addition, extended exposure to stresses above the recommended operating conditions may affect device
reliability. The absolute maximum ratings are stress ratings only.
Symbol
DVCC
AVCC
VIN
TA
IOD
IOA
Parameter
Digital supply voltage
Analog supply voltage
Digital input pin voltage
Operating ambient temperature range
DC maximum source/sink current from digital output pins
DC maximum source/sink current from analog output pin
Rating
-0.3V to +4.0V
0V to +5.5V
-0.3V to +4.0V
-20°C to +85°C
±10mA
±10mA
Recommended Operating Conditions
The Recommended Operating Conditions table defines the conditions for actual device operation. Recommended
operating conditions are specified to ensure optimal performance to the datasheet specifications. It is not
recommended exceeding them or designing to absolute maximum ratings.
Symbol
DVCC
AVCC
VIN
TA
Parameter
Digital supply voltage
Analog supply voltage
Digital input pin voltage
Operating ambient temperature range
Rating
+2.7V to +3.6V
+2.7V to +5.5V
0V to DVCC
0°C to +70°C
Electrical Characteristics
Symbol
IDCC
IACC
BW
VIH
VIL
VOH
VOL
Parameter
DC maximum supply current on DVCC
DC maximum supply current on AVCC
Maximum analog output bandwidth
High level input voltage on digital pin
Low level input voltage on digital pin
High level output voltage on digital pin
Low level outputvoltage on digital pin
3
Min
0.8 DVCC
2.4V
-
Max
70mA
1 mA
5 KHz
0.2 DVCC
0.4V
LPM11162
www.lpelettronica.it
1 – Introduction
1.1 – Filesystem
LPM11162 is designed with an internal filesystem that is able to store standard 11025Hz-16bit wave files. The
UART interface makes possible to program/playback the wave files connecting LPM11162 to another device (for
example a small microcontroller or a PC).
User’s board
LPM11162
Module
UART ( Playback Cmd)
Microcontroller
Figure 3 – Typical Programming and Playback block diagram
LPM11162 is equiped with a 2Mbyte flash memory that in 11KHz-16bit wave format allows to store a maximum of
95 seconds (maximum time for all the files). The maximum number of files is 16 and there is no limitation on the
size of each file.
Parameter
Max. number of files
Max. file name lenght
Audio files sample rate
Audio files data bits
Flash memory size
Value
128
15 characters
11025 Hz
16
2.094.080 bytes
Table 2 – Filesystem Specification
1.2 – SERIAL-MODE and KEY-MODE
LPM11162 has to working modes: SERIAL-MODE and KEY-MODE.
In SERIAL-MODE it is able to receive commands from UART port in order to program audio wave files in the
internal Flash memory or to reproduce them on the analog audio output. This mode is the most flexible and the user
can program/reproduce a large quantity of wave files sending simple commands from a host microcontroller or a PC
(download the LPM11162 ToolKit PC application).
There are cases where you don’t have a microcontroller in your circuit, but would be nice to reproduce wave file if
you have already programmed them on LPM11162.
This is the case of KEY-MODE, where 3 pins of LPM11162 are configured as input pins and the audio module is
able to reproduce wave file when the pin’s status changes. With KEY-MODE you can put LPM11162 in your circuit
with a few of other components and reproduce audio wave files.
4
LPM11162
www.lpelettronica.it
1.2 – KEY-MODE
KEY-MODE is the default working mode of the module at startup.
After power-on the module’s pins 1, 5, 6 are configured as input pins and the module consider them as “not pressed”
in high voltage level. No wave files are played until one or more pins change state. If one ore more pins becomes
low voltage level then LPM11162 will reproduce a wave file accordingly to the following table:
KEY2
(pin 1)
KEY1
(pin 5)
KEY0
(pin 6)
Wave File
Name
L
L
L
L
H
H
H
H
L
L
H
H
L
L
H
H
L
H
L
H
L
H
L
H
File0.wav
File1.wav
File2.wav
File3.wav
File4.wav
File5.wav
File6.wav
-
Table 3 – Filesystem Specification
When all the KEY pins are high level the LPM11162 is not reproducing any audio file, while in all other pin’s
configurations there is an associated wave file to be reproduced. Of course each wave file can be reproduced only if
it was previously programmed using the proper commands in SERIAL-MODE.
In a typical application each KEY pin can be connected to the supply voltage with a pull-up resistor. Then some
external keys, or open-collector transistors, or relè can drive the KEY pins low to enable the playback of a specific
wave file.
The interesting LOOP function allows to reproduce a wave file in loop, so at the end of a file the playback will
restart from the beginning if the pin’s configuration that activated playback is still present.
1.3 – SERIAL-MODE
SERIAL-MODE can be entered after power-on by sending the auto-baudrate character. When this caracter is
received LPM11162 switched to SERIAL-MODE, configuring the pin 1 and pin 5 as outputs for /BUSY and
UART-TX functions and configuring pin 6 as UART-RX.
5
LPM11162
www.lpelettronica.it
2 – SERIAL-MODE
2.1 – Writing files
Wave files can be programmed on LPM11162 with only 3 simple commands: File Open, File Write, File Close.
The File Write command permits to write the content of the audio files on the Flash memory if LPM11162. Each
File Write command permits to transfer a maximum of 256 bytes, so if the file size if greater than 256 bytes it is
required to send more File Write commands in sequence for a complete file transfer.
The File Write commands are accepted only after the file has been opened with the File Open command that
communicates to the module the name of the file that will be written. The file must be properly closed after all the
data have been transferred by sending the File Close command.
For example suppose to write the file audio.wav that is a 612 bytes file, the sequence of commands is the following:
1)
2)
3)
4)
5)
File Open command (audio.wav)
File Write command (first 256 data block)
File Write command (second 256 data block)
File Write command (last 100 data block)
File Close command
It is not possible to have two file with identical file name, so the File Open command will fail in case the file name
is the same of another file that is already present in the Flash.
2.2 – Formatting memory
The entire content of the Flash memory can be erased with the File Format command. This command erases all the
files that are present in the Flash memory. During the format procedure the /BUSY line is driven low to indicate the
module cannot receive other commands.
The duration of the format procedure can take up to several seconds (see Timing Specifications).
2.3 – Power-up sequence with auto-baudrate
In the figure below shows the power-up sequence with autobaudrate feature that allows to connect the module to
different host devices without any hardware configuration.
After the module is removed from reset, the first operation to do is to send the auto-baudrate character 0x55 (ASCII
“U”). When this character is received the module is able to understand the baudrate of the transmitter device and to
configure itself to work at the same baudrate.
After the auto-baudrate character is received the /BUSY line is driven low to indicate that the module cannot accept
commands. It sends a Module ID response and Module Firmware Version response, then the /BUSY line is driven
high and the module is ready to receive commands.
6
LPM11162
www.lpelettronica.it
RESET
AUTOBAUD
POWER-UP INFO
READY TO OPERATE
DVcc
/RESET
UART-TX
Module ID
response
FW Version
response
ID
VER
Auto-baudrate
character
UART-RX
Command
Command
0x55
/BUSY
Figure 4 – Power-up sequence
2.4 – /BUSY Signal
The /BUSY signal indicates when the module is able to receive commands or when it is busy to execute the previous
command and cannot accept a new incoming command.
The /BUSY line is normally high and it is driven low by the module when the first character of a command is
received to indicate that the command processing is going on. The line will reamain low for the time required to
receive the entire command and to exeute it. After the command execution is terminated the /BUSY line will go
high and another command can be accepted.
Exception is made for STOP and VOLUME commands. After the PLAY command is received the module is
considered busy until the playback of the audio file is completed. During this time the /BUSY signal remains low,
however the STOP and VOLUME commands can be sent in order to stop the file playback or adjust the volume
level while playback is in progress.
7
LPM11162
www.lpelettronica.it
2.5 - General Commands/Responses Format
The module’s operations are controlled via a simple UART protocol where another device can send commands to
the module and the module can reply with responses.
The commands are divided in Filesystem commands and Playback commands. Using Filesystem commands another
device can program wave files with voice messages on the module and then using the Playback commands it is very
simple to reproduce the voice messages.
All the commands/responses have the same general structure: the first byte indicates the command/responses type,
the second and third bytes indicates the number of data bytes that will be sent into the command/response, then the
data bytes are transmitted.
The general commands/responses structure is illustrated here:
Cmd/Res
(1 byte)
Cmd
Len
(2 bytes)
Len H
Len L
Data
(N bytes)
Data 1
Data 2
....
Data N
Cmd/Res (1 byte):
• 0x01 – File Open command
• 0x02 – File Write command
• 0x03 – File Close command
• 0x04 – File Format command
• 0x10 – Play command
• 0x11 – Stop command
• 0x12 – Volume command
• 0x81 – Module ID response
• 0x82 – Module Firmware Version response
Len (2 bytes):
• Number of data bytes in the command/response. Len is sent as high byte first.
Data 1…Data N (N bytes):
•
Sequence of generic N data bytes. Data bytes can be present or not (Len=0) depending on the
command/response.
8
LPM11162
www.lpelettronica.it
Command
File Open
Description
Open a new file on the module.
Required before writing data into
the file.
Write data bytes into the file that is
currently open for writing.
Cmd
0x01
File Close
Close the file. Required after
writing all data bytes into the file.
File
Format
Play
Stop
File Write
Volume
0x03
Len
Number of
characters in the file
name.
Number of data
bytes in current
command to write
in the file.
0x0000
Not present.
Erase all the files that are currently
present in Flash memory.
Start playback of a selected file.
0x04
0x0000
Not present.
0x10
File name
characters.
Stop playback of the file that is
currently playing.
Set the playback volume level
0x11
Number of
characters in the
name file to be
played.
0x0000
Not present.
0x12
0x0001
0-100
0x02
Data
File name
characters.
Data bytes.
Table 4 – Commands Table
Response
Module ID
Module
Firmware
Version
Description
Send to the host device the
module’s ID.
Send to the host device the
module’s firmware version and
date.
Res
0x81
0x0002
Len
0x82
0x000D
Table 5 – Responses Table
9
Data
Module’s ID
Module’s
firmware version
and date..
LPM11162
www.lpelettronica.it
2.6 - File Open command
The first operation to do to access a file is send the File Open command. This command informs the module that a
new file must be created with file name that is specified by the data bytes in the command.
The general format of File Open command is composed as follows:
Cmd
0x01
Len (2 bytes)
Len H
Len L
Data (N bytes)
Char 1
Char 2
....
Char N
Cmd (1 byte):
• 0x01 – File Open
Len (2 bytes):
• Number of characters in the file name (N≤15).
Char 1…Char N (N bytes):
• Sequence of N characters of the file name (no terminating char).
Here is shown an example of creating a new file called “f1.wav”:
0x01
0x00
0x06
‘f ’
‘1‘
‘.‘
‘w ‘
‘a‘
‘v ‘
2.7 - File Write command
After a file has been opened the File Write command can be used to write the file’s data bytes on the internal
memory of the audio module.
The general format of File Write command is composed as follows:
Cmd
0x02
Len (2 bytes)
Len H
Len L
Data (N bytes)
Data 1
Data 2
....
Cmd (1 byte):
• 0x02 – File Write
Len (2 bytes):
• Number of data bytes in current command to write in the file (N≤256).
10
Data N
LPM11162
www.lpelettronica.it
Data 1…Data N (N bytes):
• Sequence of N data bytes to write in the open file.
Here is shown an example of writing 4 bytes (0x0A, 0x0B, 0x0C, 0x0D) to an open file:
0x02
0x00
0x04
0x0A
0x0B
0x0C
0x0D
2.8 - File Close command
After finished to write all the data bytes to an open file, the file must be closed by sending the File Close command.
The general format of File Close command is composed as follows:
Cmd
0x03
Len (2 bytes)
0x00
0x00
Cmd (1 byte):
• 0x03 – File Close
Len (2 bytes):
•
Len is 0x0000 because no data bytes are present in the command.
2.9 - File Format command
The File Format command is used to erase all the file that are present in the internal memory. This command is
accepted only when there are no open files.
The general format of File Format command is composed as follows:
Cmd
0x04
Len (2 bytes)
0x00
0x00
Cmd (1 byte):
• 0x04 – File Format
Len (2 bytes):
•
Len is 0x0000 because no data bytes are present in the command.
11
LPM11162
www.lpelettronica.it
2.10 - Play command
The Play command starts playing an audio file that was previously written to the internal memory. The Play
command for an audio file is accepted only if no other audio files are currently playing.
The general format of Play command is composed as follows:
Cmd
0x10
Len (2 bytes)
Len H
Len L
Data (N bytes)
Char 1
Char 2
....
Char N
Cmd (1 byte):
• 0x10 – Play
Len (2 bytes):
• Number of characters in the audio file name (N≤15).
Char 1…Char N (N bytes):
• Sequence of N characters of the audio file name (no terminating char).
Here is shown an example of playing the file “f1.wav”:
0x10
0x00
0x06
‘f ’
‘1‘
‘.‘
2.11 - Stop command
The play of an audio file can be stopped sending the Stop command.
The general format of Stop command is composed as follows:
Cmd
0x11
Len (2 bytes)
0x00
0x00
Cmd (1 byte):
• 0x11 – Stop
Len (2 bytes):
•
Len is 0x0000 because no data bytes are present in the command.
12
‘w ‘
‘a‘
‘v ‘
LPM11162
www.lpelettronica.it
2.12 - Volume command
The Volume command allows to set the volume level for audio reproduction. The volume level is expressed in the
range 0-100:
The general format of Volume command is composed as follows:
Cmd
0x12
Len (2 bytes)
0x00
0x01
Data
Vol
Cmd (1 byte):
• 0x12 – Volume
Len (2 bytes):
• Len is 0x0001 because there is only 1 data byte for the volume value.
Vol (1 byte):
• Volume level in the range 0-100 (default is 50).
Here is shown an example of setting volume to 70%:
0x12
0x00
0x01
0x46
13
LPM11162
www.lpelettronica.it
2.13 - Module ID response
Each module has a unique ID that permits to recognize the module. The module’s ID is sent by the module to the
host controller during the power-up sequence..
The general format of Module ID response is composed as follows:
Res
0x81
Len (2 bytes)
0x00
Data (2 bytes)
0x04
ID 1
ID 2
Res (1 byte):
• 0x81 – Module’s ID
Len (2 bytes):
• Len is 0x0002 because the module’s ID is 2 bytes long.
ID 1…ID 2 (2 bytes):
• Sequence of 2 module’s ID bytes.
2.14 - Module Firmware Version response
The module’s firmware version and release date are sent by the module to the host controller during the power-up
sequence.
The general format of Module Firmware Version response is composed as follows:
Res
0x82
Len (2 bytes)
0x00
Data (9 bytes)
0x09
...........
Ver
Day 1
Rev
Day 2
Status
Month 1
...........
Month 2
Year 1
Res (1 byte):
• 0x82 – Module’s Firmware Version
Len (2 bytes):
• Len is 0x0009 because there are 3 bytes for the firmware version and 6 bytes for the date.
14
Year 2
LPM11162
www.lpelettronica.it
Ver...Status (3 bytes):
• The firmware version is composed by one Version character, one Revision character and one Status
character. Each character is expresses in ASCII format, so for example the firmware version 1.0R will be
expressed by the characters ‘10R’ in the response.
Day 1...Year 2 (6 bytes):
• The firmware release date is two bytes for the day, two bytes for the month and two bytes for the year. For
example the date 15/10/09 is expressed by characters ‘151009’ in the response.
Here is shown an example of firmware version 1.0R (15/10/09):
0x82
0x00
0x09
...........
1
0
1
...........
R
5
15
1
0
0
9
LPM11162
www.lpelettronica.it
3 – Timing Specifications
3.1 – Reset Timing Specifications
Symbol
tVR
tRL
Parameter
Minimum time between DVCC and /RESET high
Minimum /RESET low time
Min
1 ms
10 ms
Max
-
DVcc
tRL
tVR
/RESET
3.2 – Commands Timing Specifications
Symbol
tFF
tFO
tFC
tFW
tSTOP
tVOL
tBC
Parameter
Maximum File Format command time (/BUSY low)
Maximum File Open command time (/BUSY low)
Maximum File Close command time (/BUSY low)
Maximum File Write command time (/BUSY low)
Maximum Stop command time (/BUSY low)
Maximum Volume command time (/BUSY low)
Minimum time between /BUSY high and next command
Min
200 µs
Command
UART-RX
Cmd
Len
Command
Data
Cmd
tFF, tFO, tFC, tFW, tVOL, tSTOP
/BUSY
tBC
16
Len
Data
Max
65 sec
40 µs
25 µs
2.5 ms
250 ms
25 µs
-
LPM11162
www.lpelettronica.it
3.3 – Power-up Timing Specifications
Symbol
tRA
tAC
Parameter
Minimum time between /RESET high and auto-baudrate character
Maximum time between auto-baudrate character and module ready
to receive commands (1200 bps worst case)
Baudrate values
Min
600 ms
-
Max
150 ms
1200 bps
115200 bps
/RESET
Module ID
response
FW Version
response
ID
VER
UART-TX
Command
Auto-baudrate
character
UART-RX
0x55
Cmd
/BUSY
tRA
tAC
17
Len
Data
Command
Cmd Len
Data
LPM11162
www.lpelettronica.it
Packaging Informations
E
12 11 10
9
8
7
F
G
A
1
D
2
3
4
5
6
C
B
Dim
A
B
C
D
E
F
G
Millimeters
28.0
20.0
2.54
1.40
3.53
12.0
6.0
Inches
1.100
0.787
0.100
0.550
0.139
0.472
0.236
Figure 5 – Package Dimensions
18
Similar pages