Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 72

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
card. Thus, instead of digitizing sound effects, the technique used to save memory is to synthesize sound effects with
various techniques. Still, you can definitely do PCM with the Chameleon PIC and or develop a “Mod” player if you wish,
but at the output stage you only have a single bit, thus you have to use PWM to output your PCM data! More on this later.
14.1.2 Frequency Modulation (FM)
Frequency modulation with a fixed waveform is very easy to do and the Chameleon PIC can do this no problem. The
idea here is to output a square wave or sine wave directly to the output device and then modulate the frequency. So if we
use the Chameleon PIC’s internal timers we can do this (more on this later) or we can write a software loop to do it. For
example, if you wanted to hear a 500KHz, 1KHz, and 2KHz signal you just write a software loop that toggles the output
AUDIO_MONO at that rate and you will hear the sound on the attached output device. Figure 14.3 shows this graphically.
Now, there are a couple problems with this; first it’s not readily apparent how to “add” signals and play more than one
sound at once. In fact, it’s nearly impossible directly using this technique. Secondly, the only signal you can output is a
square wave, you can’t output sine waves. This tends to make the sounds have a “textured” sound since harmonics are in
the square wave. That is if you output a square wave at frequency f then you will find that there are harmonics at 3f, 5f,
etc. all these sine wave are what really make up a square wave. Take a look at Fourier transform theory to see this:
Of course our little low pass filter is going to filter most of these harmonics, but you aren’t going to hear a pure sine until
you increase the frequency to about the 3dB cutoff which may be desired.
In any event, if all you need is a single channel, some noise, pure tones, then FM with the AUDIO_MONO port at (P24) is
more than enough. You can use software or the built in timer in PWM mode to accomplish this as well, but you won’t have
any control over amplitude since you would be running the output at audio frequencies and not at PWM frequencies.
14.1.3 Pulse Width Modulation (PWM)
Pulse width modulation or PWM is a very clever way to create any kind of sound with a single bit of output! The bad
news is that the generation of the output and the algorithms needed are fairly involved and take a little bit of numerical
analysis, but once you get it working it’s not an issue and you can build libraries to create any sound you wish – in fact
many advanced synthesizers use PWM systems, so it’s very powerful.
To start with you might want to “Google” for PWM techniques and read up a bit. Watch out since most PWM references
are about using PWM for motor control. Here are a few PWM articles to get your started:
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/OWENS/LECT4/node2.html
http://www.freescale.com/files/32bit/doc/app_note/MC68EZ328PWM.pdf
http://www.freescale.com/files/32bit/doc/app_note/MC68EZ328DTMF.pdf
http://www.intel.com/design/mcs96/technote/3351.htm
http://ww1.microchip.com/downloads/en/AppNotes/00655a.pdf
http://archive.chipcenter.com/knowledge_centers/embedded/todays_feature/showArticle.jhtml?articleID=
10100668
Figure 14.3 – Synthesizing a single frequency.
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
72

Related parts for Chameleon-PIC