cancel
Showing results for 
Search instead for 
Did you mean: 

writing to gpios on two different ports at the same time?

JLee.21
Associate II

Hi.

I'm testing gpios on many different ports at the same time.

I'm testing buttom code.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

__HAL_TIM_CLEAR_IT(&htim12, TIM_IT_CC1);
GPIOE->BSRR = Pattern_gen_D10[Pattern_cnt1];
GPIOD->BSRR = Pattern_gen_D11[Pattern_cnt1];
GPIOA->BSRR = Pattern_gen_D12[Pattern_cnt1];
GPIOI->BSRR = Pattern_gen_D13[Pattern_cnt1];
GPIOB->BSRR = Pattern_gen_D14[Pattern_cnt1];
GPIOH->BSRR = Pattern_gen_D15[Pattern_cnt1];
GPIOJ->BSRR = Pattern_gen_D16[Pattern_cnt1];
Pattern_cnt1++;
if(Pattern_cnt1 > Pattern_gen_Cnt_D1)
{
Pattern_cnt1 = 0;
HAL_TIM_OC_Stop_IT(&htim12, TIM_CHANNEL_1);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

How could i control gpios at the same time?

 

Thank you.

1 REPLY 1
TDK
Guru

You can't control them at the exact same time. There will always be a small but finite delay.

If you feel a post has answered your question, please click "Accept as Solution".