Skip to main content
amelendez
Associate II
Jun 13, 2017 10:32 AM UTC
Question

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

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)

    This topic has been closed for replies.

    6 replies

    Uwe Bonnes
    Chief
    Jun 13, 2017 11:21 AM UTC
    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
    amelendezAuthor
    Associate II
    Jun 13, 2017 1:14 PM UTC
    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
    Jun 13, 2017 4:34 PM UTC
    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?

    amelendez
    amelendezAuthor
    Associate II
    Jun 13, 2017 4:42 PM UTC
    Posted on June 13, 2017 at 16:42

    It's an external Sigma-Delta 24 bits ADC

    Zt Liu
    Senior III
    Jun 13, 2017 3:25 PM UTC

    Posted on June 13, 2017 at 17:25

     

     

     

    2-wire serial interface? like this?

     

    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.

    amelendez
    amelendezAuthor
    Associate II
    Jun 13, 2017 5:33 PM UTC
    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?