Hi,
I have a project that generates SPWM Output on FTM0 CH6 and CH7 using sine samples from DMA.
Currently, I have a GPIO button that controls output ON & output OFF.
I would like this output to detect the GPIO BUTTON press and then check for the rising edge of a 16kHz signal received on GPIO Pin PTB2 from another board (Master).
The problem is that when I add the PTB2 initialization in boards/pin_mux.c as below
/* PORTB2 (pin 55) is configured as PTB2 */
PORT_SetPinMux(BOARD_PWM_SYCNH_TRG_PORT, BOARD_PWM_SYCNH_TRG_PIN, kPORT_MuxAsGpio);
/* Interrupt configuration on PORTB2 (pin 55): Interrupt on rising edge */
PORT_SetPinInterruptConfig(BOARD_PWM_SYCNH_TRG_PORT, BOARD_PWM_SYCNH_TRG_PIN, kPORT_InterruptRisingEdge);
PORTB->PCR[2] = ((PORTB->PCR[2] &
/* Mask bits to zero which are setting */
(~(PORT_PCR_PE_MASK | PORT_PCR_PFE_MASK | PORT_PCR_ISF_MASK)))
/* Pull Enable: Internal pullup or pulldown resistor is enabled on the corresponding pin. */
| (uint32_t)(PORT_PCR_PE_MASK)
/* Passive Filter Enable: Passive input filter is disabled on the corresponding pin. */
| PORT_PCR_PFE(kPORT_PassiveFilterDisable));
And then when I connect the 16khz wire on PTB2 of slave, irrespective of the presence of ISR for PTB2, the PWM output is OFF. And there is no response to the GPIO button that is used for ON and OFF of SPWM.
Is there some coupling between PTB2 and PTA1 ?
Could you suggest some other way to implement the sync scheme that I mentioned above (detect button press & detect rising edge then turn ON output)?
Thanks & Regards,
Rashmitha