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
7
Sample Initialization File
#BAUD 38400
#VOLM 0
#RAND 2
#TRIG 01, 0, 0
#TRIG 02, 0, 0
#TRIG 03, 0, 0
#TRIG 04, 0, 0
#TRIG 05, 0, 0
#TRIG 06, 0, 0
#TRIG 07, 0, 0
#TRIG 08, 0, 0
#TRIG 09, 0, 0
#TRIG 10, 0, 0
#TRIG 11, 0, 0
#TRIG 12, 0, 0
#TRIG 13, 0, 0
#TRIG 14, 0, 0
#TRIG 15, 0, 0
#TRIG 16, 0, 0
#TRIG 17, 0, 0
#TRIG 18, 0, 0
******************** ALL INIT COMMANDS ABOVE THIS LINE *********************
This is a sample init file for the MP3 Trigger v2, firmware version 2.50.
The init file is optional. If not present, the default parameters will be
in effect: 38.4Kbaud, and all triggers will start their corresponding
tracks with restart lockout disabled. If it is present, it must be named
MP3TRIGR.INI and be located in the root directory.
Only the first 512 bytes of the file are examined for commands, and the first
occurrence of the '*' character is treated as the end of file by the parser.
Comments are not allowed in the command section, but there is no restriction
on the length of the comments that follow the first '*'.
All commands must begin with the '#' character and be followed by a space,
then the command parameters separated by commas. White space is ignored. All
parameters are decimal numbers. Leading zeros are acceptable. See the above
examples - which are redundant since they are all default values.
The following commands are supported in firmware version 2.50:
#BAUD N
where N is one of the following: 2400, 9600, 19200, 31250 or 38400
#VOLM N
where N is from 0 to 255
Default is full volume = 0. Useful range is 0 to 64, with values above
64 being inaudible.
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
8
#RAND N
where N is from 1 to 255
The default behavior of the random trigger function is to play a random
track from all the MP3 files on the flash card. The #RAND function will
exclude the first N tracks (in the directory) from the random trigger
function. So if there are 18 MP3 files on the card and N=4, then the
first 4 MP3 files will be excluded from the random trigger function.
#TRIG N, F, L
where: N is the trigger number (1 - 18)
F is the trigger function type (see below)
L is the restart lockout enable
The defined trigger function types (F) are as follows:
F = 0: Normal operation
F = 1: Next (same as the forward Nav switch)
F = 2: Random
F = 3: Previous (same as the back Nav switch)
F = 4: Start (restarts the current track)
F = 5: Stop
F = 6: Volume Up
F = 7: Volume Down
The restart lockout feature, if enabled, will prevent that trigger
from working if audio is currently playing. Use this if you want
to prevent restarts before the track has reached the end. This
feature does not apply to function types 5 - 7.
L = 0: Restart lockout disabled (default)
L = 1: Restart lockout enabled
You only need to include entries for triggers that are to be non-default.
As an example, I use the following single-line init file to make trigger
18 be a "Next" function, then hard-wire the trigger so that my MP3 Trigger
powers up and loops continuously through all the tracks on the card.
#TRIG 18, 1, 0
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
9
Bootloader
The MP3 Trigger v2 has a resident boot-loader that allows updating the firmware directly from the microSD card,
alleviating the need for a hardware programmer. Because this boot-loader is in located in protected sectors of the
PSoC’s flash memory, it cannot overwrite itself. The boot-loader can always be run on power up, thus making it
possible to recover from a bad firmware load.
IMPORTANT NOTE: Use of a hardware programmer, such as the Cypress MiniProg, to program the MP3 Trigger v2
with anything other than the boot-loader image will erase the boot-loader. Don’t do it!
Using the boot-loader
To update the MP3 Trigger v2 firmware, copy the new firmware hex file to a FAT16 or FAT32 formatted micro-SD
card and rename the file to “MP3TRIGR.HEX”. It doesn't matter if it's the only file on the microSD card or not - the
boot-loader will find it as long as it has this exact filename. Insert the microSD card into the MP3 Trigger v2 with the
power off. Hold down the center nav switch while turning on the power. Wait for the status LED to go solid, then
power cycle the MP3 Trigger v2 to run the new firmware.
Here's how the boot-loader works in more detail:
The boot-loader is always entered whenever the board powers up. The first thing it does is look to see if the center
nav switch is being held down. If not, it immediately vectors to the start of the firmware. Note that if you have
previously loaded bad firmware, the board will simply halt or do whatever your bad code tells it to do – possibly with
no activity other than the power LED. This is normal if there's no good firmware loaded.
If the center nav switch is being held on power up, the boot-loader searches the microSD card directory for a file
named "MP3TRIGR.HEX". If there's no card installed, or the file doesn't exist on the card, it will blink the status LED
very rapidly forever. If it finds and is able to open the file, it begins to program the PSoC Flash with the contents of the
firmware file. The status LED will illuminate for each hex record programmed. If it successfully programs the entire
file, the status LED will turn solid upon completion. You can then power cycle the MP3 Trigger v2 and you will be
running the new firmware (don't hold the nav switch down again or you will simply re-enter the boot-loader.
If there's a flash memory programming error (or you pull the microSD card out before it finishes, for example) the
status LED will indicate a bad programming cycle by blinking briefly at about 1 Hz (This looks very different than the
blinking for programming records). You need to cycle the power again holding the nav switch to re-enter the boot-
loader.
The key is that the boot-loader cannot over-write any part of itself, no matter what's in the firmware image file. The
worst thing that can happen is you load bad firmware and the board won't run. But you can always hold the nav
switch down on power up and get into the boot-loader to load new firmware.

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