0

1

who do someone know about the STM32 GPIO toggling timing issue?

I want get the always normal togging timming signal without the abnormal togging timming iusse.

Due to the contacted image, I have a diffcult problem that the signal timing of the One Wire protocol changed the total timing in order to decided the period of the One wire logic interface.

HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_12);
DWT_Delay_us(2); // about 2us delay time

using the STM32F722 mcu and STM32 CUBEMX/IDE

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • If you have interrupts enabled, one could happen and disrupt your timing. (Most likely culprit being the sysTick interrupt.) If you need to generate a waveform with exact timing, consider using one of the STM32 timers. – pmacfarlane Jan 30 '23 at 07:59
  • Also, very interesting comment on this line: `DWT_Delay_us(2); // about 2us delay time`. Doesn't look like it guarantees 2us. Most software-based delays will generate an "at least" delay, i.e. `Delay_us(2)` will delay anywhere between 2 and 3 us. – pmacfarlane Jan 30 '23 at 08:01

0 Answers0