This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp430f5438a

Other Parts Discussed in Thread: MSP430F5438A

MSP430F5438A在使用IO设置输入时可以使用上下拉吗?如果能,那么在使用复用IO时(比如SPI  MISO),也是否可以使用上下拉电阻.

这是驱动函数库的代码,发现会自动关闭上下拉电阻,和复用功能。

void GPIO_setAsInputPin(uint8_t selectedPort, uint16_t selectedPins) {

uint16_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];

#ifndef NDEBUG
if(baseAddress == 0xFFFF) {
return;
}
#endif

// Shift by 8 if port is even (upper 8-bits)
if((selectedPort & 1) ^ 1) {
selectedPins <<= 8;
}

HWREG16(baseAddress + OFS_PASEL) &= ~selectedPins;
HWREG16(baseAddress + OFS_PADIR) &= ~selectedPins;
HWREG16(baseAddress + OFS_PAREN) &= ~selectedPins;
}