Problems with Hardware Triggers on S32K358

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

Problems with Hardware Triggers on S32K358

104 次查看
simon98
Contributor III

Hi NXP,

I'm having problems with Hw trigger functionality in a S32K358 custom board.

I'm using MBDT v1.5 in matlab 2024.

I've configured 3 cahnnels of EMIOS_1 (ch_9, ch_11, ch_19) in order to have 3 pwm signals and i've configured them as EMIOS_PWM_IP_MODE_OPWMT to enable trigger generation.

In AdcHwTrigger i've configured 3 Hardware Triggers with the correspondig BTCU sources and 3 ADC_1 groups with one injected channel each.
These cahnnels are latched on with the corresonding Hw Trigger as well. The ADC_1 works with interrupt method.

I've configured also the Platform ISR and MCU Clock correctly.

In the simulink model i enabled the Notifications and Hw Triggers in a subsystem called every 50ms by a stateflow chart. Once the adc channel is converted the application calls the
Interrupt Hw callback in which disables the Notification and the relative Hw Trigger for that group.
This is done for each of the 3 groups.

In this way i have 3 pwm signals that starts at the same time with the same periodicity (200Hz in my case), so based on what i've read on RM (64.3.1.9 Priority of simultaneous triggers)
i expect that the BCTU receives 3 triggers at the same time and perform the conversion of the adc channel attached to the highest priority trigger (BCTU_EMIOS_1_9 in my case)
while the others (BCTU_EMIOS_1_11 and BCTU_EMIOS_1_19) stay pending waiting for their turn to access ADC_1 and perform conversion as well.
When the conversion related to BCTU_EMIOS_1_9 trigger is performed i expect that his trigger would be disabled in the interrupt callback and the second pending trigger (BCTU_EMIOS_1_11 in my case)
starts the conversion...

Unfortunately i couldn't see this behavior… I only see that it performs the convertion of the adc attached to the highest priority trigger (BCTU_EMIOS_1_9 in my case),
ignoring the others.

Am i doing something wrong or misunderstanding something? How could i do to have the behavior descripted above?

 

I attach the mex file

Thanks,
Simon

标记 (6)
0 项奖励
回复
0 回复数
%3CLINGO-SUB%20id%3D%22lingo-sub-2247237%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K358%20%E4%B8%8A%E7%9A%84%E7%A1%AC%E4%BB%B6%E8%A7%A6%E5%8F%91%E4%BF%A1%E5%8F%B7%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2247237%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E6%81%A9%E6%99%BA%E6%B5%A6%E3%80%81%3C%2FP%3E%3CP%3E%E6%88%91%E5%9C%A8%20S32K358%20%E8%87%AA%E5%AE%9A%E4%B9%89%E6%9D%BF%E4%B8%AD%E7%9A%84%E7%A1%AC%E4%BB%B6%E8%A7%A6%E5%8F%91%E4%BF%A1%E5%8F%B7%E5%8A%9F%E8%83%BD%E6%96%B9%E9%9D%A2%E9%81%87%E5%88%B0%E4%BA%86%E9%97%AE%E9%A2%98%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%9C%A8%20matlab%202024%20%E4%B8%AD%E4%BD%BF%E7%94%A8%20MBDT%20v1.5%E3%80%82%3C%2FP%3E%3CP%3E%E4%B8%BA%E4%BA%86%E6%9C%89%203%20%E4%B8%AA%20pwm%20%E4%BF%A1%E5%8F%B7%EF%BC%8C%E6%88%91%E5%B7%B2%E7%BB%8F%E9%85%8D%E7%BD%AE%E4%BA%86%20EMIOS_1%20%E7%9A%84%203%20%E4%B8%AA%E9%80%9A%E9%81%93%EF%BC%88ch_9%E3%80%81ch_11%E3%80%81ch_19%EF%BC%89%EF%BC%8C%E6%88%91%E6%8A%8A%E5%AE%83%E4%BB%AC%E9%85%8D%E7%BD%AE%E4%B8%BA%20EMIOS_PWM_IP_MODE_OPWMT%20%E4%BB%A5%E5%90%AF%E7%94%A8%E8%A7%A6%E5%8F%91%E4%BF%A1%E5%8F%B7%E7%94%9F%E6%88%90%E3%80%82%3C%2FP%3E%3CP%3E%E5%9C%A8%20AdcHwTrigger%20%E4%B8%AD%EF%BC%8C%E6%88%91%E9%85%8D%E7%BD%AE%E4%BA%86%203%20%E4%B8%AA%E5%B8%A6%E6%9C%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