As you can see, the Pin level drop to low after i use the HAL_delay function. But just for the GPIOA Pins.
I cant explain this behaviouractually know what problem i have! In the Timer Callback function i toggle two pins PA8 and PA11. Does someone has an idea forIf i remove this problem?code everything works fine. So the Problem is my Bitmanipulation on GPIOA.
Here is the function
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
{
static uint8_t countClkCycles;
countClkCycles++;
if(countClkCycles >= 40)
{
k++;
}
if(k == 10)
{
k=0;
}
else
{
if(goldcode1[k] == 1)
{
GPIOA->ODR ^= (1<<11); // Toggle output GPIO PA11
}
else
{
GPIOA->BSRR = (1<<27);
}
}
if(countClkCycles >= 40)
{
int j=i+1;
if(j == 10)
{
j=0;
}
if(goldcode1[i] == goldcode1[j])
{
GPIOA->ODR ^= (1<<8); //Toggle output GPIOA PA8
}
else
{
//GPIOA->BSRR = (1<<24);
if(goldcode1[i] == 1)
{
//GPIOA->ODR = (1<<8); //sets output GPIOA PA8
GPIOA->BSRR = (1<<24);
}
else
{
//GPIOA->BSRR = (1<<24); //resets output GPIOA PA8
GPIOA->ODR = (1<<8); //sets output GPIOA PA8
}
}
i=j;
//TIM2->CCMR1 ^= 1 << 4;
countClkCycles = 0;
}
else
{
GPIOA->ODR ^= (1<<8); //Toggle output GPIOA PA8
}
}
How should i do the Bitmanipulation that i just toggle PA8 and PA11 and not the whole GPIOA register.