cancel
Showing results for 
Search instead for 
Did you mean: 

what is the GPIO read speed of IDR for stm32L-152RE ?

AKUMA.7
Associate

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.

2 REPLIES 2
Piranha
Chief II
  1. ST employee.
  2. Added a ridiculous "GPIO Data Miss At Interrupt" tag to the forum.
  3. Does a nonsense like 500 kHz interrupts on EXTI, especially on 32 MHz CPU.
  4. Code posted not in a Code Snippet.
  5. Variable definitions are not shown.
  6. Most likely data/i_flag variables are not defined as volatile.
  7. Lack of a basic C programming skills (casting the temp variable as a pointer).
  8. Uses __HAL_***_IT() macros where __HAL_***_FLAG() macros must be used.
  9. Combines HAL with register programming for no reason.
  10. Not capable of using Google, Stack Overflow or searching this forum.

Is this a joke?

@Laura C.​, at least remove that "useful" tag from the system...

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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..