This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 + amplifier for audio purpose as a sample player

Genius 4170 points
Other Parts Discussed in Thread: PCM1774, TLV320DAC3100, MSP430F5437, TPA301

Hello everyone,

today I got an interesting project and I will need some help to get an overview:

I want to use an MSP430 ( which one I dont know yet ) to detect a trigger signal ( most likely by a piezo trigger played by foot or finger ). Then without any or smallest delay a sample should be played.

The sample should either be placed as a *.wav file inside the MSP430 Flash, as there should be enough space for my small sample, or it should be interchangeable via a SD card ( I dont know yet )

Sample-data:

Size: 37 kByte

Mono; 44100 Hz  ( standart CD ) 16 bit

As i have quite some expirience with TI and MSP430 I want to realize this with TI products, but as I never worked with their audio products, help would be highly appreciated. I have of course read quite some articles and pdfs before posting here. So there are a couple of questions in my mind, perhaps some of you can easily answer.

1. When I would use a SD card, I could of course read it out via SPI, do I need some certain format ( like FAT ) on the SD card, in order to use it with my PC? Are there stacks available for MSP430 to read out an SD card. Can I simultaniously read out the SD and play the sample, or do I have to read out the complete SD card into my RAM and then somehow work with it. ( Ok as  there is not enough RAM on the MSP430 I assume this wont be possible anyway)

2. Considering I would have the sample stored in my MSP430 as a couple of bits, what would be the next step. Could I directyl try to convert the wav file into a analouge signal with an onboard DAC? Do I need a 16 bit DAC for my 16 bit wav file, or dont those 2 values correlate somehow? Somewhere I read I have to processe a 44,1 kHz signal exaclty with 44,1 kHz otherwise the sound will be faster or slower, is that true, or does it depend on other things?

3. I read a little bit into the audio guide from TI and the PCM series, I do not quite get the difference between audio codecs and simple DACs for audio purposes. Are there some hardware codecs like wav or mp3, into which I directly send my files via the MSP430 and they will output some audio analog signal. which I can then use to power some headphones?

To get you some insight in my plans ( as I do not have any experience with audio stuff and TI yet) I will tell you what I would do if noone tells me what to do :)

I would take some basic MSP430 with enough FLASH for my wav sample, then I would consider some PCM device or audio DAC like the PCM1774 or the

TLV320DAC3100

just because I right now consider them as fitting for my purposes, but please tell me if i am wrong.

As I think, both of them communicate with the MSP430 via SPI or I2C / I2S ( I recognized the article about emulating I2S with SPI ). So I would ask myself if I can communicate fast enough to get an 44,1 kHz signal with the right timings.


Out of those devices I assume I will get an analog signal which I can directly put to my headphones or speakers or whatever is there or should be plugged to it. This directly leads to my last question:

Where do I have to look to see what end devices I can power with my analog output, I have seen quite some speakers with 500mW and 8 Ohm, how can I relate those values to my audio out?


PCM1774: 40-mW + 40-mW Headphone Output at · Pop-Noise Reduction Circuit
RL = 16 W


TLV320DAC3100: Mono Class-D BTL Speaker Driver (2.5 W Into 4-Ω or 1.6 W Into 8-Ω)


Do I have to find fitting ballasts, or can I also put other end devices with different specs into it, as the chinch plug generally ought to be the same for a lot of different ballasts anyway?


Thanks for your time and help in advance.

If I get some helpful advice and starting to do the project, I will keep this post alive till the end :)


Best wishes,

Seb

  • Firts update:

    In my opinion there are 2 kinds of ICs to do audio stuff: one that simply amplifies the analog input signal like the TPA301 ( I found that out using my EVAL MSP430F5437 board, because thats exactly what they use as audio input for the mic ) and one that really does convert an digital audio signal into an analog one with the specifications given.

    Still what I do not understand are audio codec ICs: given an WAV RIFF file ( uncompresed audio data with a 44 Bytes header) I would still have to cut away those 44 Bytes of header in order to DAC the useable wave signal, does a codec IC exactly do so? I couldnt find out if there are special codec ICs for real codecs like mp3...

    Last question for today: Can I simply use the onboard DAC to produce audio? I assume this lacks of quality, but of course it will work, my question is rather, can the MSP430 onboard DAC be used for actual good quality audio or do I have to use an external one for good quality, and then will it be an codec IC or an audio DAC?

    Thanks again for reading, if the response will be as much as yesterday I wont bother you again :)

  • seb said:
    I couldnt find out if there are special codec ICs for real codecs like mp3

    The VS1053 CODEC supports multiple formats, and has a SPI interface to send in the bitstream so should be able to be driven from a MSP430. 
    seb said:
    Still what I do not understand are audio codec ICs: given an WAV RIFF file ( uncompresed audio data with a 44 Bytes header) I would still have to cut away those 44 Bytes of header in order to DAC the useable wave signal, does a codec IC exactly do so?
    The VS1053 datasheet shows that the codec expects to be sent the header (for a WAV RIFF file to be decoded the VS1053 expects a 60 byte rather than 44 byte header)
    seb said:
    Last question for today: Can I simply use the onboard DAC to produce audio?
    I not enough of an audio expert to comment, but writing this post reminds me to get round to try interfacing my VS1053 board to a MSP430....

  • There are some very old Application Notes: slaa131.pdf, slaa361.pdf and slaa405.pdf about voice grade MSP430 based codec. Kind of interesting.

    There is also an Audio Capacitive Touch BoosterPack with very good sound quality but ...

  • seb said:
    Can I simply use the onboard DAC to produce audio?

    No problem. However, the quality isn't really HIFI.

    The DAC is 12 bits only, and the full-scale settling time can be as large as 200µs, so a full-scale rectangle signal is limited to 2.5kHz. The settling time for small changes, however, is by a factor of 20 smaller, so 44kHz conversion speed shouldn't be a problem. The 12 bit, however, limit the dynamic range to 72dB (effectively a bit less).

    About codec ICs, well, I have no idea. I can imagine that you have to read the header and configure the codec IC according to the information found (frequency, bit width, mono/stereo), and the feed it the raw data stream. In case of a WAV file it woudl be just liek you have ot do with the MSPs ADC: configure the timer for the frequency, configure the software for mono/stereo etc. and then feed it the sample data.
    I never worked with MP3 codec ICs. I once worked with VOC encoding and decoding, but that was too long ago, so I only dimly remember it.

**Attention** This is a public forum