工具与软件:
GPIO_setAsPeripheralModuleFunctionInputPin (GPIO_PORT_PJ、
GPIO_PIN1 | GPIO_PIN2、GPIO_PRIMARY_MODULE_FUNCTION);
我在代码中使用上述函数将 MCLK 和 SMCLK 路由到端口 J.1和端口 J.2的引脚。 但在 DSO 上无法看到这些时钟。 这两个时钟都配置为8MHz。 我正在使用内部时钟。
如何解决此问题?
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.
工具与软件:
GPIO_setAsPeripheralModuleFunctionInputPin (GPIO_PORT_PJ、
GPIO_PIN1 | GPIO_PIN2、GPIO_PRIMARY_MODULE_FUNCTION);
我在代码中使用上述函数将 MCLK 和 SMCLK 路由到端口 J.1和端口 J.2的引脚。 但在 DSO 上无法看到这些时钟。 这两个时钟都配置为8MHz。 我正在使用内部时钟。
如何解决此问题?
您好!
请按照如下步骤初始化 GPIO 以实现 MCLK 输出功能、这来自 SPI 示例:
/*
* Select Port 1
* Set Pin 5 to input Secondary Module Function, (UCA0CLK).
*/
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P1,
GPIO_PIN5,
GPIO_SECONDARY_MODULE_FUNCTION
);
/*
* Select Port 2
* Set Pin 0, 1 to input Secondary Module Function, (UCA0TXD/UCA0SIMO, UCA0RXD/UCA0SOMI).
*/
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P2,
GPIO_PIN0 + GPIO_PIN1,
GPIO_SECONDARY_MODULE_FUNCTION
);
/*
* Disable the GPIO power-on default high-impedance mode to activate
* previously configured port settings
*/
PMM_unlockLPM5();
此致、
Helic
> GPIO_setAsPeripheralModuleFunctionInputPin (GPIO_PORT_PJ、GPIO_PIN1 | GPIO_PIN2、GPIO_PRIMARY_MODULE_FUNCTION);
要获得 SMCLK/MCLK、需要将引脚配置为输出[请参阅数据表(SLASEB7D)表9-42]。 请尝试改用:
> GPIO_setAsPeripheralModuleFunctionOutputPin (GPIO_PORT_PJ、 GPIO_PIN1 | GPIO_PIN2、GPIO_PRIMARY_MODULE_FUNCTION);