Example S32K324 STANDBY wake up using CAN-0-RX and GPIO Switch DS3.5 RTD300

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

Example S32K324 STANDBY wake up using CAN-0-RX and GPIO Switch DS3.5 RTD300

Example S32K324 STANDBY wake up using CAN-0-RX and GPIO Switch DS3.5 RTD300

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

 The purpose of this demo application is to present a usage of the
 POWER & WKUP IP Driver for the S32K3xx MCU.

In current example :--
SW-5 = PTB-26  -----> PRESS to enter the STANDBY mode.
SW-6 = PTB-19 = WKUP[38] --> PRESS to exit the STANDBY mode.
CAN-0-RX = PTA-6 = WKUP[15] --> send CAN message to exit the STANDBY mode

The example uses PIT-0 timer, to generate the periodic interrupt.

The example uses FLEXCAN-0 for transmit & receive using following Message buffer :--
#define RX_MB_IDX_0 10U
#define RX_MB_IDX 11U
#define TX_MB_IDX 12U


BAUDRATE : 500 KBPS


 ------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-T172
* MCU: S32K324
* Compiler: S32DS3.5
* SDK release: RTD 3.0.0
* Debugger: PE micro
* Target: internal_FLASH
********************************************************************************

CAN BUS :--

Dinesh_Guleria_6-1721374510468.png

 



Push Buttons :---


Dinesh_Guleria_0-1721374360734.png

 

 

 

Dinesh_Guleria_1-1721374361256.png

 


Wake-up source, SW-6 GPIO:--

Dinesh_Guleria_2-1721374360866.png

 

Wake-up source, CAN-0-RX :--
According to the IOMUX table in RM, for example, PTA6 can be used as WKPU15 and CAN0_RX. It means that the WKPU15 input doesn't require specific MSCR configuration.
So if its input buffer is enabled and the corresponding WKPU input channel is enabled/configured in the WKPU, it should be able to act as wake-up input.

Dinesh_Guleria_7-1721374532434.png

 

Standby entry :--

Dinesh_Guleria_8-1721374542742.png

 

STandby clock :--

Dinesh_Guleria_9-1721374587254.png

 
Enter Standby mode :--

Dinesh_Guleria_10-1721374619540.png

 



********* If you use external BJT on your board to generate 1.5 volts *******************

Dinesh_Guleria_3-1721374360795.png

 

 

I tested on Our T172 EVB, with NPN external Ballast transistor is selected to supply the V15_MCU domain. I am able to wake up from standby mode.

If we select 2-3 in J31 then NPN external Ballast transistor is selected to supply the V15_MCU domain & wakeup is ok on T172 EVB

You have to make following settings in code :--

Dinesh_Guleria_4-1721374360996.png

 

 

Dinesh_Guleria_5-1721374361280.png

 

Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1911972%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20S32K324%20STANDBY%20wake%20up%20using%20CAN-0-RX%20and%20GPIO%20Switch%20DS3.5%20RTD300%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1911972%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%3E%26nbsp%3BThe%20purpose%20of%20this%20demo%20application%20is%20to%20present%20a%20usage%20of%20the%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3BPOWER%20%26amp%3B%20WKUP%20IP%20Driver%20for%20the%20S32K3xx%20MCU.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3EIn%20current%20example%20%3A--%3CBR%20%2F%3ESW-5%20%3D%20PTB-26%26nbsp%3B%20-----%26gt%3B%20PRESS%20to%20enter%20the%20STANDBY%20mode.%3CBR%20%2F%3ESW-6%20%3D%20PTB-19%20%3D%26nbsp%3BWKUP%5B38%5D%20--%26gt%3B%26nbsp%3BPRESS%20to%20exit%20the%20STANDBY%20mode.%3CBR%20%2F%3E%3CSPAN%3ECAN-0-RX%20%3D%20PTA-6%20%3D%26nbsp%3BWKUP%5B15%5D%20--%26gt%3B%26nbsp%3Bsend%20CAN%20message%20to%20exit%20the%20STANDBY%20mode%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20example%20uses%20PIT-0%20timer%2C%20to%20generate%20the%20periodic%20interrupt.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20example%20uses%20FLEXCAN-0%20for%20transmit%20%26amp%3B%20receive%20using%20following%20Message%20buffer%20%3A--%3CBR%20%2F%3E%3C%2FSPAN%3E%23define%20RX_MB_IDX_0%2010U%3CBR%20%2F%3E%23define%20RX_MB_IDX%2011U%3CBR%20%2F%3E%23define%20TX_MB_IDX%2012U%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSPAN%3EBAUDRATE%20%3A%20500%20KBPS%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSPAN%3E%26nbsp%3B------------------------------------------------------------------------------%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20Test%20HW%3A%20S32K3X4EVB-T172%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E*%20MCU%3A%20S32K324%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********************************************************************************%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3ECAN%20BUS%20%3A--%3CBR%20%2F%3E%3C%2FSTRONG%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_6-1721374510468.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_6-1721374510468.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289336i398E5AE028BE43C7%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_6-1721374510468.png%22%20alt%3D%22Dinesh_Guleria_6-1721374510468.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3EPush%20Buttons%20%3A---%3C%2FSTRONG%3E%3CBR%20%2F%3E%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_0-1721374360734.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-1721374360734.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289330iEB2853DB71532AE4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_0-1721374360734.png%22%20alt%3D%22Dinesh_Guleria_0-1721374360734.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%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_1-1721374361256.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-1721374361256.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289332i828D05581788DFAA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_1-1721374361256.png%22%20alt%3D%22Dinesh_Guleria_1-1721374361256.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CBR%20%2F%3E%3CSTRONG%3EWake-up%20source%2C%20SW-6%20GPIO%3A--%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_2-1721374360866.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-1721374360866.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289331iCFE1289D7D4056C2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_2-1721374360866.png%22%20alt%3D%22Dinesh_Guleria_2-1721374360866.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EWake-up%20source%2C%20CAN-0-RX%20%3A--%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSPAN%3EAccording%20to%20the%20IOMUX%20table%20in%20RM%2C%20for%20example%2C%20PTA6%20can%20be%20used%20as%20WKPU15%20and%20CAN0_RX.%26nbsp%3BIt%20means%20that%20the%20WKPU15%20input%20doesn't%20require%20specific%20MSCR%20configuration.%3CBR%20%2F%3ESo%20if%20its%20input%20buffer%20is%20enabled%20and%20the%20corresponding%20WKPU%20input%20channel%20is%20enabled%2Fconfigured%20in%20the%20WKPU%2C%20it%20should%20be%20able%20to%20act%20as%20wake-up%20input.%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_7-1721374532434.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_7-1721374532434.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289337iAE24B737B6A8FAAE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_7-1721374532434.png%22%20alt%3D%22Dinesh_Guleria_7-1721374532434.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EStandby%20entry%20%3A--%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_8-1721374542742.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-1721374542742.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289338iCFF7B043E1762782%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_8-1721374542742.png%22%20alt%3D%22Dinesh_Guleria_8-1721374542742.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3ESTandby%20clock%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_9-1721374587254.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_9-1721374587254.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289339i28F1E0686AD4FE1B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_9-1721374587254.png%22%20alt%3D%22Dinesh_Guleria_9-1721374587254.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CP%3E%26nbsp%3B%3CBR%20%2F%3E%3CSPAN%3EEnter%20Standby%20mode%20%3A--%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_10-1721374619540.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_10-1721374619540.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289340iE82C4BCD3BD3E77F%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_10-1721374619540.png%22%20alt%3D%22Dinesh_Guleria_10-1721374619540.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3E*********%20If%20you%20use%20external%20BJT%20on%20your%20board%20to%20generate%201.5%20volts%20*******************%3C%2FSTRONG%3E%3CBR%20%2F%3E%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_3-1721374360795.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-1721374360795.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289335i73509FDB98B4488C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_3-1721374360795.png%22%20alt%3D%22Dinesh_Guleria_3-1721374360795.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CP%3EI%20tested%20on%20Our%20T172%20EVB%2C%20with%20NPN%20external%20Ballast%20transistor%20is%20selected%20to%20supply%20the%20V15_MCU%20domain.%20I%20am%20able%20to%20wake%20up%20from%20standby%20mode.%3C%2FP%3E%0A%3CP%3EIf%20we%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Eselect%26nbsp%3B%3CSTRONG%3E2-3%20in%20J31%3C%2FSTRONG%3E%26nbsp%3Bthen%20NPN%20external%20Ballast%20transistor%20is%20selected%20to%20supply%20the%20V15_MCU%20domain%20%26amp%3B%20wakeup%20is%20ok%20on%20T172%20EVB%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20have%20to%20make%20following%20settings%20in%20code%20%3A--%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Dinesh_Guleria_4-1721374360996.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-1721374360996.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289334i1CD10061E111AFD4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_4-1721374360996.png%22%20alt%3D%22Dinesh_Guleria_4-1721374360996.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%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-1721374361280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Dinesh_Guleria_5-1721374361280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F289333iF02E7FD8B778688C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Dinesh_Guleria_5-1721374361280.png%22%20alt%3D%22Dinesh_Guleria_5-1721374361280.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%0A%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎07-19-2024 12:38 AM
Updated by: