According to the datasheet screen clip shown below, the internal pull up/dn configured in the PORT registers is still supposed to work even when the pin is configured for use by the SERCOM/SPI peripheral.
When I step through the SERCOM SPI Slave initialization code snippet below, I can see the pin pulled up after gpio_set_pin_pull_mode(), but the pullup goes away as soon as gpio_set_pin_function() is called. At this point, I can still pull up the pin with an external resistor. The internal pullup comes back after the second gpio_set_pin_function() call returns the pin to GPIO mode. SPI_LCC_CSL is the GPIO pin macro from Atmel START.
Is the documentation wrong, or is there something else that I need to do to keep the pullup enabled in SPI mode?
gpio_set_pin_direction(SPI_LCC_CSL, GPIO_DIRECTION_IN); gpio_set_pin_pull_mode(SPI_LCC_CSL, GPIO_PULL_UP); // Internal pullup goes away ... gpio_set_pin_function(SPI_LCC_CSL, PINMUX_PA10D_SERCOM2_PAD2); // Internal pullup returns ... gpio_set_pin_function(SPI_LCC_CSL, GPIO_PIN_FUNCTION_OFF);
0 Asked on January 2, 2021 by ed-kemnitz
1 Asked on January 2, 2021 by couch-mango
0 Asked on January 1, 2021 by minghua
2 Asked on January 1, 2021
2 Asked on December 31, 2020 by rocklife
1 Asked on December 31, 2020 by sap
2 Asked on December 29, 2020 by mike-spivey
3 Asked on December 29, 2020
1 Asked on December 29, 2020 by lars-petersson
0 Asked on December 28, 2020 by brent-thierens
0 Asked on December 27, 2020 by krzych
Get help from others!