cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32F303 Timer1-Prescaler Problem

Bench
Associate III

Hello all,

I am using the nucleo Board Stm32F303Ze where I want to trigger the ADCs with Timer1 after 3 or 5 cycles when the Timer is set to 144 MHz. The configuration is done in CubeMX.

Generally the triggering of the ADCs and the transmission via DMA and USART3 works perfect so far. However, this is only the case when I put the Prescaler ot the Timer to 100 or higher (even with lower timer frequencies). A lower Prescaler value doesnt work. The ADC-Clock is set to 72MHz.

Has anybody an idea why it works only for high Prescaler values? I also tried different optimizer levels which did not change the behavior.

Thank you a lot in advance!

Best regards

8 REPLIES 8
henry.dick
Senior II

Google isr overhead​

Bench
Associate III

Hi,

thank you a lot for your help! You are right. So I think an interrupt after one ore some periods is not possible in that way. Is there a hardware solution, that I can configure the ADCs to sample after e.g. 30ns?

Thank you and best regards,

henry.dick
Senior II

Easy.

.

1. If you have to use onboard adc,find a mcu capable of such sampling speed.

2​. If you are ok with outboard adcs, use one or more of them and interlace their sampling sequence. Pay attention to the adc / mcu interface.

Bench
Associate III

Thanks for your answer!

I have to trigger all 4 internal ADCs, that after a certain time interval after a given point of time all of them start to sample simultaneously. They dont have to have a sampling time of 30ns its just the time after which they should start. So for me it is interesting to find a way to trigger the ADCs simultaneously accurately after 30ns. After the sampling all Adcs can pause for about 1ms, so there should be enough time to process the aquired data. Do you know something how to realize this?

henry.dick
Senior II

That's even easier.

1​. Pick a St mcu with 4 adc modules. Or pick 4 mcus, each with one adc module.

2. Trigger them at once. ​

Bench
Associate III

Yes this is what I try to do with the stm32f303ze. That works so far. But I only want to have a delay between start of eg Timer and start of ADCs-Sampling of about 30-50ns. Is this feasible?

henry.dick
Senior II

sure. read the datasheet to see how the adc can be triggered. in general, you can trigger them via software: one instruction via shadow registers or 3 or more instructions via rmw. hardware triggering is simpler.

Bench
Associate III

perfect, thank you! You helped a lot!

Best regards