Hi,
I would like to activate internal pullup of MISO pin in SPI configuration.
I used below before configuring SPI function as:
MAX32655
Recommended for New Designs
The MAX32655 microcontroller (MCU) is an advanced system-on-chip (SoC) featuring an Arm® Cortex®-M4F CPU for efficient computation of complex functions...
MAX32655 on Analog.com
Hi,
I would like to activate internal pullup of MISO pin in SPI configuration.
I used below before configuring SPI function as:
Hi Satoru,
On MAX32xxx devices, the weak and strong pull-ups are controlled within the GPIO pad block. Many of the SPI initialization helpers internally invoke MXC_GPIO_Config() for their pin mapping, which typically resets the pad configuration to its default state (i.e., no pull-up or pull-down). As a result, if a pull-up is configured prior to calling MXC_SPI_Init(), the driver will overwrite those pad settings.
To address this, please proceed as follows:
Retain the MXC_SPI_Init() call as is.
Immediately after invoking it, apply a one-pin override for MISO in its SPI alternate function. Specifically, use MXC_GPIO_FUNC_ALT1 for SPI1_MISO on P0.22.
// 1) Bring up SPI first
MXC_SPI_Init(MXC_SPI0, 1, 0, 0, 0, /*... your args ...*/);
// 2) Re-apply pad config for MISO in its ALT function
mxc_gpio_cfg_t miso = {
.port = MXC_GPIO0,
.mask = MXC_GPIO_PIN_22, // P0.22 = SPI1 MISO pin
.func = MXC_GPIO_FUNC_ALT1, // the exact ALT for SPI1 MISO on P0.22
.pad = MXC_GPIO_PAD_PULL_UP, // weak pull-up enabled
.vssel = MXC_GPIO_VSSEL_VDDIOH, // if that pad is on the 3.3V bank
.drvstr = MXC_GPIO_DRVSTR_0,
};
MXC_GPIO_Config(&miso);
This approach remains robust even if you re-initialize SPI at a later point—simply re-apply the one-line override after each initialization.
Kind regards,
Haluk
Hi Haluk,
Thank you for your advice. My MISO pin pullup worked as you suggested.
Satoru