2022-09-07 03:07 AM
Hello,
Basically i am trying to get data at GPIO with inc with clk. The clk is used as a interrupt. The speed of interrupt is 500KHz.
Here i am able to detect each intrrupt but i am missing the data at GPIO and not able to get the same data every time. I have tried the multiple method with log pulse but not getting recognised.
Here is the code:
Method 1:-
void EXTI15_10_IRQHandler(void)
{
// EXTI line interrupt detected
if (__HAL_GPIO_EXTI_GET_IT(GPIO_PIN_13) != RESET)
{
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_13);
data = ((GPIOB->IDR & GPIO_PIN_1)>>1); // here is the data varible to read GPIO
}
}
Method 2:-
void EXTI15_10_IRQHandler(void)
{
// EXTI line interrupt detected
if (__HAL_GPIO_EXTI_GET_IT(GPIO_PIN_13) != RESET)
{
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_PIN_13);
i_flag = 1;
}
}
void main(void)
{
while (1)
{
if(i_flag != 0)
{
i_flag = 0;
temp = ((GPIOB->IDR & GPIO_PIN_1)>>1);
data[a] = (uint8_t*)temp;
a ++;
}
}
}
The both way are not working and I don't have clue about it. Please suggest if it can be solved.
I have seen many similar issue on community but did not get solution.
2022-09-07 11:58 AM
Is this a joke?
@Laura C., at least remove that "useful" tag from the system...
2022-09-07 01:25 PM
500 KHz? so you've got perhaps 64 cycles to work with. How many just stacking/unstacking context?
Perhaps you'd do better using DMA and pulling the 16-bit wide IDR into a buffer at the rate you want, and then pick through it at your leisure?