2011-06-15 01:15 AM
Hi,
Using STM32F103. I want to use the external trigger mode of the ADC to start a regular group of channels (in dual, simultaneous mode) via the TIM4 CC4 Event. The examples that ST provide illustrate using TIM1 CC1 event using a pwm OUTPUT channel to trigger the ADC. I wish to trigger my regular channels via INPUT capture on TIM4 channel4. Is this possible? The documentation seems to suggest so. I have tried using a basic example, but to no avail. The TIMER4 input capture event occurs, but doesn't trigger the ADC. I can manually trigger the ADC via software, so am not sure what could be wrong. Is there some trick that I am missing here? Is there an example someone could send me? Also note that I am doing a full remapping TIMER 4 pins. I'm using my own code - not using the library, so have not got any code to fully illustrate this yet, sorry. Any ideas would be most welcome. Thanks, #adc-trig-in-dual-mode #poor-quality-of-documentation2015-05-24 09:37 AM
Ok, it's triggering the samples at 200 KHz (200000 Samples per second). The comments reflect the behaviour I expect, these could be confirmed with an oscilloscope.
The buffer holds 400 samples, and interrupts at the half and end points. ie every 200 samples, and thus with a rate of 1 KHz into the handler. The math here is not complex, you could make the buffer bigger to reduce the interrupt rate. You'll need to config the CPU/AHB/APB clocks to get a clean integer division of you sample rate.2015-05-24 11:28 AM
2015-05-24 01:46 PM
One could make the buffer smaller. Increasing the interrupt rate is probably not particularly desirable as you'll just burn instructions less efficiently. The 1 KHz rate was chosen as it's easy to scope.
The reason the buffer is split in two (ping-pong) is that the DMA continues in the background, and it's desirable to operate on data that's not going to change underneath you. If you plan on recording data to a file, you want the buffer to be large enough that the write operation is most efficient, ie some power of two greater than 512, and ideally at least a cluster length, or 32KB2015-08-28 01:26 AM
Hello Every body, Can some one let me know how to use ADC Hardware Trigger? Thank You
2015-08-28 11:22 AM
Let's try to keep this in [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/ADC%20External%20Trigger&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx¤tviews=20]your own thread rather than off-topic this one (STM32F1 TIM4 Triggering ADC)