Skip to main content
amelendez
Associate II
June 13, 2017
Question

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

  • June 13, 2017
  • 6 replies
  • 1102 views
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
    June 13, 2017
    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
    June 13, 2017
    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
    June 13, 2017
    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
    June 13, 2017
    Posted on June 13, 2017 at 16:42

    It's an external Sigma-Delta 24 bits ADC

    Zt Liu
    Senior III
    June 13, 2017

    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
    June 13, 2017
    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?