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.

[参考译文] MSP430F2274:端口引脚配置

Guru**** 2513195 points
Other Parts Discussed in Thread: MSP430F2274

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/988295/msp430f2274-port-pin-configuration

器件型号:MSP430F2274

您好!

我正在尝试将 MSP430F2274微控制器的引脚7配置为 SMCLK 输出引脚、然后我可以使用该引脚来测量 SMCLK 频率。

参考 端口 P2引脚电路原理图:P2.1、采用施密特触发器的输入/输出 以及 表25。 端口 P2 (P2.1) MSP430F22x2和 MSP430F22x4 - SLAS504G - 2006年7月–修订了2012年8月文档、我提出了以下函数、这些函数将使我的 MSP430F2274器件的引脚7输出 SMCLK:

void smclk_init(void)
{
	P2DIR |= SMCLK_MASK;			// P2.1 - output at TP121
	P2SEL |= SMCLK_MASK;			// P2.1 - select SMCLK
	P2REN &= ~SMCLK_MASK;			// P2.1 - selest SMCLK
	ADC10AE0 &= ~SMCLK_MASK;		// Disable ADC
}

其中 SMCLK_MASK 为0x01

但是、当我编译并运行代码时、我无法看到器件的引脚7上输出任何时钟、而其他功能正常工作、例如 LED 闪烁。

我在这里错过了什么?

谢谢、

布迪米尔

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

    我刚刚意识到 SMCLK_MASK 不正确。  应为0x02。

    这会产生所需的效果。

    有时有必要提出问题,以实现答案:-)