i'm currently using the last available ChibiStudio release (With ChibiOS eclipse tools 2.5.0) and a STM32F401RE Nucleo board, i quite like them and i'd like to learn more.
Actually i'm getting problems with sampling: what i'd like to do is to sample two different signals from A0-A1 pins.
I read it's not possible to do that simultaneously with this board but sequentially.
I wrote some code but it isn't working properly, i mean it looks like the adc only reads the voltage on A0.
The demo i'm following is this: http://www.playembedded.org/blog/wp-con ... PT-ADC.zip
I modified that code in this way:
Code: Select all
static const ADCConversionGroup adcgrpcfg1 = {
true,
ADC_GRP1_NUM_CHANNELS,
adccallback,
adcerrorcallback,
0, /* CR1 */
ADC_CR2_EXTEN_0 | ADC_CR2_EXTSEL_3, /* CR2 */
ADC_SMPR2_SMP_AN0(ADC_SAMPLE_144) | ADC_SMPR2_SMP_AN1(ADC_SAMPLE_144),/* SMPR1 */
0, /* SMPR2 */
ADC_SQR1_NUM_CH(ADC_GRP1_NUM_CHANNELS), /* SQR1 */
0, /* SQR2 */
ADC_SQR3_SQ1_N(ADC_CHANNEL_IN0) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN1)/* SQR3 */
};
then added some chprintf instructions in order to see values on my terminal. Where am i wrong?
Thank you for your time.