Hi
Im designing my first C++ based project. I'm using the STM32F205 MCU (Netduino 2) and need some suggestion on ADC-input and PWM-output config/setup. I noticed both ADC and PWM has many different possible configurations and I'm having a hard time deciding how to configure them. I've found project examples that to some extent cover both, but again, a lot of different config options.
Hopefully someone can point me in the right direction for the config as I find the amount of options quite overwhelming (for ADC interrupt generation, interleaved more, dual/triple mode, continuous conversion mode etc., for PWM edge-aligned mode, center-aligned mode, 6-step PWM gen., one pulse mode etc.).
STM32F2xx manual can be found here: http://www.st.com/st.../CD00225773.pdf
What I'm building is a digital guitar effect pedal, that does real-time DSP.
The project I'm building will have four ADC channels. The ADC will read input data continuously, and the data is not meant to be saved, as the system does real-time processing only.
Three of the ADC channels will read control-signals (potentiometers), meaning they do not require a high samplerate (ADC reading speed). I'm thinking 1kHz or more. Full ADC bit-depth (12-bit) is necessary.
The last ADC channel is meant to read a input audio-stream. This channel will need to have a high samplerate (Im thinking 96kHz or higher). Full bit-depth is necessary.
The four input signals are connected to PC1, PC3, PC4 and PC5 of the chip, PC1 being the audio input. I was thinking I could use ADC1 or ADC2 for all four inputs, and multiplex between the different ADC channels using "Channel-wise programmable sampling time" (p. 212) to give PC1 a higher samplerate than the others.
The project will have one PWM output. I'll be using Timer 8 (TIM8), assigned to PC7. The PWM output is meant to generate waveshapes. The PWM should be configured for a bit-depth of 12 or 16 and the samplerate of the PWM stream should be equal and in sync with the samplerate of the ADC channel connected to PC1. I would achieve this with one of the basic timers (TIM6 or TIM7 p. 463) or a interrupt routine (any suggestions on this?)
Hopefully this says something about the mode to which I should configure the ADC and PWM.
Any and all response is greatly appreciated!