Demo board audio examples?
SSteve
Posts: 808
Is there any example code for using the audio output or the electret mic on the propeller demo board?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
Comments
It digitizes the microphone to selectable resolutions and then outputs the samples to the headphones. It uses one COG. The COG's CTRA is used for analog-to-digital conversion and its CTRB is used for digital-to-analog conversion.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
I've done audio programming before, but from the application level. I was sending and reading buffers full of sample values to/from sound card drivers. Is there a good resource you'd recommend I study to try to figure out what's going on here? Do I need to go to the storage locker and break out my venerable copy of Musical Applications of Microprocessors?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
Here's a spin program that documents the counter configuration and synthesizes two different frequencies simultaneously. It·was posted earlier on another thread.
Sound programming is my favorite. I want to make a speech synthesis object for the Propeller that can sing, too. We've only got 32KB of RAM in the chip, so algorithmic programming is key to making big things happen. I have no recommendation on what to read, by the way.
Have fun!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
If you manage to pull that trick, you're going to make a lot of dedicated speech-chips obsolete real fast.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
but if your not familiar with signal theory even the explanation may sound greek. Unfortunately nearly all explanations are at this higher level, that is because sigma-delta converters are not a first generation ADC, so everyone assumes you've studied and understood the first generation ADCs.
This is the key phrase "In both cases, the density of ones in the serial digital output is proportional to the input signal value." So what it is doing in the most general terms is creating a PWM signal which represents the analog value, this signal is digitally averaged to produce the digital representation of the analog value.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10
Post Edited (Paul Baker) : 5/19/2006 12:57:38 PM GMT
Chip Gracey
Parallax, Inc.
Chip: Thanks for the explanation. It really sheds a lot of light on what's going on. I think it tells me enough to make some attempts at generating audio.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
I would like to have a crosscoupled counter to generate sine/cosine data at some audio frequency and then scale for volume befor outputing to a PWM DAC that cycles above audio frequencys.
But I need more information on the counter modules for PWM operation.
The crosscoupled counter to generate sine/cosine data is probably going to be to complex for the CTRA/CTRB since it involves scaled cross feedback, and needs to be in assembly .
Is there more info on the counter modules for PWM and DAC ?
1) The counters get used to delta-modulate I/O pins for DAC purposes.
2) Software performs ROM lookups and scaling for the DAC samples.
3) The system counter is used as sync mechanism via the WAITCNT instruction to re-run the sample/scale/output loop at a certain frequency.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
input threshold to the propeller chip? What will that do to the current consumption of that input buffer? Is there
hysteresis on the input? If so, how many millivolts? I'll have to scope those pins and see what's going on in there.
Those counters sure are flexible. I'm going to have to study this stuff a whole lot more.