cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read data thru a GPIO configuread as EXTI?

amelendez
Associate III
Posted on June 13, 2017 at 12:32

I'm trying to read an external ADC output.

The data are provided thru a DRDY pin.

When the DRDY falls, it generates an interruption in my STM32L1 (falling edge). Then, I must read the DRDY level eevery rising edge of a clock provide by the STM32L1 to the ADC.

Sould I configure the EXTI pin (PA3) in the callback function as input mode everytime the interrumption happens? (and then, before exiting to re-configure as EXTI)

6 REPLIES 6
Uwe Bonnes
Principal III
Posted on June 13, 2017 at 13:21

As long as an GPIO is not in analog mode, IDR always reflects to logic level at the pin. So no need to redefine.

amelendez
Associate III
Posted on June 13, 2017 at 15:14

Thanks Uwe. It's OK. The problem was in the protocol towards the external ADC

Zt Liu
Senior III
Posted on June 13, 2017 at 17:25

2-wire serial interface? like this?

0690X00000602QQQAY.bmp

Should I configure the EXTI pin (PA3) in the callback function as input mode everytime the interruption happens? (and then, before exiting to re-configure as EXTI)

You can try that, I think it will work.

Posted on June 13, 2017 at 16:34

I'd like to know the how the external ADC works? it's an IC? what's its name?

Posted on June 13, 2017 at 16:42

It's an external Sigma-Delta 24 bits ADC

Posted on June 13, 2017 at 17:33

Finally, it is not needed to reconfigure PA3

But I think that everytime DRDY falls during DOUT Mode, the interruption begins again.

Should I disable the interruption during DOUT Mode?