GPIO 27 Pullup not working
Posted: Tue Jan 22, 2019 10:15 am
I have selected the GPIO27 as input and pulled it up in the code. When I measure the voltage between GND and the pin, I am constantly reading 0V.
Here is my code:
And this is my handler and task that reads the queue:
Maybe this is a duplicate, because I saw a post that said that there was a silicon bug and you could not pull up the GPIO27, but it was from 2016.
Q1: Was that silicon bug fixed (have the chips that are produced now a different layout?) ?
Q2: If GPIO27 does not work as a pull up, which does?
Thanks guys!
Here is my code:
Code: Select all
/*
* Add hardware interrupt handler.
*/
gpio_evt_queue = xQueueCreate(10, sizeof(gpio_num_t));
xTaskCreate(gpio_task_example, "gpio_task_example", 2048, NULL, 10, NULL);
gpio_config_t gpioConfig;
gpioConfig.pin_bit_mask = GPIO_SEL_27;
gpioConfig.mode = GPIO_MODE_INPUT;
gpioConfig.pull_up_en = GPIO_PULLUP_ENABLE;
gpioConfig.pull_down_en = GPIO_PULLDOWN_DISABLE;
gpioConfig.intr_type = GPIO_INTR_NEGEDGE;
gpio_config(&gpioConfig);
gpio_install_isr_service(0);
gpio_isr_handler_add(gpio_num_t_INT_PIN, gpio_isr_handler, NULL);
/*
* Configure sensor interrupts.
*/
this->setIntEnable(interrupt_flags);
uint16_t int_config = this->getIntEnable();
printf("Int enable: %d\n", int_config);
Code: Select all
static void IRAM_ATTR gpio_isr_handler(void* arg)
{
uint32_t gpio_num = (uint32_t) arg;
xQueueSendFromISR(gpio_evt_queue, &gpio_num, NULL);
}
static void gpio_task_example(void* arg)
{
uint32_t io_num;
for(;;) {
if(xQueueReceive(gpio_evt_queue, &io_num, portMAX_DELAY)) {
printf("Interrupt!\n");
}
}
}
Q1: Was that silicon bug fixed (have the chips that are produced now a different layout?) ?
Q2: If GPIO27 does not work as a pull up, which does?
Thanks guys!