Tool/software:
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_PJ,
GPIO_PIN1 | GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);
I used above function in my code to route MCLK & SMCLK to PINs of Port J.1 & Port J.2. I but on DSO not able to see these clocks. Both the clocks configured to 8MHz. I am using the internal clocks.
How to resolve this?
Hi,
Please follow such steps to init GPIO for MCLK output function, this is from spi example:
/* * 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();
Regards,
Helic
> GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_PJ,GPIO_PIN1 | GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);
To get SMCLK/MCLK, the pin needs to be configured as output [Ref datasheet (SLASEB7D) Table 9-42]. Try instead:
> GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ, GPIO_PIN1 | GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);
Hi, Bruce
Yes, thank you for your mention.
And the key point is need to run a additional PMM_unlockLPM5(); function.
Regards,
Helic
**Attention** This is a public forum