- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
Best regards
Hannes Baumgart
- Labels:
-
GPIO
-
Scanning-Advertising
-
SDK 2.X
-
Sleep Modes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may want to check out i2c_temperature_sensor.c on how to wake up by GPIO interrupt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.