2018-02-28 04:52 PM
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 ..., 1void 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.
2018-02-28 05:09 PM
>
It looks like STM32 has an unknown interrupt every 1mSec be executed once.
Why, it is quite well known... the systick.
-- pa
2018-02-28 07:00 PM
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.
2018-02-28 07:56 PM
Hi Pavel,
The problem solved after suspend Tick.
Thank you for your help.
Richard
2018-02-28 10:27 PM
Hi Clive,
The problem solved after suspend Tick.
Thank you for your help.
Richard