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.

如果I/O口设为第二功能,还要设为输入输出吗?例如P1SEL=0XFF;P1还要设为输出吗

如果I/O口设为第二功能,还要设为输入输出吗?例如P1SEL=0XFF;P1还要设为输出吗

  • fan yu,

    在IO被选择为第二功能后,还需要根据功能设置输入输出。以下为datasheet原话:

    Setting PxSELx = 1 does not automatically set the pin direction. Other peripheral module functions may

    require the PxDIRx bits to be configured according to the direction needed for the module function. See

    the pin schematics in the device-specific data sheet.

    希望我的回答对您有帮助。

  • 楼上说的没错.

    复用功能的寄存器设置在对应型号的datasheet上有详细列表说明,可以去查对应的datasheet