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.

[参考译文] MSP430F5244:端口映射

Guru**** 2027820 points
Other Parts Discussed in Thread: MSP430F5244
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/762234/msp430f5244-port-mapping

器件型号:MSP430F5244

uС MSP430f5244 UCB1有可能在没有 SOMI 引脚(P4.2/PM_UCB1SOMI / PM_UCB1SC)的情况下安装、被用作数字 I/O?

 //设置端口引脚              
 P4DIR = 0xFF;                           // P4.0 - P4.7输出
 P4SEL = BIT1+BIT3;                 // P4.1、P4.3端口映射函数
 P4OUT = 0x00;                          

空端口映射(空)

 _disable_interrupt ();                   //在修改端口映射寄存器之前禁用中断
 PMAPPWD = 0x02D52;                       //启用写入访问以修改端口映射寄存器
 
 #ifdef port_map_RECFG                     
 PMAPCTL = PMAPRECFG;                     //允许在运行时重新配置
 #endif  
 
 P4MAP0 = PM_NONE;
 P4MAP1 = PM_UCB1SIMO;
 P4MAP2 = PM_NONE;
 P4MAP3 = PM_UCB1CLK;
 P4OMAP4 = PM_NONE;  
 P4MAP5 = PM_NONE;
 P4MAP6 = PM_NONE;
 
 PMAPPWD = 0;                             //禁用写访问以修改端口映射寄存器
 #ifdef port_map_EINT
 _ENABLE_INTERRUPT ();                    //重新启用所有中断
 #endif  


谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Albert、

    是的。  通过查看 MSP430x5xx6xx 用户指南中的端口4引脚功能表、您可以看到是否要使引脚 P4.2成为数字引脚、而不是用作 SOMI、然后如   图所示设置位 P4SEL.2 = 0。

    //指令只清除位#2

    P4SEL &=~(GPIO_BIT2);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    谢谢、Dennis。