This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[nRF51422] Sense mechanism - detect more than one pin

Is there any possibility to detect active state on the more than one pin using sense mechanism? GPIOTE_IRQHandler is blocked when it detect active state on the one of the used pins. How to deal with it?

Parents
  • Hello.

    To finish our discussion. Transmitter sends to nRF examplary sequence:

    
    OUTPUT1_HIGH;
    delay_ms(1);
    OUTPUT2_HIGH;
    delay_ms(10);
    OUTPUT2_LOW;
    OUTPUT1_LOW;
    
    

    nRF51422 part:

    
    
    void GPIOTE_IRQHandler(void)
    {
        if ((NRF_GPIOTE->EVENTS_PORT != 0) && (NRF_GPIOTE->INTENSET &         GPIOTE_INTENSET_PORT_Msk))
        {
            NRF_GPIOTE->EVENTS_PORT = 0;
    	NVIC_ClearPendingIRQ(GPIOTE_IRQn);			
    
            if(nrf_gpio_pin_read(INPUT1)==1)					
            {
     	    flag1=true;
            }			
    
    	if(nrf_gpio_pin_read(INPUT2)==1)
    	{
    	    flag2=true;		
            }	 
        }		
    }
    
    

    Is it possible to detect OUTPUT2 signal ?

    Best regards, PW

Reply
  • Hello.

    To finish our discussion. Transmitter sends to nRF examplary sequence:

    
    OUTPUT1_HIGH;
    delay_ms(1);
    OUTPUT2_HIGH;
    delay_ms(10);
    OUTPUT2_LOW;
    OUTPUT1_LOW;
    
    

    nRF51422 part:

    
    
    void GPIOTE_IRQHandler(void)
    {
        if ((NRF_GPIOTE->EVENTS_PORT != 0) && (NRF_GPIOTE->INTENSET &         GPIOTE_INTENSET_PORT_Msk))
        {
            NRF_GPIOTE->EVENTS_PORT = 0;
    	NVIC_ClearPendingIRQ(GPIOTE_IRQn);			
    
            if(nrf_gpio_pin_read(INPUT1)==1)					
            {
     	    flag1=true;
            }			
    
    	if(nrf_gpio_pin_read(INPUT2)==1)
    	{
    	    flag2=true;		
            }	 
        }		
    }
    
    

    Is it possible to detect OUTPUT2 signal ?

    Best regards, PW

Children
  • Hi,

    I'm sorry for the late reply. I tested this and saw the same behavior as you, and had to double-check my observations.

    I had a chat with the designers, and it seems that this is the way the port event behaves. The detailed description is that the SENSE signal it self is level triggered, which sends a level to the GPIOTE module, which is edge-triggered. This causes only one EVENT to be fired (SENSE signal will be high until pin is inactive), even if multiple pins are active at the same time.

    The workaround for this is to use polling (using RTC timer when awoken) in combination with the PORT event.

    I am very sorry for the inconvenience this has caused.

    Best regards Håkon

  • Hi , what about in nRF51822, Is the behaviour same there also?

Related