BOE mircophone
brandan
Posts: 52
On the Board of Education how I use the microphone on it? I was thinking would an analog pin. It seems to be on a digital pin. I didn't see anywhere say how to use it? I'm using c/c++ not spin.
Comments
Above is the microphone section of the PropBOE's schematic (page 6).
It's possible to record sound to the SD card on the PropBOE using the mic. I used a program (in Spin) from the OBEX to test out recording audio to the uSD card. The sound quality wasn't great but I could understand the recorded speech when it was played back.
I'm pretty sure you'll need PASM to monitor the mic fast enough to record or monitor sound. There are several examples in the Propeller Tool library of using the sigma-delta technique. ADC.spin can be used as a child object to monitor the mic (you'll need additional code to do something with the data). There are two programs in the "Demo" folder which use the microphone; "microphone_to_headphone.spin" and "microphone_to_vga.spin".
Sorry, but I'm not aware of any programs in C using the mic. Hopefully someone more familiar with using C on the Propeller can help.
I believe Duane is referring to the demos that are in the Propellor Tool:
http://www.parallax.com/downloads/propeller-tool-software
"File>Open From> Propeller Library -Demos"
What does "I can't get it to work" mean? What is you try? What where you expecting? What happened? What code did you use?
By connecting a mic to an analog pin, do you mean connecting to the I2C ADC?
I think I used this object (yes, it's written in Spin), to record audio. I used this one to play it back.
Make sure any sigma-delta programs you try have the correct I/O pins set for the mic.
For GCC, it seems we need some one to write a Sigma-Delta driver.
Using that might be the least effort.
http://code.google.com/p/spin2cpp/
I ran spin2cpp on the recorder object's code, but spin2cpp thinks the following lines in WAV-Recorder_ADCEngine.spin are syntax errors and will not complete a conversion:
The code compiles with openspin in SimpleIDE without issue, so there's something about ' byte byte' and 'byte long' that spin2cpp is not happy with. Kye quotes in the code NOT to edit these lines, so I'm not sure how to get around these errors...
dgately
I suspect there still is a lot of OBEX code that will migrate without needing either a new verision of Spin2Cpp or a revision in the code. Catalina C also doesn't seem to have a Sigma-Delta driver in C.
Thanks, Kuroneko!
That gets me further, but the spin2cpp .c version of SD-MMC_FATEngine.spin does not compile without errors in a .s file created during the build process. That file is a temp file buried in /var/folders that disappears after the build attempt. I'll try to get a .c version of SD-MMC_FATEngine working separately...
dgately
Try David's SpinWrap program. http://forums.parallax.com/showthread.php/153919-SpinWrap-a-tool-for-allowing-C-or-C-to-use-Spin-Objects?p=1243144&viewfull=1#post1243144
Ah, to find the build failure, I used the "--dat --gas" commands together to create a .S file for the ASM code in "SD-MMC_FATEngine". Trying to compile (assemble) that code showed the errors (yay!)
I fixed the inline ASM code that was created in D-MMC_FATEngine.c and now can compile the whole project...
I modded the project to use the pins of the Propeller BOE rather than the Prop Demo board (mostly just changes to WAV_Recorder_Program.h) and removed code that looked for toggling of pin 31 to stop recording. I set the recording period to a static 4 seconds for testing. The program starts up and runs until the record cog is started. It hangs there. I put in some code to blink the _stoplight LED (pin 26 on the Prop BOE) between calls to the SD & WAV engine code, still get no further than the first cognew in what I now have labelled as "main()".
It's possible that the code is not compatible with the Prop BOE in some other way as I was not able to get the .spin version to work either ...
I zipped the project in SimpleIDE for anyone to look at and help debug:
WAV_Recorder_Program.zip
dgately...