Skip to main content
stuart239955
Associate II
June 15, 2011
Question

Timer4 trigger for ADC

  • June 15, 2011
  • 24 replies
  • 5542 views
Posted on June 15, 2011 at 10:15

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-documentation
This topic has been closed for replies.

24 replies

bougarech
Visitor II
May 24, 2015
Posted on May 24, 2015 at 20:28

is it possible to modify the interrupt handler to get it more faster than 1Khz??

Tesla DeLorean
Guru
May 24, 2015
Posted on May 24, 2015 at 22:46

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 32KB

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
puneethj
Associate III
August 28, 2015
Posted on August 28, 2015 at 10:26

Hello Every body, Can some one let me know how to use ADC Hardware Trigger? Thank You

Tesla DeLorean
Guru
August 28, 2015
Posted on August 28, 2015 at 20:22

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&currentviews=20]your own thread rather than off-topic this one (STM32F1 TIM4 Triggering ADC)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..