STPS3045DJF-TR

MP3 Trigger v2 User Guide
2012.02.01
© 2012 SparkFun Electronics, Inc. All Rights Reserved. Product features, specifications, system requirements and availability are subject to change without notice. MP3
Trigger (WIG-09356) is a trademark of SparkFun Electronics, Inc. All other trademarks contained herein are the property of their respective owners.
MP3TRIGGER_UG_090917
4
Quiet Mode
The MP3 Trigger v2 can be placed into Quiet Mode using the serial control port. In this mode, the trigger inputs will
not start tracks but instead will cause serial messages to be sent upon activation. (See “MP3 Trigger v2 Outgoing
Message Summary” below.) This allows the trigger inputs to be decoupled from specific tracks, so that a PC or
microcontroller can monitor the trigger inputs and then start any track or sequence of tracks via the serial control port.
Quiet Mode is off by default and is not preserved through a power cycle.
Serial Control Protocol
The MP3 Trigger v2 comes with a full duplex 3.3-5V serial TTL interface that allows for control of all the MP3 tracks
(up to 256) on the microSD card as well as volume, and for monitoring input trigger activity. You can use our FTDI
Basic (DEV-09115) or connect to any serial interface that uses the format: 8-bits, 1-start, 1-stop, no parity, flow
control = none. The serial port baud rate defaults to 38.4kbps, but can be changed using the initialization file. All
commands to the MP3 Trigger v2 are 1 or 2 bytes in length.
1-byte commands are upper case ASCII characters.
2-byte commands start with an ASCII character. Those starting with an upper case character use an ASCII value (‘0’
– ‘9’) as the second byte. (These commands can be typed on a keyboard.) 2-byte commands starting with a lower
case character require a binary value (0 – 255) as the second byte.
Bytes sent to the MP3 Trigger v2 are not echoed. If echoing is required, set your terminal program to echo locally.
Command Summary
Command: Navigation – Start/Stop
Number of bytes: 1
Command byte: ‘O’
Data byte: none
Comments: This command performs the same function as pushing the on-board nav switch center position. If the
current track is playing, it stops. If the current track is stopped, it will restart from the beginning
Command: Navigation – Forward
Number of bytes: 1
Command byte: ‘F’
Data byte: none
Comments: This command performs the same function as pushing the on-board nav switch right position. The next
MP3 track in the directory will be started.
Command: Navigation – Reverse
Number of bytes: 1
Command byte: ‘R’
Data byte: none
Comments: This command performs the same function as pushing the on-board nav switch left position. The
previous MP3 track in the directory will be started.
MP3 Trigger v2 User Guide
2012.02.01
© 2012 SparkFun Electronics, Inc. All Rights Reserved. Product features, specifications, system requirements and availability are subject to change without notice. MP3
Trigger (WIG-09356) is a trademark of SparkFun Electronics, Inc. All other trademarks contained herein are the property of their respective owners.
MP3TRIGGER_UG_090917
5
Command: Trigger (ASCII)
Number of bytes: 2
Command byte: ‘T’
Data byte: N = ASCII ‘1’ through ‘9’
Comments: If it exists, the track with the filename “00Nxxxx.MP3” will be started, where N is the data byte. xxxx can
be any valid filename characters of any length.
Command: Trigger (binary)
Number of bytes: 2
Command byte: ‘t’
Data byte: n = 1 to 255
Comments: If it exists, the track with the filename “NNNxxxx.MP3” will be started, where NNN is the ASCII equivalent
of the data byte n with leading 0s. xxxx can be any valid filename characters of any length.
Command: Play (binary)
Number of bytes: 2
Command byte: ‘p’
Data byte: n = 0 to 255
Comments: If it exists, the nth track in the directory will be played. The total number of available tracks in the
directory can be retrieved using Status Request command below.
Command: Set Volume (binary)
Number of bytes: 2
Command byte: ‘v’
Data byte: n = 0 to 255
Comments: The VS1053 volume will be set to the value n. Per the VS1053 datasheet, maximum volume is 0x00,
and values much above 0x40 are too low to be audible.
Command: Status Request (ASCII)
Number of bytes: 2
Command byte: ‘S’
Data byte: N = ASCII ‘0’ through ‘1’
Comments: If N = ‘0’, the MP3 Trigger will respond with a version string. If N = ‘1’, the MP3 Trigger v2 will respond
with the total number of tracks on the installed microSD card, in ASCII. Both responses will be preceded by the ‘=’
character.
Command: Quiet Mode (ASCII)
Number of bytes: 2
Command byte: ‘Q’
Data byte: N = ASCII ‘0’ or ‘1’
Comments: If N=’1’, Quiet mode is turned on. If N=’0’, Quiet mode is turned off. Default state is off.
MP3 Trigger v2 User Guide
2012.02.01
© 2012 SparkFun Electronics, Inc. All Rights Reserved. Product features, specifications, system requirements and availability are subject to change without notice. MP3
Trigger (WIG-09356) is a trademark of SparkFun Electronics, Inc. All other trademarks contained herein are the property of their respective owners.
MP3TRIGGER_UG_090917
6
MP3 Trigger v2 Outgoing Message Summary
The MP3 Trigger v2 sends the following ASCII messages:
‘X’: When the currently playing track finishes.
‘x’: When the currently playing track is cancelled by a new command.
‘E’: When a requested track doesn’t exist (error).
In response to a Status Request Command, data byte = ‘0’, the MP3 Trigger v2 sends an 18-byte version string: e.g.
“=MP3 Trigger v2.50” .
In response to a Status Request Command, data byte = ‘1’, the MP3 Trigger v2 sends the number of MP3 tracks on
the currently installed microSD card: e.g. “=14”.
In Quiet Mode only, when one or more trigger inputs are activated, the MP3 Trigger v2 sends ‘M’ followed by a 3-byte
bit mask indicating which triggers were activated:
Data byte 0: TRIG01 through TRIG08
Data byte 1: TRIG09 through TRIG16
Data byte 2: TRIG17 and TRIG18
A value of 1 in a bit position indicates that the corresponding trigger input was activated.
Initialization File
Version 2.40 firmware (and above) supports the use of an initialization file to change some of the operation
parameters of the MP3 Trigger v2 upon power up. This file is ASCII text only, and can be created and edited with any
text editor such as Notepad.
The initialization file must be named “MP3TRIGR.INI” and must, like all the mp3 files, be in the root directory. The file
is optional. If it does not exist, then the MP3 Trigger v2 defaults to normal operation at 38.4K baud and all triggers
starting their respect tracks.
Initialization file commands must begin with the “#” character and be followed by a space. The initialization file
example on the following two pages is self-documented and describes the commands currently supported:

STPS3045DJF-TR

Mfr. #:
Manufacturer:
STMicroelectronics
Description:
Schottky Diodes & Rectifiers 30 A Vrrm 45 V Vf 0.41 Tj 150c
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet