TIM interrupt, sequencer, SPI_SCK
Hi!
I am using P-nucleo WB55 board to develop BLE application.
1 I use TIM2 to generate a interrupt where I use SPI to read external ADC data. However, I found that the time period between SPI SCK signal and rising edge of TIM's PWM is varying. as shown in the attached figure.
Below is a part of the code in TIM interrupt function:
// HAL_TIM_IRQHandler(&htim2);
/* USER CODE BEGIN TIM2_IRQn 1 */
SPI1->CR1 |= SPI_CR1_SPE;
while(!(SPI1->SR&SPI_SR_RXNE));
SPI1->CR1 &=(~SPI_CR1_SPE);
Dout_a[i]=SPI1->DR;
SPI signal is enable right after the interrupt. There is no code before enabling SPI signal. Why the time is varying?
Can a task in sequencer be interrupted, when it is running?
Sequencer tasks are running in parallel with the interrupt or in series with the interrupt?
