2025-07-29 9:28 AM
Friends, hello, I encountered a problem with starting DWT with PRODUСT STATE = 72;
I measure the time between pulses (white beam of the logic analyzer) by the EXTI5 interrupt input (falling edge of the signal), TIME_LONG_SENS = DWT->CYCCNT / (SystemCoreClock / 1000000); and then reset the counter DWT->CYCCNT = 0U; I measured the number of pulses on the generator and the number of interrupts on the input, they are equal. Then after a certain delay I control the microcontroller output to send a pulse (red and yellow beams of the logic analyzer).
The problem is that after zeroing DWT in the PRODUСT STATE = 72 state,
One output pulse is skipped.
it does not always start and upon arrival of the next interrupt, the DWT->CYCCNT value is zero, and accordingly, the measured time is also zero.
If I set PRODUСT STATE = ED,
then this problem does not occur and the same code works correctly.
Please tell me what my problem is and how to solve it?