Hi all,
I'm using the S32K1 MCU, and I define an input pin to detect the signal falling edge.
pin_mux.c
const port_digital_filter_config_t PTC_filter_Paras={
.clock = PORT_DIGITAL_FILTER_LPO_CLOCK,
.width = 5U,
};
#define PTC_Filter_Conf ((port_digital_filter_config_t*)&PTC_filter_Paras)
static inline void Set_Pin_Interrupt_Filter(void){
PINS_DRV_ConfigDigitalFilter(PORTA, PTA_Filter_Conf);
PINS_DRV_ConfigDigitalFilter(PORTC, PTC_Filter_Conf);
}
I add a breakpoint inside the PORTC_IRQHandler.
After the pins and pins filter initialized, and then PORTC_IRQHandler() triggered, but I used oscilloscope to measure the input signal is always high, no falling edge exited.
In the same time, The register data:
PORTC/ISFR,0x4004B0A0,0x00000100
PTC/PDIR,0x400FF090,0x00024130
The PTC8/PDIR is High but PORTC8/ISFR is High, it's not expected action, how to set this pin?
Regards,
Leon
解決済! 解決策の投稿を見る。
Hi Leon,
Did you followed the order mentioned in the chapter "Digital input filter configuration sequence while using GPIO interrupt"?
If the problem persists, please tell me the part number of S32K1, SDK or RTD version number you are using.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Leon,
Did you followed the order mentioned in the chapter "Digital input filter configuration sequence while using GPIO interrupt"?
If the problem persists, please tell me the part number of S32K1, SDK or RTD version number you are using.
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Robin,
I am using S32K148 and SDK4.0.2.
I was following the guidelines Chap. 12.1.4.1 and changed some initial pin configurations and the pin initializing processes from s32ds auto-code-gen.
pin_settings_config_t g_pin_mux_InitConfigArr[NUM_OF_CONFIGURED_PINS]={
{
.base = PORTC,
.pinPortIdx = 8U,
.pullConfig = PORT_INTERNAL_PULL_NOT_ENABLED,
.driveSelect = PORT_HIGH_DRIVE_STRENGTH,//PORT_LOW_DRIVE_STRENGTH,
.passiveFilter = false,
.mux = PORT_MUX_AS_GPIO,
.pinLock = false,
.intConfig = PORT_DMA_INT_DISABLED,//not using PORT_INT_FALLING_EDGE initialized when .digitalFilter = true
.clearIntFlag = false,
.gpioBase = PTC,
.direction = GPIO_INPUT_DIRECTION,
.digitalFilter = true,
.initValue = 1U,
},
}
status_t Config_GPIO_Module(void)
{
status_t st;
st = PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
Set_Pin_Interrupt_Filter();
PINS_SetPinIntSel(PORTC, 8U, PORT_INT_FALLING_EDGE);
return st;
}
status_t Config_IRQ_System(void){
INT_SYS_EnableIRQ(PORTC_IRQn);//PTC8 for FLT OV
INT_SYS_SetPriority(PORTC_IRQn, 7);
}
After Config_GPIO_Module() initialized, and then do Config_IRQ_System() initialized. After the processes and then the PTC8 is normally worked and raising the interrupt flag when the falling-edge siganl existed. And now it's worked as what I need.
Thanks for help.
Regards,
Leon