2 Replies Latest reply on Mar 9, 2020 9:49 AM by HaOv_4353196

    Trouble Reading GPIO inputs reliably on CYBT-213043 EVAL board

    HaOv_4353196

      Hello,

       

      I have been trying to update the hal_gpio.c snip file provided in ModusToolbox to read GPIO input values and for some reason, the board will not consistently read values on the rising edge of an ENABLE bit.  The board will read the values but not on every request.

       

      Has anyone else run into this issue and came up with a solution?

       

      Thanks!

       

      I have provided the interrupt function below:

       

       

       

      void hal_gpio_app_interrrupt_handler(void *data, uint8_t pin)

      {

       

        RFID_data[0]= wiced_hal_gpio_get_pin_input_status(WICED_P01);

        RFID_data[1]= wiced_hal_gpio_get_pin_input_status(WICED_P02);

        RFID_data[2]= wiced_hal_gpio_get_pin_input_status(WICED_P03);

        RFID_data[3]= wiced_hal_gpio_get_pin_input_status(WICED_P04);

       

       

        wiced_hal_gpio_set_pin_output(WICED_P08, RFID_data[0] );

        wiced_hal_gpio_set_pin_output(WICED_P12, RFID_data[1] );

        wiced_hal_gpio_set_pin_output(WICED_P13, RFID_data[2] );

        wiced_hal_gpio_set_pin_output(WICED_P14, RFID_data[3] );

       

       

         wiced_hal_gpio_clear_pin_interrupt_status(WICED_P26);

       

      }

       

        • 1. Re: Trouble Reading GPIO inputs reliably on CYBT-213043 EVAL board
          AnjanaM_61

          HI HaOv_4353196 ,

           

          Have you registered for interrupts wiced_hal_gpio_register_pin_for_interrupt ?

          Are you seeing the inconsistent behavior in all the input pins mentioned above or any particular pins?

          Can you please share the project to check at our side? How often are you reading the pins , can you please confirm when exactly / how often you are not able to read the correct values?

           

          Thanks,
          Anjana

          • 2. Re: Trouble Reading GPIO inputs reliably on CYBT-213043 EVAL board
            HaOv_4353196

            Hi Anjana,

             

            Yes I have registered for interrupts using wiced_hal_gpio_register_pin_for_interrupt.

            The inconsistent behavior occurs for all the input pins mentioned above.  The EN bit (P26) is being set high for one second, then is set low for a second.  Upon the rising edge of this EN bit, I would like to read in the data on input pins and use that data to turn ON/OFF some LEDs that are hooked up to the output pins.  The output pins will change their state to the correct value, however this occurs very inconsistently, sometimes the EN bit would go through 5 or more periods before the LEDs were observed to change. I've attached my modified project below.

             

            Thanks,

            Harrison