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

    Trouble Reading GPIO inputs reliably on CYBT-213043 EVAL board




      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?




      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] );







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

          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?



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

            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.