GPIO_Interrupt_Configure

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi i have a shock sensor & BCM2073X_LE_KIT (BCM920737TAG).

My shock sensor gives high pulse if it detects the shock & i want to configure it as a interrupt ,So what i did is..

#define SHOCK_IN 4

#define SHOCK 8

const UINT8 shk=SHOCK;

& in the following fuction i enabled interrupt

void hello_client_connection_up(void)

{

UINT16 masks[3] = {(1 << SHOCK_IN), 0 , 0};

gpio_registerForInterrupt(masks,(void *)hello_client_interrupt_handler,(void *)&shk);

gpio_configurePin(SHOCK_IN/16, SHOCK_IN%16, GPIO_EN_INT_RISING_EDGE,GPIO_PIN_INPUT_LOW);

}

It works fine when the shock interrupt pin is connected ,but it gives continuous interrupt whenever i disconnect the shock pin.

It should not give interrupt when there is no connection on shock pin..

0 Likes
1 Solution
Anonymous
Not applicable

i think it was the issue with PULLUP/PULLDOWN i used

gpio_configurePin(SHOCK_IN/16, SHOCK_IN%16, GPIO_EN_INT_RISING_EDGE|GPIO_PULL_DOWN,GPIO_PIN_INPUT_LOW);

then it worked fine..

View solution in original post

5 Replies
Anonymous
Not applicable

Should I use PULL_DOWN ,

Then Which Macro should i use..?

0 Likes
BoonT_56
Employee
Employee
500 likes received 250 likes received 100 likes received

Did you have a chance to review the temperature sensor app in the SDK? It is a classic example of wake-on-gpio.

Is your sensor connected to the I2C?

0 Likes
Anonymous
Not applicable

No my sensor has siple gpio interface..

with single o/p as HIGH/LOW..

0 Likes

Does it help if you assert to clear the status of the interrupt?

I cut and paste the below from the temperature app:

gpio_clearPinInterruptStatus(LM73_ALERT_INTERRUPT_PORT, LM73_ALERT_INTERRUPT_PIN);

Anonymous
Not applicable

i think it was the issue with PULLUP/PULLDOWN i used

gpio_configurePin(SHOCK_IN/16, SHOCK_IN%16, GPIO_EN_INT_RISING_EDGE|GPIO_PULL_DOWN,GPIO_PIN_INPUT_LOW);

then it worked fine..