! You are not logged in to Prodigits. Please register or login.

VintageComputers - Topics

* VintageComputers > Topics


Subject: dsPIC based audio synthesizer
Replies: 16 Views: 2458
1-> 7->>

plzgvhug 18.02.12 - 02:55am
Hello folks, its been a while since i wrote anything so i thought i would tell you what im up to... I decided to add a synthesizer to my home made Z80 computer. I tried out several an*logue circuits as prototypes using op amps but they didnt sound that good. *

plzgvhug 18.02.12 - 03:04am
The classic designs of over 30 years ago used alot of discrete parts and chips that you cant get now and i dont have alot of board space. So ive decided to use a Digital Signal Processor or DSP to do all the work. I looked at many types of DSP and the microchip 16bit dsPIC looked like a good solution. *

plzgvhug 18.02.12 - 03:10am
I choose the dsPIC33FJ128GP802 which is available in standard dual inline package which makes it easy to prototype with and also because it has 128Kb flash ROM AND 16kb RAM. It also has a 12 bit ADC, dual 16 bit DAC'S, serial port, I2C bus, SPI bus and a host of other features. *

plzgvhug 18.02.12 - 03:18am
I wired the dsPIC up on a breadboard and connect it to my pickit3 usb programmer. Next i download and install the free version of the C30 C compiler which integrates itself into the MPLAB development inviroment. This free microchip PC based app allows me to write my software and program the dsPIC. *

plzgvhug 18.02.12 - 03:26am
There is alot of complex info i had to read to use the chip and get it running. It runs at 40Mhz and can do 40 MIPS execution speed. The first program i wrote was a simple turn an LED on and off at around 1 second intervals. *

plzgvhug 18.02.12 - 03:37am
Then i had to study the data sheet info some more as next i wrote a program to output a SAW wave using the 16 bit DAC's. The sample rate of the DAC's is upto 100K samples per second and they have 256x oversampling. Next i wrote another program to output a SINE wave but this is proving difficult. Sometimes i get a sine output but then i change a parameter in the program and it stops working. *

plzgvhug 18.02.12 - 03:47am
My SINE program looks like this... I create an array to hold a 256 samples of the sine wave values. Next i create a pointer (x) to the array. Next i create variables for amplitude and frequency and finally a constant PI. Thats 3.14159. Next i calculate the values for each sample and save them to the array so the code looks like this... *

1-> 7->>


* Reply
* VintageComputers Forum


fav Bookmarks

Search:
topics replies


* VintageComputers (8)

Custom Search