switching ADC with multi channel
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2016-12-21 2:03 AM
Posted on December 21, 2016 at 11:03
Dear all
I am using ADC in stm8s105c6. I use ADC1 for two channel for example AIN9 and AIN8.
the problem is that when I switch the ADC1 from channel 9 to 8 the output result of the are being swapped.
the input signal which is connected to the channel 9 gives the result of the input signal which is connected to channel 8 and vice versa.
this the code that use.
ADC1->CSR &= 0x00;
ADC1->CSR |= 0x09; TIM1_SetCompare1(sample_average(pch1)); ADC1->CSR &= 0x00; ADC1->CSR |= 0x08; TIM1_SetCompare2(sample_average(pch2));(but when I use just one channel everything is ok);
Many Thanks for your help.
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
