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.

How to transfer audio data from Mic to audio output port?

Hi,

I'm using the MSP-EXP430F5438 experiment board. Now I want to send data collect from Mic directly to the earphone. How can I implement it without using record and playback?

Thanks.

Shan 

  • Shan Liang said:
    How can I implement it without using record and playback?

    I don't have experience with this board and the audio output hardware. The 5438 does not have an internal DAC, so I don' tknow you can actually use this hint:

    You can set up a DMA channel that is triggered by the ADC that samples the mic input. The DMA will tehn transfer each sample to a destination as soon as the conversion is complete. In case of a DAC, this would have been the DAC output register. I don't know whether the earphone output too works with a simple word write as the DAC would.

    I don't have access to my daasheets right now, so I cannot check the board circuit.

  • Hi Jens-Michael,

    I think I can use the digital conversed by ADC and build my own DAC to output the analog signal. But here is the problem about getting the digital signal. I am going to make a Bluetooth interphone to conduct a conversation. I want to send the digital data directly from Bluetooth to another Bluetooth, so how can I get the digital signal out of the ADC?

    Thank you.

    Shan

  • Shan Liang said:
    I want to send the digital data directly from Bluetooth to another Bluetooth, so how can I get the digital signal out of the ADC?

    I doubt it is possible without software. The ADC result is 16 bit and needs to be read as a single 16 bit word, while the transfer to the BT will be byte wise (in case of an external self-contained BT device that acts as serial bridge) or procedural (if the BT stack is on the MSP itself).

    So what you can do is to program a DMA to collect a certain number of conversion results into a buffer and trigger an ISR when the buffer is full, so the software can initiate the BT transfer. Or, if you don't want to fill a buffer but send the data immediately, you have to set up an ISR that reacts when the ADC has a conversion done. (All MSP ADCs can be set up to trigger an interrupt when a conversion or a sequence of conversions is complete)

    You're going to design sort of a 'babyphone', aren't you?

  • Jens-Michael, 

    Yes, a 'babyphone'. I just can't find a exact word to discribe it :)

    If I want to get the data immediately, do I also have to get the data from DMA? Or is there some function that allows me to get the ADC conversion data before it's sent to DMA?

     

    Thanks,

    Shan

  • Shan Liang said:
    is there some function that allows me to get the ADC conversion data before it's sent to DMA

    It is not 'sent to DMA'. DMA stands for 'Direct Memory Access' and means a circuit that is triggered by an event (in this case the 'conversion ready' signal), and then moves data from a source (the ADC result register) to a destination (ram buffer, port register, whatever). It is jsut a 'copy if triggered' function that doesn't take time for program execution or checking the trigger in software.

    Therefore data isn't sent to DMA, DMA fetches the data as soon as it is ready and moves it as programmed. You can tricky combine two DMA channels, so when the first trasnfer is done, this triggers a second DMA transfer that e.g. moves a '0' byte into a variable (must be declared volatile). You code can then check this variable suddenly changing from non-0 to 0 and you know that a new value has arrived. Or you constantly test the DMA control registers for a change (e.g. the 'bytes to transfer' counter being decremented when a transfer happens). There are many ways to do things, and what's best depends on what exactly you need. (not just the general task). That's the real job of an engineer and the difference between a (software) engineer and a programmer. :)

**Attention** This is a public forum