PWM module not triggering fault

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

PWM module not triggering fault

2,945 次查看
fasihahmed
Contributor IV

Have an issue that GPIO C14/C15 inputs are not enabling PWMs fault channels in GCT. Even though they are selected. im not able to get a check mark on the boxes

How can i manually enable them during initilisation process in main.c?

Im using MC56F837xx, CodeWarrior 11.1 and Quickstart 2.7

 

@xiangjun_rong 

 

 

fasihahmed_0-1605107473591.png

fasihahmed_0-1605107672986.png

 

0 项奖励
回复
7 回复数

2,936 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fasih,

Maybe it is only GCT tools issue. Pls output a PWM signal, and add the PWM_Fault signal, then observe the PWM signal and check if the Fault signal can disable PWM output.

Hope it can help you

BR

Xiangjun Rong

0 项奖励
回复

2,933 次查看
fasihahmed
Contributor IV

Can you tell me the code to manually enable/init the fault during startup? @xiangjun_rong 

im still not able to trigger an interrupt based on pwm faults

0 项奖励
回复

2,913 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fasih,

For example, the GPIOG_5 is multiplexed with PWMA_Fault3, you can use the code to enable fault function and generate fault interrupt.

/High logic of fault signal will disable PWM signal, The fault signal is inputed from the GPIOG5, the PWM signals recover after the Fault signal disappear
//automatically
void PWMAFault_GPIOG5(void)
{
//enable the GPIOG gated clock
SIM->PCE0|=1<<0;
//set the GPIOG5 bit in PER reg
GPIOG->PER|=0x20;
//set the GPIOG5 as PWMA fault3 signal
SIM->GPSGL&=~(0xC00);
SIM->GPSGL|=0x400;
}

//High logic of fault signal will disable PWM signal, The fault signal is inputed from the GPIOG5, the PWM signals recover after the Fault signal disappear
//automatically
void testFaultFunction(void)
{
//enable fault
SIM->IPS0&=~(0x08);
INTC->IPR8|=0x300;
PWMA->SM0DISMAP0=0x0088; //Disable PWMA_0A and 0B when the fault3 becomes high
PWMA->FCTRL0|=0x8808;
}

#pragma interrupt on
void PWMA_Fault_ISR(void)
{
//clear the PWMA_fault flag
PWMA->FSTS0|=0x088;
__asm(nop);
}
#pragma interrupt off

BR

Hope it can help you

0 项奖励
回复

2,898 次查看
fasihahmed
Contributor IV

the PWMs are disabled but i cannot get the ISR to trigger based on the PWM fault.

I use GPIOF5 and PWM_A_FL7

0 项奖励
回复

2,888 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fasih,

I see that the GPIOF5 pin can disable PWMA signal for your project, but can not generate interrupt, in the case, pls use the code.

But you have to add the PWMA_Fault_ISR to PWMA_fault interrupt vector table.

Hope it can help you

BR

XiangJun rong

void testFaultFunction(void)
{
//enable fault
INTC->IPR8|=0x300;
PWMA->SM0DISMAP1=0x0088; //Disable PWMA_0A and 0B when the fault3 becomes high
PWMA->FCTRL1|=0x8808;
}

 

#pragma interrupt on
void PWMA_Fault_ISR(void)
{
//clear the PWMA_fault flag
PWMA->FSTS1|=0x088;
__asm(nop);
}
#pragma interrupt off

0 项奖励
回复

2,864 次查看
fasihahmed
Contributor IV

fasihahmed_0-1606140804490.png

 

in GCT's SYS - System Support Control why cant I choose the fault pins for example on GPIOF5? It only shows GPIO G's faults. Which are not supported by my DSC type. I need to select them on GPIOC14, GPIOC15 and GIPIOF5

 

Also in SYS.h im not able to find register for GPIOF5.

The below code shows for GPIOG5. How can i select the register for GPIOF5? 

//enable fault
SIM->IPS0&=~(0x08);

0 项奖励
回复

2,843 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Fasih,

For the PWMA module of MC56F83xxx, there are 8 Faults pins, they are Fault 0/1/2/3 and Fault 4/5/6/7, for the Fault 0/1/2/3, there are TWO sources, one is from external pads, another is from crossbar, which one functions as Fault is dependent on the SIM->IPS0 register, that is why you are required to select the fault source for Fault 0/1/2/3 in SYS module.

For the Fault 4/5/6/7, there is only one source, external pads.

In conclusion, for fault 0/1/2/3, if you use external pads as fault pins, you are required to configure the SYS module and GPIO module, for example GPIO E8/E8 and G4/G5.

For the Fault 4/5/6/7, you are only required to set up the GPIO for example GPIO F4/F5..

Hope it can help you

BR

XiangJun Rong

 

0 项奖励
回复