Example ASR S32K312 EMIO PWM Generation & Duty capture using Interrupt DS3.5 RTD300

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Example ASR S32K312 EMIO PWM Generation & Duty capture using Interrupt DS3.5 RTD300

Example ASR S32K312 EMIO PWM Generation & Duty capture using Interrupt DS3.5 RTD300

*******************************************************************************

The purpose of this demo application is to present a usage of the
EMIOS IP Driver in Interrupt mode for the S32K3xx MCU.

The example use to :--
EMIOS-1 - ch-0  --> PTC24 --> Generate the PWM
EMIOS-1 - ch-1  --> PTC25 --> is the ICU channel to measure the duty


Pins used :--

Dinesh_Guleria_0-1733896956186.png

Dinesh_Guleria_4-1733897197653.png

 

Dinesh_Guleria_5-1733897299281.jpeg

 


This example is tested for SAIC & IPWM mode both. You can change the mode by this setting in MEX file :--

Dinesh_Guleria_3-1733900502087.png

 
 
Difference between SAIC & IPWM,  ICU Driver User Manual :--

Dinesh_Guleria_2-1733897086528.png

 

These Two Macro :--
SAIC_MODE  --> this maco will enable variables to store for SAIC mode
CUSTOM_IRQ  --> this MACRO will enable customized IRQ or RTD available IRQ

Dinesh_Guleria_8-1733897822913.png

 



Result :--

Dinesh_Guleria_2-1733900446350.png

 

 

Sometimes Compiling error comes, in Autogenerated RTD file.   
Change the Header file name :--

Dinesh_Guleria_1-1733900369112.png

 


 ------------------------------------------------------------------------------
* Test HW: S32K3X2EVB-Q172
* MCU: S32K312
* Compiler: S32DS3.5
* SDK release: RTD 3.0.0
* Debugger: PE micro
* Target: internal_FLASH
********************************************************************************

Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-2011680%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20ASR%20S32K312%20EMIO%20PWM%20Generation%20%26amp%3B%20Duty%20capture%20using%20Interrupt%20DS3.5%20RTD300%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2011680%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CP%3E%3CSPAN%3E*******************************************************************************%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20purpose%20of%20this%20demo%20application%20is%20to%20present%20a%20usage%20of%20the%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EEMIOS%20IP%20Driver%20%3CSTRONG%3Ein%20Interrupt%20mode%3C%2FSTRONG%3E%20for%20the%20S32K3xx%20MCU.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20example%20use%20to%20%3A--%3CBR%20%2F%3E%3C%2FSPAN%3E%3CSPAN%3EEMIOS-1%20-%20ch-0%26nbsp%3B%20--%26gt%3B%20PTC24%20--%26gt%3B%20Generate%20the%20PWM%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3EEMIOS-1%20-%20ch-1%26nbsp%3B%20--%26gt%3B%20PTC25%20--%26gt%3B%20is%20the%20ICU%20channel%20to%20measure%20the%20duty%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EPins%20used%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_0-1733896956186.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_0-1733896956186.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315254iBCC9756AC118DC92%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_0-1733896956186.png%22%20alt%3D%22Dinesh_Guleria_0-1733896956186.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_4-1733897197653.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_4-1733897197653.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315261i369D792F5ABF5157%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_4-1733897197653.png%22%20alt%3D%22Dinesh_Guleria_4-1733897197653.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_5-1733897299281.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_5-1733897299281.jpeg%22%20style%3D%22width%3A%20301px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315262i62370EDFCC9F02CB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_5-1733897299281.jpeg%22%20alt%3D%22Dinesh_Guleria_5-1733897299281.jpeg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CBR%20%2F%3EThis%20example%20is%20tested%20for%20SAIC%20%26amp%3B%20IPWM%20mode%20both.%20You%20can%20change%20the%20mode%20by%20this%20setting%20in%20MEX%20file%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_3-1733900502087.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_3-1733900502087.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315283i9A9E5D40CB322BF9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_3-1733900502087.png%22%20alt%3D%22Dinesh_Guleria_3-1733900502087.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3E%26nbsp%3B%3CSPAN%20data-teams%3D%22true%22%3E%3CBR%20%2F%3E%26nbsp%3B%3CBR%20%2F%3EDifference%20between%20SAIC%20%26amp%3B%20IPWM%2C%26nbsp%3B%20ICU%20Driver%20User%20Manual%20%3A--%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_2-1733897086528.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_2-1733897086528.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315259i73AAC686AAB88C90%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_2-1733897086528.png%22%20alt%3D%22Dinesh_Guleria_2-1733897086528.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThese%20Two%20Macro%20%3A--%3CBR%20%2F%3ESAIC_MODE%26nbsp%3B%20--%26gt%3B%20this%20maco%20will%20enable%20variables%20to%20store%20for%20SAIC%20mode%3CBR%20%2F%3ECUSTOM_IRQ%26nbsp%3B%20--%26gt%3B%20this%20MACRO%20will%20enable%20customized%20IRQ%20or%20RTD%20available%20IRQ%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_8-1733897822913.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_8-1733897822913.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315268iA7EF4A2347B2DD3A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_8-1733897822913.png%22%20alt%3D%22Dinesh_Guleria_8-1733897822913.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EResult%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_2-1733900446350.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_2-1733900446350.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315282i2AFE6E67B02F7FE5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_2-1733900446350.png%22%20alt%3D%22Dinesh_Guleria_2-1733900446350.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CP%3ESometimes%20Compiling%20error%20comes%2C%20in%20Autogenerated%20RTD%20file.%26nbsp%3B%20%26nbsp%3B%3CBR%20%2F%3EChange%20the%20Header%20file%20name%20%3A--%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_1-1733900369112.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_1-1733900369112.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315281i7E28BB436348C237%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_1-1733900369112.png%22%20alt%3D%22Dinesh_Guleria_1-1733900369112.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B------------------------------------------------------------------------------%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Test%20HW%3A%20S32K3X2EVB-Q172%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20MCU%3A%20S32K312%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Compiler%3A%20S32DS3.5%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20SDK%20release%3A%20RTD%203.0.0%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Debugger%3A%20PE%20micro%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Target%3A%20internal_FLASH%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E********************************************************************************%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎12-11-2024 12:03 AM
Updated by: