Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micromod PWM - Pin 45 does not work - QuadTimer4 is not initialized. Should Duplicate pins work? #741

Open
KurtE opened this issue May 5, 2024 · 0 comments

Comments

@KurtE
Copy link
Contributor

KurtE commented May 5, 2024

The issue, is that the method:

void pwm_init(void)
{
	//printf("pwm init\n");
	CCM_CCGR4 |= CCM_CCGR4_PWM1(CCM_CCGR_ON) | CCM_CCGR4_PWM2(CCM_CCGR_ON) |
		CCM_CCGR4_PWM3(CCM_CCGR_ON) | CCM_CCGR4_PWM4(CCM_CCGR_ON);
	CCM_CCGR6 |= CCM_CCGR6_QTIMER1(CCM_CCGR_ON) | CCM_CCGR6_QTIMER2(CCM_CCGR_ON) |
		CCM_CCGR6_QTIMER3(CCM_CCGR_ON) | CCM_CCGR6_QTIMER4(CCM_CCGR_ON);
	flexpwm_init(&IMXRT_FLEXPWM1);
	flexpwm_init(&IMXRT_FLEXPWM2);
	flexpwm_init(&IMXRT_FLEXPWM3);
	flexpwm_init(&IMXRT_FLEXPWM4);
	quadtimer_init(&IMXRT_TMR1);
	quadtimer_init(&IMXRT_TMR2);
	quadtimer_init(&IMXRT_TMR3);
}

Pin 45, is quad timer 4...
Need to add:
quadtimer_init(&IMXRT_TMR4);
Question is, should we only initialize QTIMER4 on MICROMOD only, as this is the only board that has a QT4 pin

Secondary question: The forum member dogbone06 was also trying to use pin 44 on the Micromod, which does have the capability to be used as PWM, actually two different ways:
44 B0_08 LCD_DATA04 **QTIMER3_TIMER2** **FLEXPWM2_PWMA01** LPUART3_TX FLEXIO2_FLEXIO08 GPIO2_IO08 SRC_BOOT_CFG04 ENET2_RDATA03

As either QTIMER3_TIMER2 or as FLEXPWM2_PWMA01
However these are other pins that have these same PWM

14/A0 AD_B1_02 USB_OTG1_ID **QTIMER3_TIMER2** LPUART2_TX SPDIF_OUT ENET_1588_EVENT2_OUT GPIO1_IO18 USDHC1_CD_B KPP_ROW06 GPT2_CLK FLEXIO3_FLEXIO02
and
5 EMC_08 SEMC_DM00 **FLEXPWM2_PWMA01** SAI2_RX_DATA XBAR1_INOUT17 FLEXIO1_FLEXIO08 GPIO4_IO08

Should some of these be easily enabled as they might be more convenient to use then the ones they are duplicates of...
And if so, how. Simply add the right stuff to the table for one of the options? Update the tables to define both possibilities
and allow user some method to optionally choose the secondary one....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant