GPIO interrupt

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

cross mob
Anonymous
Not applicable

Hello everybody,

I need to wake-up the BCM20736S via an external button to ground that's connected to P2 of the BLE module.

The GPIO is configured as input with a pull-up resistor and is generating an interrupt callback which already works flawlessly.

But I also need to pull this pin down as a normal GPIO output, as it is shared with our main MCU that will wake-up on falling edge. So if the buttons not pressed by the user but a BLE event is generated, the module must be able to restart the main MCU.

Two questions:

How can I ensure the BLE module will wake-up even from deep sleep?

Is this enough:

devlpm_enableWakeFrom(DEV_LPM_WAKE_SOURCE_GPIO);

bleprofile_PrepareHidOff();

Do I need to disable the interrupt routine, if I reconfigure the GPIO as an output?

I use this code to init it as an input interrupt source:

UINT16 masks[3] = {0, 0, 0};

masks[TACT_PORT] |= (1 << TACT_PIN);

gpio_registerForInterrupt(masks, gpioTactInterruptHandler, NULL);

gpio_configurePin(TACT_PORT, TACT_PIN, GPIO_EN_INT_FALLING_EDGE | GPIO_INPUT_ENABLE | GPIO_PULL_UP, GPIO_PIN_INPUT_HIGH);

Find a schematic detail attached:

BLE_schem.png

Best regards

Hannes Baumgart

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

You may want to check out i2c_temperature_sensor.c on how to wake up by GPIO interrupt.

How can I wake BCM20737S up by using GPIO interrupt?

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

Is this still an issue?

hantron

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

Is this still an issue?

hantron

0 Likes
Anonymous
Not applicable

Hi boont

thanks for coming back.

I didn't have the time to test it out, but the GPIO interrupt itself does work.

Still waking up the Bluetooth module needs testing.

Best regards

Hannes Baumgart

0 Likes
Anonymous
Not applicable

I think I understand the question, but I'm not 100% sure:

This would take care of the input scenario:

Ideally, the hardware would have a pull down resistor in the MOhm range, say 10 MOhm.  Then, when you configure as an input with a pull-up (typically in kiloOhm range, say 4.7 kOhm), it would still be above the threshold and you would get a HIGH level as default, and a LOW level when the button is pressed.

This is the output scenario:

Now, you would need to reconfigure the pin to output, it would already have an external pull-down, and you could drive it HIGH as needed.

I hope this helps.