I want to use the following sentence to generate several bits to configure my chip.
As planned, Pin 4 should output a 11001 bits synchronously with Pin 5, which is a CLK.
However, when I measure it on the scope, I find it take different time for each command and I get the five bits with different intervals.
Any suggestions?
void setup ()
{
pinMode(D4, OUTPUT);
pinMode(D5, OUTPUT);
}
void loop(){
myloop:
GPIOB_BASE->BSRR = BIT(6) | BIT(5);
GPIOB_BASE->BSRR = BIT(6+16) | BIT(5);
GPIOB_BASE->BSRR = BIT(6) | BIT(5);
GPIOB_BASE->BSRR = BIT(6+16) | BIT(5);
GPIOB_BASE->BSRR = BIT(6) | BIT(5+16);
GPIOB_BASE->BSRR = BIT(6+16) | BIT(5+16);
GPIOB_BASE->BSRR = BIT(6) | BIT(5+16);
GPIOB_BASE->BSRR = BIT(6+16) | BIT(5+16);
GPIOB_BASE->BSRR = BIT(6) | BIT(5);
GPIOB_BASE->BSRR = BIT(6+16) | BIT(5);
goto myloop;
}
Thanks a lot!