cancel
Showing results for 
Search instead for 
Did you mean: 

An interrupt question of STM32F103RCTx

Richard Huang
Associate II
Posted on March 01, 2018 at 01:52

Hello predecessors,

I would like to ask a question about external interrupt.

I tried to use STM32F103RCTx to develop a Galileo Signal Generator.

Development environment is STM32CubeMX + Keil uVision5.

TIM2 produces 6M Sub-carrier frequency, TIM3 produces 1M Sub-carrier frequency.

PA3 receives TIM3 as the external interrupt trigger, and outputs the Code from PortC.

The program code is as follows, in order to verify the correctness of the program.

I set the CODEC[ ] to 0, 1, 0, 1 ..., 1

void EXTI3_IRQHandler(void)

{

GPIOC->BSRR = CODEC[Data_Counter];

Data_Counter++;

if (Data_Counter >= 4092){

Data_Counter = 0;

}

HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_3);

}

However, I found a problem that the output of PortC could not keep up with the trigger source every 1mSec.

It looks like STM32 has an unknown interrupt every 1mSec be executed once.

The following are screenshot from the oscilloscope.

Would like to ask whether you have encountered the same problem? How to solve?

Thank you all.

0690X00000604FHQAY.jpg

0690X00000604R5QAI.jpg0690X00000604QvQAI.jpg
4 REPLIES 4
Pavel A.
Evangelist III
Posted on March 01, 2018 at 02:09

It looks like STM32 has an unknown interrupt every 1mSec be executed once.

Why, it is quite well known... the systick.

-- pa

Posted on March 01, 2018 at 04:00

For frequencies above a 100 KHz you'd seriously want to use DMA to push a pattern buffer out the GPIO pins, either via ODR or BSRR. Interrupts at high rates are likely to choke at some point.

DMA can be directly triggered by TIM channels, review Reference Manual for associations.

I'd also strongly recommend something newer than an F1 part.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on March 01, 2018 at 03:56

Hi Pavel,

The problem solved after suspend Tick.

Thank you for your help.

Richard

Posted on March 01, 2018 at 06:27

Hi Clive,

The problem solved after suspend Tick.

Thank you for your help.

Richard