STM32F103 Dual ADC with DMA skips channel
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-03 6:38 AM
Posted on November 03, 2016 at 14:38The original post was too long to process during our migration. Please click on the attachment to read the original post.
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-03 8:18 AM
Posted on November 03, 2016 at 16:18
Well. What a bit of rubber duck debugging can't fix, heh...
1. The skipped channel was caused since the ADC was written to while ADC_CR2_CAL was on.Fix:/* Power ON */
ADC1->CR2 = ADC_CR2_ADON | ADC_CR2_CAL; ADC2->CR2 = ADC_CR2_ADON | ADC_CR2_CAL; /* Wait 4 ADC cycles, 24 cpu cycles */ timeout = 24; while(timeout--); /* Auto Calibrate */ ADC1->CR2 |= ADC_CR2_CAL; ADC2->CR2 |= ADC_CR2_CAL; while(ADC1->CR2 & ADC_CR2_CAL); while(ADC2->CR2 & ADC_CR2_CAL); // Clear all flags ADC1->SR = 0; ADC2->SR = 0;2. After this, an address misalignment occurred using the DMA. This was caused by setting ADC_CR2_DMA before turning on the DMA channel. This causes an inevitable DMA operation (with CAL results) when turning the DMA channel on.So many little things aren't in the manual...Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-11-03 8:53 AM
Posted on November 03, 2016 at 16:53
So many little things aren't in the manual...
Somehow I suspect a manual that covered all the minutiae of the implementation would be impenetrable, and it is not as if most people read it now anyway..
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
