TM4C1230E6PM: TivaWare use a Pin for SPI (CIPO) and for GPIOInterrupt

Part Number: TM4C1230E6PM

Tool/software:

Hi,

I'm working with an AD7124-8 which has a "continuous read mode", where the DOUT pin is also used as a RDY pin indicating the availablity of new data to be read over SPI.

I want to do the following thing:

  1. Start the continuous read mode over SPI
  2. Attach an interrupt to the CIPO pin
  3. This should call a function to read the data over SPI and in the end re-arm the interrupt on the CIPO pin

Is it possible to have two functions on one pin? What would be the best way to do this?

Thanks for any help in advance!

    • Start the continuous read mode over SPI
    • Attach an interrupt to the CIPO pin
    • This should call a function to read the data over SPI and in the end re-arm the interrupt on the CIPO pin

    Hi,

      What is a CIPO pin? Do you mean GPIO?

      If you mean GPIO (General Purpose I/O) then it is not possible to have a pin that serves as a GPIO and SPIRX at the same time. What you can try is to first configure the SPIRX pin in GPIO mode with interrupt enabled. Once you detect the RDYn, the MCU will generate an interrupt. In the GPIO ISR, you can reconfigure the pin for SPIRX functionality to read the SPI data. At the completion of the data read, you will reconfigure the pin for GPIO anticipating the next data ready.

  • Hi Charles,

    Thanks for the reply.

    CIPO = MISO pin, so you understood me correctly that I want to use the SPIRX pin.

    Thanks for your advice, after a quick check this seems to be working fine!