-1
\$\begingroup\$

Well, I was just wondering, I have been using the Microchip PIC32 USB Starter Kit with the MEB (Multimedia Expantion Board 1) for some projects.

One of them is to record audio and analyse it, the problem here is that Microchip released some demos, one of them with the audio feature just for generating audio, but no recording...

I have spent months working on this with no success. I made a Microchip Ticket request, but their answer was another demo from another board with only audio reproduction...

Has anybody here being able to record audio with the MEB board and with a PIC32 USB Starter kit?

I have studied the code and the codec has the methods to do this, but when implemented, it just wont run. If someone here wants the project that I have done so far just tell me so I can send it.

The complete project can be found in this GitHub repository.

\$\endgroup\$
  • \$\begingroup\$ Can you share the source code (and schematics if applicable) with us? \$\endgroup\$ – Ricardo Aug 5 '14 at 12:14
  • \$\begingroup\$ Yeah sure, the code is quite big, how do you recommend me to share it? \$\endgroup\$ – gkapellmann Aug 5 '14 at 12:17
  • \$\begingroup\$ git + github perhaps? \$\endgroup\$ – Erik Friesen Aug 5 '14 at 12:31
  • \$\begingroup\$ Perhaps you should start with a wav or raw wav, rather than some codec? \$\endgroup\$ – Erik Friesen Aug 5 '14 at 12:32
  • \$\begingroup\$ Can you extract just the relevant parts of the code, the ones you think are related to the problem? That would be best, as it would save time of those willing to study your code and answer your question. If not, posting it to some site and adding a link here would be ok, too. But if it's too long, that would reduce your chances of getting an answer. \$\endgroup\$ – Ricardo Aug 5 '14 at 12:33
1
\$\begingroup\$

The Audio Codec is a WM8731, which is an I2S device. Your approach should be to a)learn how to deal with I2C/I2S devices on your MEB using the PIC, and then b) read and understand the datasheet for the codec to learn how to record, and finally c) learn how to implement that on the PIC. Don't look for PIC32 examples on how to record using this codec. Look for examples of how to interact with the codec on whatever c-based platform you can find, or even in pseudo code, and then translate that to your own platform.

Note that The MEB user manual, section 2.9, shows that the microphone inputs into the audio codec. Pins 19 and 20 are the R and L lines in, and they seem to be unconnected. This would mean that unless you're up for a tiny bit of SMD rework, you're limited to microphone recording, which is a possibility for why Microchip is pushing you to a different development board.

Lastly, language like "won't run" doesn't help us help you. The more you can tell us about what you've tried and the mode it fails in, the faster you'll get real help.

\$\endgroup\$
  • \$\begingroup\$ Thank you for your answer! You're right, only microphone recording is available but check also the hardware, the MEB has a well adapted microphone entrance to (in theory) record sound. Also, I have studied the I2C protocols and I understand what you say by "understand the datasheet for the codec to learn how to record". Microchip send me to a other board with the same codec but with a PIC24. Ok, working more the "won´t run", I am able to reproduce sound, if you bias the microphone it does it correctly, but to save the sound in memory it just doesn´t. \$\endgroup\$ – gkapellmann Aug 6 '14 at 18:27
  • \$\begingroup\$ As a codec, ie for its sampled data, the WM8731 is an I2S device, with an auxiliary control port which can speak either I2C or something approaching bidirectional SPI. \$\endgroup\$ – Chris Stratton Aug 6 '14 at 18:32
  • \$\begingroup\$ @gkapellmann -- now we're getting somewhere. If you're reproducing, the sound is getting acquired. "Saving to memory" can mean lots of things, though. Are you trying to write the recording to a file on the SD card, or trying something else? Where in your code are you doing this? You need to be pretty specific about what your problems are, and what you're trying to do -- we won't continue to drag it out of you piecemeal forever! \$\endgroup\$ – Scott Seidman Aug 6 '14 at 18:43
  • \$\begingroup\$ True @ScottSeidman, The sound that is being reproduced is loaded to RAM Memory, but is defined in a file (frog.c). The simplest idea was to write the recorded audio (just like 5 seconds) to RAM also. Then be able to reproduce it. \$\endgroup\$ – gkapellmann Aug 7 '14 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.