So on my last order I picked up a few dsPIC33FJ128GP802's too fool around with - as an introduction to dsPIC's. I was going to make a little "development pedal" for myself to give me an easy to use platform for audio experimentation.
Before anyone starts spouting off reasons why I shouldn't use dsPIC's for this kind of thing, golden quality & extremely complex audio processing is not my end goal. I just want to experiment with dsPICs (specifically) a little and have a quick way to test out algorithms easily.
I just started putting the project together in my mind and felt like bouncing ideas off of you guys.
Alright, so the I/O will be:
- 2x8 Character LCD
- Two potentiometers (So I can do two parameter effects, or have one pot as parameter select and the other as parameter adjust - LCD makes this nicer to work with.)
- Footswitch - may be true bypass - but maybe I should have it momentary so that it can be multi-function?
- 1/8" input - I use a 0-5V signal through 1/8" for tap tempo on my board. Maybe tie this to an analog-enabled pin so that it can be used as either tap in or an expression pedal input depending on the code....
- Of course, mono in/out... internal 12-bit ADC / 16-bit DAC - with a bit of analog circuitry for buffering/filtering
- 6-pin header for programming with PICKit3
Dunno about external memory... Havent decided whether I want to implement any delay/reverb kind of effects yet... I have a couple of 23k256's...
This all goes into a little 3.5*4.5 folded enclosure.
Suggestions? I'll have to delve more deeply then I have so far to check that my ideas correspond to the capabilities of the chip before I make a prototype board, of course...
Save the on board A/D's for potentiometer reading and connect a proper audio A/D (in master mode generating all of the clocks) to SPI input (running as slave, if possible both SPI and DAC using DMA) instead. Use an ADC like CS5361 (or CS5351) available in SOIC24 (http://www.cirrus.com/en/products/cs5361.html) . Check the dsPIC datasheet for SPI, I guess you have to choose between I2S or left justified mode in ADC, and the dsPIC supports only 16 bit. Anyway, you should be able to use the LRCK out as /SS signal for SPI. That way you could sample the other channel (when LRCK=0) from the ADC SDATA output easily. You have to supply the MCLK to the ADC of course - the clock should be 256x or 512x the FS in master mode (so using for an example 8 MHz clock you should get around 31 kHz sample rate).
Now there is also this "dsPIC Functions" design by Eric Brombaugh you could for your project:
http://members.cox.net/ebrombaugh1/synth/dsPICfun/index.html
I've checked that the gerbers are BatchBCP compatible (after you rename the files).
The IC is more difficult to solder but I guess if you take the PCB and chip to a radio/ electronics repair shop they can solder the chip in for you easily.
Eric's also designed a proper signal processing board with onboard WM8731 CODEC and a 32k SRAM:
http://members.cox.net/ebrombaugh1/synth/dsPIC_sp/index.html
Because of the 32k SRAM that could be used also for delay based effects.
Quote from: JKowalski on February 18, 2011, 06:20:51 PM
So on my last order I picked up a few dsPIC33FJ128GP802's too fool around with - as an introduction to dsPIC's. I was going to make a little "development pedal" for myself to give me an easy to use platform for audio experimentation.
I have now one of those in my breadboard and I'm starting to play with it. Fun stuff. I like the fact that it has almost everything I need in a chip, (ADC, DAC; PWM, DSP, etc...) and in a DIP format. So with a minimal part count circuit you can have a digital development platform. (and, you can even get free samples from Microchip).
I've programmed some basic things like a tremolo, a delay and a flanger, and so far I find it really useful as a tool to get introduced to the digital world.
The only thing I miss is more memory, with the internal 16k I could only get delay of around 300ms at 22khz sampling rate.
I plan sooner or later to add and SCCARD and try to see if I can create a looper with it.
If you find a good solution to add additional memory, let us know.
Mat
Quote from: mhelin on February 19, 2011, 04:58:16 AM
Save the on board A/D's for potentiometer reading and connect a proper audio A/D (in master mode generating all of the clocks) to SPI input (running as slave, if possible both SPI and DAC using DMA) instead. Use an ADC like CS5361 (or CS5351) available in SOIC24 (http://www.cirrus.com/en/products/cs5361.html) . Check the dsPIC datasheet for SPI, I guess you have to choose between I2S or left justified mode in ADC, and the dsPIC supports only 16 bit. Anyway, you should be able to use the LRCK out as /SS signal for SPI. That way you could sample the other channel (when LRCK=0) from the ADC SDATA output easily. You have to supply the MCLK to the ADC of course - the clock should be 256x or 512x the FS in master mode (so using for an example 8 MHz clock you should get around 31 kHz sample rate).
Now there is also this "dsPIC Functions" design by Eric Brombaugh you could for your project:
http://members.cox.net/ebrombaugh1/synth/dsPICfun/index.html
I've checked that the gerbers are BatchBCP compatible (after you rename the files).
The IC is more difficult to solder but I guess if you take the PCB and chip to a radio/ electronics repair shop they can solder the chip in for you easily.
Eric's also designed a proper signal processing board with onboard WM8731 CODEC and a 32k SRAM:
http://members.cox.net/ebrombaugh1/synth/dsPIC_sp/index.html
Because of the 32k SRAM that could be used also for delay based effects.
Thanks for all the info. I'll consider the external ADC. Was hoping to piece this together from parts I have stocked (no ADC's only DACs :icon_neutral:) so that alone might sway me.
I have 5 SOIC versions of the chip and one SPDIP, so I might try more then one board if I find I want to revise it.
Quote from: potul on February 20, 2011, 06:00:46 AM
Quote from: JKowalski on February 18, 2011, 06:20:51 PM
So on my last order I picked up a few dsPIC33FJ128GP802's too fool around with - as an introduction to dsPIC's. I was going to make a little "development pedal" for myself to give me an easy to use platform for audio experimentation.
I have now one of those in my breadboard and I'm starting to play with it. Fun stuff. I like the fact that it has almost everything I need in a chip, (ADC, DAC; PWM, DSP, etc...) and in a DIP format. So with a minimal part count circuit you can have a digital development platform. (and, you can even get free samples from Microchip).
I've programmed some basic things like a tremolo, a delay and a flanger, and so far I find it really useful as a tool to get introduced to the digital world.
The only thing I miss is more memory, with the internal 16k I could only get delay of around 300ms at 22khz sampling rate.
I plan sooner or later to add and SCCARD and try to see if I can create a looper with it.
If you find a good solution to add additional memory, let us know.
Mat
How did you set your chip up for the mentioned effects? Are you using the internal ADC/DAC and if so what is your opinion of them?
So far I've used both internal ADC and DAC. They sound good to me... :). I know it's not Hi-Fi (12bits ADC only, but 16 bits DAC), but sounds decent to me. My intention is not to build a pro thing, just to play around with digital processing, so it's good enough for me.
I've basically setup the ADC and DAC to work at 22k sample rate, and programmed a delay line using the maximum available memory, and an LFO. With these 2 elements you can easily achieve most of the modulation based effects. Delay is somehow limited because of the available memory.
Let me see if I can post a video or audio so that you can hear it...
Regards.
Mat
Going back to your question though, what I would have in mind would be (this would be my whishlist, or at least, this is what I'm aiming to):
-LCD display (could be 2x8 or 2x16, it's just a question of space)
-3 pots
-MIDI IN/OUT
-Some buttons to interface with the configuration. At a minimum one "enter button".
-One momentary stompswitch or two. (these could replace the previous ones), in addition to a bypass hardwired switch for the truebypass lovers.
-Maybe an expression pedal IN?
-SDCARD interface using SPI. (well..... not really needed, but could be great for a looper or similar)
-One programmable LED or two if possible (nothing beats an LED, not even an LCD... )
wow,..... I think my list is getting too big... it will not fit any box. :), and will run out of i/o pins...
Quote from: potul on February 21, 2011, 12:30:13 PM
Going back to your question though, what I would have in mind would be (this would be my whishlist, or at least, this is what I'm aiming to):
-LCD display (could be 2x8 or 2x16, it's just a question of space)
-3 pots
-MIDI IN/OUT
-Some buttons to interface with the configuration. At a minimum one "enter button".
-One momentary stompswitch or two. (these could replace the previous ones), in addition to a bypass hardwired switch for the truebypass lovers.
-Maybe an expression pedal IN?
-SDCARD interface using SPI. (well..... not really needed, but could be great for a looper or similar)
-One programmable LED or two if possible (nothing beats an LED, not even an LCD... )
wow,..... I think my list is getting too big... it will not fit any box. :), and will run out of i/o pins...
Thanks, definitely helps.
I think I'll go with the internal ADC/DAC for now then... 2x8 LCD, 1/8" exp pedal / tap in, moment footswitch, 2 pots, two buttons, 23k256 for memory?, status LED.
Depending on how that goes, maybe I'll make another medium sized box with upgrades in the future (16-bit ADC / CODEC, more I/O...).
Alright, I did some more planning:
Preliminary schematic (sans analog I/O section)
(http://img705.imageshack.us/img705/2299/dspicdevboardan.png)
If you spot any bad pin assignments or w/e please let me know.
Ran out of IO pins to do EVERYTHING I wanted. All that is missing is a spot for a second 23k256, which I guess is not that important.
Soooo, new IO
-LCD is controlled by 4-bit, RS, RW, EN
-DAC differential output
-ADC 12-bit input
-Two analog CV's (pots)
-One analog input (expression pedal) & associated digital input (1 is CV ON 0 is CV OFF, generated by switched input jack)
Basically the controls work like this. One pot is the parameter select, with it you choose the parameter to alter and the parameter shows up on the LCD. The other pot is the value adjust, with it you adjust the value of
whatever parameter is selected. That way I can emulate a ton of controls. If the CV digital input is 1, then the value adjust pot is replaced by the CV... Whatever parameter is selected can be controlled by the expression
pedal instead.
-23k256 SRAM SPI interface
-One footswitch digital input
-True bypass footswitch
Oooh.... too bad you ran out of pins....
Quick tip if you want to save some pins, at the cost of adding one IC:
-I've used with success a 2-wire interface to an LCD, based on a shift register. You can see the concept here (this is where I got it):
http://www.rentron.com/Myke1.htm (http://www.rentron.com/Myke1.htm)
It will save you 5 I/O pins!
Another way to get 2 extra pins is to not use the external Xtal, and use internal oscillator. This PIC allows to go up to 40 MIPS with the internal oscillator, but it will be less accurate. I've used it in my workbench without noticing any timing issues.
On the other hand, a question regarding power. I see everywhere 5v (from the LM2937), but this dspic should be powered with 3.3v. this will add some complexity when connecting to other devices like the ADC in or the SPI memory. I think you should review it.
Regards,
Mat
Oh, one more remark.
If you have only one SPI device (the memory), Maybe you can skip the CS (although I don't have a clue if it can be used for something else). If you need to add another SPI memory, you can share the SDI, SDO, SCK pins, and you just need to add 1 CS per memory IC. (if you need only 2, maybe you could use just one CS and a NAND gate?).
Mat
Forget it, you will probably need the CS pin to initialize the memory.... (at least it is true with an SDCARD)
And..... another thought that can save 2 pins:
-If you plan to use the expression input always as a replacement of the on-box pot, you could do it via hardware, reusing the same ADC pin, and with a switch to connect/disconnect the pot/expression. This way you save 2 pins (the CV in and the expression pedal).
Just brainstorming....
Quote from: potul on February 25, 2011, 10:47:53 AM
And..... another thought that can save 2 pins:
-If you plan to use the expression input always as a replacement of the on-box pot, you could do it via hardware, reusing the same ADC pin, and with a switch to connect/disconnect the pot/expression. This way you save 2 pins (the CV in and the expression pedal).
Just brainstorming....
Thanks a ton for the ideas.
I actually got rid of the LCD display R/W control to save a CS pin for the second SPI device. I also set it up so it is a little open for change - fits SRAMs, EEPROMs... I think with that the second SPI everything is okay.
I know it runs off of 3.3v, the reg used comes in 3.3V versions (http://www.national.com/mpf/LM/LM2937-3.3.html#Overview) and was just there as a placeholder anyways - since I don't have any 3.3v regs with me I think I will end up using an LM317.
I also realized that the LCD I am using has the backlight permanently attached to the power inputs (no separate backlight pins, dam) and must run off of 5V to get any light. I dont think this will be a problem though, since it looks like the LCD threshold levels are 2.4V and since the RW pin is not used (permanent write) there won't be any 5V outputs to deal with from the LCD module. The SRAM is made to run off of 3.3V, so no problems there.
So the power supply is 9V for analog I/O, into two regs - LM7805 for LCD and LM317 at 3.3V for digital.
The CV replacement through hardware is a good idea but I was also thinking about maybe having that available as a digital I/O as well, for tap sync/external FS or whatever.
Ill post some pics when I get home, I started building the enclosure. It's a tiny little thing.
Right now I am drawing up a preliminary PCB and writing some psuedocode (trying to optimize timing, thats whats nice about ASM :icon_biggrin:)
Looks like I can sample all the control ADC's in one go (nice)...
So I am totally new to the dsp concept. I assume that I set the sample rate of the ADC, and when it periodically samples the audio input it triggers an interrupt, where the dsp algorithm is carried out and the output is written to a buffer for the DAC. The DAC maybe does the conversion at the same time as the ADC from the buffer...
And then the program main loop carries out the I/O functions in the background...
I'll start writing & researching some code for a while to make sure I understand the concept before etching a board for it.
Here's the box so far.
(http://img806.imageshack.us/img806/2392/snapshot201102254.jpg)
wow, the box looks great!
regarding the ADC - DAC... There are multiple ways to set them up. You can setup the ADC for a sampling rate or configure it to sample "on demand". The DAC can only we set to a sampling rate based on the clock and some post scalers.
Both ADC and DAC can we setup to use DMA.
This is how I have it configured in my bench right now in order to have both in sync: The DAC is setup for the desired sampling rate (22k in my case). I have an infinite loop that checks for the DAC buffer to be "not full" (needing more data), and when this happens I read the ADC and trigger a new sampling+conversion, do all the calculations and send the output value to the ADC. (this should be done probably using an interrupt instead)
But there's multiple ways to skin a cat... DMA looks interesting if you want to process a large amount of samples in batch (like FFT or similar), because it allows the system to be collecting all data without CPU intervention, and when the full sample is ready, do your calculations.
As I'm working now on algorithms that need to be computed on each sample, I don't use DMA.
Mat
Quote from: potul on February 26, 2011, 05:38:38 AM
wow, the box looks great!
regarding the ADC - DAC... There are multiple ways to set them up. You can setup the ADC for a sampling rate or configure it to sample "on demand". The DAC can only we set to a sampling rate based on the clock and some post scalers.
Both ADC and DAC can we setup to use DMA.
This is how I have it configured in my bench right now in order to have both in sync: The DAC is setup for the desired sampling rate (22k in my case). I have an infinite loop that checks for the DAC buffer to be "not full" (needing more data), and when this happens I read the ADC and trigger a new sampling+conversion, do all the calculations and send the output value to the ADC. (this should be done probably using an interrupt instead)
But there's multiple ways to skin a cat... DMA looks interesting if you want to process a large amount of samples in batch (like FFT or similar), because it allows the system to be collecting all data without CPU intervention, and when the full sample is ready, do your calculations.
As I'm working now on algorithms that need to be computed on each sample, I don't use DMA.
Mat
Do you know of some good code examples for simple DSP programs in ASM? All microchip's examples seem to be in C.
My plan is to write this code to be as "modular" as possible, I.E. a basic skeleton interface to the I/O with the core dsp program stuck in the middle and very extensive comment documentation. The main loop getting all the I/O done in the background, storing control info to standard memory locations that the dsp program accesses. Hopefully I can get it to a point where I can easily introduce new effects with minimal GPIO worries. Will also necessitate a nice library of subroutines. I'll post the schematics/layout/code here once I am done.
All the code examples are in C...., and I'm also using C. These 16 bits PICs are supposed to be optimized to work in C. But most of the basic steps to get the ADC working should be the same as it is just a matter of configuring the ADC registers and read data from memory. Same for the DAC.
Coding the DSP algorithms is something more complex, and I haven't found any good example... I can't really help here. In fact, I'm not using the DSP yet, all my calculations are done by the MCU.
Mat
Quote from: potul on February 27, 2011, 06:47:12 PM
All the code examples are in C...., and I'm also using C. These 16 bits PICs are supposed to be optimized to work in C. But most of the basic steps to get the ADC working should be the same as it is just a matter of configuring the ADC registers and read data from memory. Same for the DAC.
Coding the DSP algorithms is something more complex, and I haven't found any good example... I can't really help here. In fact, I'm not using the DSP yet, all my calculations are done by the MCU.
Mat
I should start looking into C for uC's. I know how to write in C, I just never applied it to uC's yet. I'm much more comfortable writing in ASM.
The main reason I wanted to take a peek at sample code is to get a global view of how to use dsPIC's (methods to configure the analog data path) and get more comfortable with the host of new ASM commands the dsPIC's give you. I tend to learn really well by parsing other people's code more then anything.
Here's an updated schematic. The power lines are correctly labeled, tentative analog I/O (is it worth it to put analog limiting before the ADC?), second SPI in, parts labeled
(http://img703.imageshack.us/img703/2299/dspicdevboardan.png)
I've just found this link:
http://spinlab.wpi.edu/projects/dspboard/dspboard.html
There's a realy good project report with schematic and source code inluding 6 detailed DSP based LAB assignments
They use a dsPIC33FJ128GP802 with a TI TLV320AIC23 stereo audio codec.
JC
Quote from: JMCTech on February 28, 2011, 12:57:17 PM
I've just found this link:
http://spinlab.wpi.edu/projects/dspboard/dspboard.html
There's a realy good project report with schematic and source code inluding 6 detailed DSP based LAB assignments
They use a dsPIC33FJ128GP802 with a TI TLV320AIC23 stereo audio codec.
JC
Interesting, I didn't know that the dsPIC33FJ128GP802 has DCI port because the dsPIC33 selection table column for the codec interface (I2S, AC97) says "NO". I though read on MC forums that the selection table is wrong / has errors and that the part does really have the DCI interface. Which means also the DIP (though hole) part has so you could for an example use the Mikroelektronica CODEC board with these parts easily.
Quote from: JMCTech on February 28, 2011, 12:57:17 PM
I've just found this link:
http://spinlab.wpi.edu/projects/dspboard/dspboard.html
There's a realy good project report with schematic and source code inluding 6 detailed DSP based LAB assignments
They use a dsPIC33FJ128GP802 with a TI TLV320AIC23 stereo audio codec.
JC
Thanks, that's a great resource.
I am considering adding a digital potentiometer for analog feedback purposes - SPI so interface is already set up.
I was musing over the fact that delay would not be possible in the current configuration, since there is no feedback, and the board is built as a software oriented dev platform, not hardware.
Thoughts? Means I would have to find ANOTHER input pin to use for CS :icon_rolleyes: Maybe I will do the hardware CV/pot switching after all.
Potul, you said you were using C to program the dsPICs.... What compiler are you using? I see that the microchip one is free 60 days / indefinitely with limited options... Are you using the limited version or some third party compiler?
I starting writing the code in ASM, it's going okay. I read the whole instruction set to familiarize myself with the commands and my options, WOW it is huge compared to the 8-bit IS's. Very versatile though, many commands I felt were sorely missing in the 8-bit IS's. (bit toggle, so nice)
I also found a good example code for ASM, for audio effects no less, which has proved helpful in letting me know how the chips should be set up:
burnit.co.uk/sdiy/index.php?page=4xd
Quote from: JKowalski on March 02, 2011, 02:07:03 PM
Potul, you said you were using C to program the dsPICs.... What compiler are you using? I see that the microchip one is free 60 days / indefinitely with limited options... Are you using the limited version or some third party compiler?
I'm using C30 evaluation version. After 60 days everything still works, but code is less optimized.
BTW, and maybe a little offtopic.... One idea I stumbled with when searching for other stuff....
I was thinking of using 2 rotary encoders instead of pots, but the fact that they need 2 I/O pins each was a showstopper. But, I realized that:
-You can read multiple switches with a single ADC input, setting up an R2R resistor ladder. That is basically an DAC... so you read the analog value, and depending on this value you can know which switches are on and which off. This opens up a lot of room for pin optimization (debouncing might be tricky, though). So I could use a single ADC input to read 2 encoders. (4 bits), and even add another switch to it.
-The same applies to Pots. If you can afford to have half pot resolution, you can feed 2 pots in the same ADC input. The MSb will represent one pot, the LSb the other one.
I will see if I can get my hands on a rotary encoder and try... but it will take me some weeks.
Mat
I doubt it. The current status of the encoder signals doesn't mean anything. You need to know the previous value of the signals to compare it with the current to know if you're going forwards or backwards.
One detent of the encoder outputs the following:
1100
1001
If we rotate the encoder what will happen?
from:
v
11001100
10011001
to:
v
11001100
10011001
old = 1,(1)
new = (1),0
direction = 1 xor 1 = 0 (xor of the numbers in parenthesis) - moving CW
from:
v
11001100
10011001
to:
v
11001100
10011001
old = 1,(0)
new = (0),0
direction = 0 xor 0 = 0 (xor of the numbers in parenthesis) - moving CW
Now in the other direction:
from:
v
11001100
10011001
to:
v
11001100
10011001
old = 1,(1)
new = (0),1
direction = 0 xor 1 = 1 (xor of the numbers in parenthesis) - moving CCW
from:
v
11001100
10011001
to:
v
11001100
10011001
old = 0,(1)
new = (0),0
direction = 0 xor 1 = 1 (xor of the numbers in parenthesis) - moving CCW
and so on...
Another easy way to see it is to look at a longer sequence:
110011001100110011001100
100110011001100110011001
If you move the botton row one step further you'll see how xor'ing them will always return 0:
110011001100110011001100
100110011001100110011001
If you move the botton row one step back you'll see how xor'ing them will always return 1:
110011001100110011001100
100110011001100110011001
I know this is a bit confusing, i hope my explanation makes sense.
Encoders are mechanical and their datasheets specify a certain amount of "contact bounce".
Unless you are using optical encoders (which are generally a lot more expensive), the mechanical contacts are going to bounce and you are never going to get a steady stream of ones and zeroes as Galego suggests.
Even the encoders he uses specify: "Contact Bounce ( at 15 RPM) 5.0ms max."
http://www.bitechnologies.com/pdfs/en11.pdf (http://www.bitechnologies.com/pdfs/en11.pdf)
This bounce has to be dealt with in the code or it will result in false data with unexpected results.
Determining the debounce algorithm that suits your encoder (in fact you will need to test a number of encoders from the same batch to find a happy medium) and the speed range at which you expect people to turn them takes trial and error and will be different depending on the complexity of your code and the number of interrupts that are competing for CPU cycles.
I don't have the habit of looking for solutions to problems i don't have. What i said was that I had no problems with those encoders and i'll add that it works with PIC16F684, PIC16F88, PIC16F877 and PIC18F2550 running at 8-20MHz.
I'm not saying there isn't a situation where you'll need debouncing, interrupts or whatever, but i can guarantee that it works just fine in the experiments i've made.
You can bring up all the info you want, but If i had any issues with it, i don't see a reason why i would say otherwise. So please stop insinuating that i'm deceiving people, and stop putting words in my mouth.
Quote from: Galego on March 06, 2011, 08:15:59 AM
I doubt it. The current status of the encoder signals doesn't mean anything. You need to know the previous value of the signals to compare it with the current to know if you're going forwards or backwards.
I don't see the relationship of this with what I commented regarding using an ADC and an R2R ladder. You can continuously poll the ADC value the same way you poll continuously the value of digital inputs.
Quote from: Galego on March 06, 2011, 12:47:24 PM
I don't have the habit of looking for solutions to problems i don't have. What i said was that I had no problems with those encoders and i'll add that it works with PIC16F684, PIC16F88, PIC16F877 and PIC18F2550 running at 8-20MHz.
I'm not saying there isn't a situation where you'll need debouncing, interrupts or whatever, but i can guarantee that it works just fine in the experiments i've made.
You can bring up all the info you want, but If i had any issues with it, i don't see a reason why i would say otherwise. So please stop insinuating that i'm deceiving people, and stop putting words in my mouth.
I'm not trying to insinuate anything.
You have said repeatedly that your project is working fine. I don't doubt this is true.
My experience was very different with encoders. I spent a couple weeks getting them to work fluidly with Molten MIDI 2. This probably had to do with the fact that a whole lot of interrupts were involved and much more complex code, but I also had issues with switch bouncing. I use the Bourns encoders, so maybe the ones you use don't bounce nearly as much.
I am just pointing out that your simplification of the issues is not a universal truth. Encoders bounce. Even the manufacturers tell you so. If it doesn't create problems with your project, then it doesn't, but that does not mean it is an issue that can always be disregarded.
Again, my apologies if you feel insulted. That wasn't my intent.
-------------------
Re Potul's comments,
I don't think you can use two pots an a single ADC input, because the voltages would not be separate, so they could not be read apart from each other. Instead you would read the higher of the two.
With encoders, it might work if you had two separate voltages where they are held "high" and the rest state is 0v, but for any encoder I have seen, the rest state is +V.
Quote from: MoltenVoltage on March 06, 2011, 04:36:14 PM
Re Potul's comments,
I don't think you can use two pots an a single ADC input, because the voltages would not be separate, so they could not be read apart from each other. Instead you would read the higher of the two.
With encoders, it might work if you had two separate voltages where they are held "high" and the rest state is 0v, but for any encoder I have seen, the rest state is +V.
Oops, you are right, I was taking some bad assumptions... it will never work with 2 pots. But it should be possible with encoders. I've just purchased some encoders from ebay, once I receive them I will try.
Mat
Sorry for the bump, but I'm extremely interested in this project...I have been thinking of doing something similar myself.
Any update to this? How does it sound? Were you able to get anything useful out of it?
My particular dsPIC project is still WIP. I'm not dedicating much time to it lately, but I was able to use some simple effects (flanger, short delays...), and I'm in the middle of developing a looper.
Mat
Quote from: potul on March 07, 2011, 08:18:10 AM
Quote from: MoltenVoltage on March 06, 2011, 04:36:14 PM
Re Potul's comments,
I don't think you can use two pots an a single ADC input, because the voltages would not be separate, so they could not be read apart from each other. Instead you would read the higher of the two.
With encoders, it might work if you had two separate voltages where they are held "high" and the rest state is 0v, but for any encoder I have seen, the rest state is +V.
Oops, you are right, I was taking some bad assumptions... it will never work with 2 pots. But it should be possible with encoders. I've just purchased some encoders from ebay, once I receive them I will try.
Mat
System clock-driven CD4060 plus CD4051 allows the use of 8 separate pots while using only a single pin on the PIC (one ADC input only).
cool! How did the loopback sound? Did you AB it? Did you learn anything about codecs - are you using anything besides the built in ADC and DAC?
Thanks!
Hal
What I tried is a Looper, so record-playback-overdub... Here you can see some testing:
http://www.youtube.com/watch?v=TOBXiai4FoI (http://www.youtube.com/watch?v=TOBXiai4FoI)
And here some effects with the same unit.
http://www.youtube.com/watch?v=Yj0t6TNvrgM (http://www.youtube.com/watch?v=Yj0t6TNvrgM)