Example MPC5777C MCAN-FD simpleTX RX-ISR GHS616

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

Example MPC5777C MCAN-FD simpleTX RX-ISR GHS616

Example MPC5777C MCAN-FD simpleTX RX-ISR GHS616

********************************************************************************
* Detailed Description:
*
* Configures the MCANs to transmit and receive a CAN FD message with or without
* bit rate switching for data phase. This is defined by BRS macro.
* Baudrate during arbitration phase is set to 500kbps, during data phase 1Mpbs
* because of PHY used on the EVB.
*
* In this config, MCAN_0 transmits a message. MCAN_1 receives the message.
*
* MCAN_0 sends message each 1sec. This interval is generated by PIT.
* Single TX buffer is used to send n bytes. The message ID is changed for each
* transmission. Two standard and 2 extended IDs are sent.
*
* MCAN_1 is configured to receive a message, ISR is used to read new message.
* There are 2 standard and 2 extended ID filter tables defined. Classic filter
* configuration is set, means filter ID & mask.
* Messages with matched standard ID are received into RXFIFO_0, messages with matched
* extended ID then stored in RXFIFO_1.
*  
* EVB connection:
*
* J37 and J38 to position 2-3 to connect MCAN1 TX/RX to transceiver
*
* CAN0-CANH on P15-1 to CAN1-CANH on P14-1
* CAN0-CANL on P15-2 to CAN1-CANL on P14-2
*
*
* ------------------------------------------------------------------------------
* Test HW:         MPC5777C-512DS Rev.A + MPC57xx MOTHER BOARD Rev.C
* MCU:             PPC5777CMM03 2N45H CTZZS1521A
* Fsys:            PLL1 = core_clk = 264MHz, PLL0 = 192MHz
* Debugger:        Lauterbach Trace32
* Target:          internal_FLASH
* Terminal:        19200-8-no parity-1 stop bit-no flow control on eSCI_A
*           use USB connector (J21) on minimodule
*
* EVB connection:  ETPUA30 (PortP P23-15) --> USER_LED_1 (P7-1)
*                  ETPUA31 (PortP P23-14) --> USER_LED_2 (P7-2)
*
********************************************************************************

Labels (1)
Attachments
Comments

Hello PetrS

Could you check my question about thie code?

when I cheked main.c, I think that #define MCAN1_BASE_ADDR 0xFFEE8000 is not correct.

As far as I know, MCAN1's base is 0xFFE3_8000...

Could you check it?

Thank you.

Hi Luke,

yes, you are correct. The MCAN1's base is 0xFFE3_8000 on MPC5777C.

In fact this macro is not used in the code, so have no effect. 

It comes from other project (for MPC5777M I think) and I forgot to delete it.

BR, Petr

%3CLINGO-SUB%20id%3D%22lingo-sub-1106601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20MPC5777C%20MCAN-FD%20simpleTX%20RX-ISR%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1106601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E********************************************************************************%3CBR%20%2F%3E*%20Detailed%20Description%3A%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20Configures%20the%20MCANs%20to%20transmit%20and%20receive%20a%20CAN%20FD%20message%20with%20or%20without%3CBR%20%2F%3E*%20bit%20rate%20switching%20for%20data%20phase.%20This%20is%20defined%20by%20BRS%20macro.%3CBR%20%2F%3E*%20Baudrate%20during%20arbitration%20phase%20is%20set%20to%20500kbps%2C%20during%20data%20phase%201Mpbs%3CBR%20%2F%3E*%20because%20of%20PHY%20used%20on%20the%20EVB.%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20In%20this%20config%2C%20MCAN_0%20transmits%20a%20message.%20MCAN_1%20receives%20the%20message.%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20MCAN_0%20sends%20message%20each%201sec.%20This%20interval%20is%20generated%20by%20PIT.%3CBR%20%2F%3E*%20Single%20TX%20buffer%20is%20used%20to%20send%20n%20bytes.%20The%20message%20ID%20is%20changed%20for%20each%3CBR%20%2F%3E*%20transmission.%20Two%20standard%20and%202%20extended%20IDs%20are%20sent.%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20MCAN_1%20is%20configured%20to%20receive%20a%20message%2C%20ISR%20is%20used%20to%20read%20new%20message.%3CBR%20%2F%3E*%20There%20are%202%20standard%20and%202%20extended%20ID%20filter%20tables%20defined.%20Classic%20filter%3CBR%20%2F%3E*%20configuration%20is%20set%2C%20means%20filter%20ID%20%26amp%3B%20mask.%3CBR%20%2F%3E*%20Messages%20with%20matched%20standard%20ID%20are%20received%20into%20RXFIFO_0%2C%20messages%20with%20matched%3CBR%20%2F%3E*%20extended%20ID%20then%20stored%20in%20RXFIFO_1.%3CBR%20%2F%3E*%20%26nbsp%3B%3CBR%20%2F%3E*%20EVB%20connection%3A%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20J37%20and%20J38%20to%20position%202-3%20to%20connect%20MCAN1%20TX%2FRX%20to%20transceiver%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20CAN0-CANH%20on%20P15-1%20to%20CAN1-CANH%20on%20P14-1%3CBR%20%2F%3E*%20CAN0-CANL%20on%20P15-2%20to%20CAN1-CANL%20on%20P14-2%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20------------------------------------------------------------------------------%3CBR%20%2F%3E*%20Test%20HW%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20MPC5777C-512DS%20Rev.A%20%2B%20MPC57xx%20MOTHER%20BOARD%20Rev.C%3CBR%20%2F%3E*%20MCU%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PPC5777CMM03%202N45H%20CTZZS1521A%3CBR%20%2F%3E*%20Fsys%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PLL1%20%3D%20core_clk%20%3D%20264MHz%2C%20PLL0%20%3D%20192MHz%3CBR%20%2F%3E*%20Debugger%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Lauterbach%20Trace32%3CBR%20%2F%3E*%20Target%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20internal_FLASH%3CBR%20%2F%3E*%20Terminal%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%2019200-8-no%20parity-1%20stop%20bit-no%20flow%20control%20on%20eSCI_A%3CBR%20%2F%3E*%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20use%20USB%20connector%20(J21)%20on%20minimodule%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20EVB%20connection%3A%26nbsp%3B%20ETPUA30%20(PortP%20P23-15)%20--%26gt%3B%20USER_LED_1%20(P7-1)%3CBR%20%2F%3E*%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ETPUA31%20(PortP%20P23-14)%20--%26gt%3B%20USER_LED_2%20(P7-2)%3CBR%20%2F%3E*%3CBR%20%2F%3E********************************************************************************%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1106601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E********************************************************************************%3CBR%20%2F%3E*%20Detailed%20Description%3A%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20Configures%20the%20MCANs%20to%20transmit%20and%20receive%20a%20CAN%20FD%20message%20with%20or%20without%3CBR%20%2F%3E*%20bit%20rate%20switching%20for%20data%20phase.%20This%20is%20defined%20by%20BRS%20macro.%3CBR%20%2F%3E*%20Baudrate%20during%20arbitration%20phase%20is%20set%20to%20500kbps%2C%20during%20data%20phase%201Mpbs%3CBR%20%2F%3E*%20because%20of%20PHY%20used%20on%20the%20EVB.%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20In%20this%20config%2C%20MCAN_0%20transmits%20a%20message.%20MCAN_1%20receives%20the%20message.%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20MCAN_0%20sends%20message%20each%201sec.%20This%20interval%20is%20generated%20by%20PIT.%3CBR%20%2F%3E*%20Single%20TX%20buffer%20is%20used%20to%20send%20n%20bytes.%20The%20message%20ID%20is%20changed%20for%20each%3CBR%20%2F%3E*%20transmission.%20Two%20standard%20and%202%20extended%20IDs%20are%20sent.%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20MCAN_1%20is%20configured%20to%20receive%20a%20message%2C%20ISR%20is%20used%20to%20read%20new%20message.%3CBR%20%2F%3E*%20There%20are%202%20standard%20and%202%20extended%20ID%20filter%20tables%20defined.%20Classic%20filter%3CBR%20%2F%3E*%20configuration%20is%20set%2C%20means%20filter%20ID%20%26amp%3B%20mask.%3CBR%20%2F%3E*%20Messages%20with%20matched%20standard%20ID%20are%20received%20into%20RXFIFO_0%2C%20messages%20with%20matched%3CBR%20%2F%3E*%20extended%20ID%20then%20stored%20in%20RXFIFO_1.%3CBR%20%2F%3E*%20%26nbsp%3B%3CBR%20%2F%3E*%20EVB%20connection%3A%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20J37%20and%20J38%20to%20position%202-3%20to%20connect%20MCAN1%20TX%2FRX%20to%20transceiver%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20CAN0-CANH%20on%20P15-1%20to%20CAN1-CANH%20on%20P14-1%3CBR%20%2F%3E*%20CAN0-CANL%20on%20P15-2%20to%20CAN1-CANL%20on%20P14-2%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20%3CBR%20%2F%3E*%20------------------------------------------------------------------------------%3CBR%20%2F%3E*%20Test%20HW%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20MPC5777C-512DS%20Rev.A%20%2B%20MPC57xx%20MOTHER%20BOARD%20Rev.C%3CBR%20%2F%3E*%20MCU%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PPC5777CMM03%202N45H%20CTZZS1521A%3CBR%20%2F%3E*%20Fsys%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PLL1%20%3D%20core_clk%20%3D%20264MHz%2C%20PLL0%20%3D%20192MHz%3CBR%20%2F%3E*%20Debugger%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Lauterbach%20Trace32%3CBR%20%2F%3E*%20Target%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20internal_FLASH%3CBR%20%2F%3E*%20Terminal%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%2019200-8-no%20parity-1%20stop%20bit-no%20flow%20control%20on%20eSCI_A%3CBR%20%2F%3E*%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20use%20USB%20connector%20(J21)%20on%20minimodule%3CBR%20%2F%3E*%3CBR%20%2F%3E*%20EVB%20connection%3A%26nbsp%3B%20ETPUA30%20(PortP%20P23-15)%20--%26gt%3B%20USER_LED_1%20(P7-1)%3CBR%20%2F%3E*%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ETPUA31%20(PortP%20P23-14)%20--%26gt%3B%20USER_LED_2%20(P7-2)%3CBR%20%2F%3E*%3CBR%20%2F%3E********************************************************************************%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1106601%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EGeneral%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1106603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Example%20MPC5777C%20MCAN-FD%20simpleTX%20RX-ISR%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1106603%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Luke%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eyes%2C%20you%20are%20correct.%20The%20MCAN1's%20base%20is%200xFFE3_8000%20on%20MPC5777C.%3C%2FP%3E%3CP%3EIn%20fact%20this%20macro%20is%20not%20used%20in%20the%20code%2C%20so%20have%20no%20effect.%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20comes%20from%20other%20project%20(for%20MPC5777M%20I%20think)%20and%20I%20forgot%20to%20delete%20it.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1106602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Example%20MPC5777C%20MCAN-FD%20simpleTX%20RX-ISR%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1106602%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20%3CA%20class%3D%22jx-jive-macro-user%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fpeople%2FPetrS%22%20target%3D%22_blank%22%3EPetrS%3C%2FA%3E%E2%80%8C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ECould%20you%20check%20my%20question%20about%20thie%20code%3F%3C%2FP%3E%3CP%3Ewhen%20I%20cheked%20main.c%2C%20I%20think%20that%20%23define%20MCAN1_BASE_ADDR%200xFFEE8000%20is%20not%20correct.%3C%2FP%3E%3CP%3EAs%20far%20as%20I%20know%2C%20MCAN1's%20base%20is%200xFFE3_8000...%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ECould%20you%20check%20it%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎09-22-2016 03:16 AM
Updated by: