News:

SMF for DIYStompboxes.com!

Main Menu

Microcontroller advice

Started by zyxwyvu, November 16, 2006, 02:22:59 AM

Previous topic - Next topic

zyxwyvu

I would like some advice on microcontrollers:

1) Should I go with AVRs or PICs? Something else?
I want to do some audio processing, but I don't want to have to deal with expensive/surface mount components, and would rather stick with cheap DIP chips. I don't need really high quality ADC/DAC - I'm really just interested in playing around with these things.

2) Looking at both microchips and atmels sites, most of their microcontrollers seem to have 10 bit ADCs. Is this enough to sound decent? Also, on http://www.diystompboxes.com/smfforum/index.php?topic=47390.0, Celadine says that AVRs can't read any frequencies higher than 3.5kHz. Is this true? Would it significantly affect usage with audio?

3) All of their chips also seem to have PWM outputs. Am I correct in assuming these could be used as some kind of DAC? If so, how would I set it up?

4) What is a good programmer to go with? I'd rather pay a bit more to get something high quality. If I go with AVRs, it looks like I would go with the STK500, but I don't know much about PIC programmers. Any recommendations?

5) Are there any other special components I need to get a circuit working with a microcontroller, like crystals?

Thanks in advance for anyone's help on this!

PharaohAmps

In my experience, the simple microprocessors such as PICs and the various models from AVR aren't really suitable for processing audio on their own.  They're great for making flexible LFO's, doing control circuits, switching, things like that.  But for actually PROCESSING audio they fall a bit short.  Those 10 bit DACs are more for reading pots or capturing a voltage level, not so much for digitizing audio.  Add to that the memory limitations and you will eventually find that a general-purpose micro isn't the best choice for doing guitar effects.

But now we have the Spin FV-1:

http://www.spinsemi.com

The chip itself is SMD, but you can do everything else with through-hole.  Includes ADC and DAC on the chip, and all you need to actually program it is a cheap EEPROM programmer like:

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=120053115449

Says it's supported by ICProg, so all you'd have to do is use SpinASM to generate a .hex file, then burn it to your EEPROM.  Slot that in your board and you're off!

MUCH easier than trying to get any kind of audio performance out of an TinyAT or a PIC.  MUCH.  This chip is designed to do audio FX, has lots of delay memory (1024 milliseconds if you clock it at 32 khz,) and actually is pretty easy to program.  I've got a couple and I really like them.

Pharaoh Amplifiers
http://www.pharaohamps.com

RaceDriver205

Aye, AVRs and PICs are not for sound processing. They can do somethings with sound, but not processing. Its not their thing.

acromarty

Simple (and low to medium peformance) processors are not generally fast enough to do any serious audio processing, but they can be used usefully to manage or control an analogue based audio circuit, using analogue switches, digitally controlled potentiometers, etc.

With regard to the ADC and analogue input sampling, most ADCs have a set maximum sample rate or frequency. The maximum audio signal you can sample and reproduce the frequency content is half the sample frequency. To reproduce the shape of the input signal accurately, sinusoidal, square, clipped, then it is necessary to have many more samples in each signal period.

10 bits resolution and 3.5kHz bandwidth is just about enough for low-grade voice communications. The traditional telephone system generally has analogue bandwidth of about 3.5kHz. The low end microcontrollers that I work with have a 12 bit ADC and 8kHz sample rate, these can be used for voice applications but only when there is no requirement for any processor intensive encoding or compression.

PWM channels can be used as a low-cost analogue output by adding a low-pass filter to the output signal. The achievable analogue signal bandwidth depends on the PWM carrier frequency; again the absolute minimum is to have a carrier frequency at least twice the highest signal frequency. The low-pass filter needs to be steep enough to cut out as much as possible of the carrier frequency while allowing through as much as possible of the desired signal. If the carrier is only twice the maximum signal frequency then the filter implementation can be quite difficult, and a fifth or sixth order filter may be required to achieve reasonable performance.

For any major audio sampling and processing it is better to use something intended for high speed analogue input and output with at least 16 bits resolution and 20kHz sampling (adequate for a guitar :-). CD quality audio is 16 bits at 44.1kHz, higher quality audio processing systems use 20 or 24 bits resolution and 44.1, 48 or even 96kHz sampling.

I hope some of this makes sense....
Andy

zyxwyvu

Thanks for the informative respones!

Does anyone know where I could get one of those Spin FV-1's? How expensive would it be to start out with it (chip, programmer/extra hardware, assembler/ide/software)?

My goal with this digital stuff is to make a pitch shifter controlled by an expression pedal (like a digitech whammy). I am fairly certain I can do the programming - I have a lot of programming experience, including C and assembly on microcontrollers. Is the FV-1 a good chip for that?

Peter Snowberg

I don't want to rain on any parades, but pitch shifting is somewhat of a black art. There are lots of algorithms that perform it, but some are better for voice and some are better for music. The FV-1 has a very basic pitch shift program, but don't expect it to perform like a Whammy. If  you really want to explore ptch shifting, you'll need the resources of a larger DSP like the Freescale DSP56K serias.
Eschew paradigm obfuscation