Example MPC5777C MCAN simpleTXRX GHS616

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

Example MPC5777C MCAN simpleTXRX GHS616

Example MPC5777C MCAN simpleTXRX GHS616

********************************************************************************
* Detailed Description:
*
* Configures the MCANs to transmit and receive a CAN message.
*
* 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, SW polling is used.
* 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 Petr, can you help me about a first experiment with your code?

I 'm trying to load the .elf attached into your zip and I note that no activity is present on PIN CAN TX of the uP.

Analyzing the code with trace32 I see that for a first time the microprocessor find  MCAN_0.TXBRP.R=0 and it will execute the code here reported (it is your), but no activity I see in the CAN TX PIN of UP...and after this iteration at the next iteration it will be alwasy find MCAN_0.TXBRP.R=1.

if (MCAN_0.TXBRP.R == 0)
{

     ....code of your example

    MCAN_0.TXBAR.R = 0x1; // start transmission for M_CAN0 TX buffer 0
}

Have you any ideas?

I must say that my sample of uP is marked as SPC5777CK3MME3....i.e. I think it has a very old version of chip.

Thanks in advance...and best regards.

Hi Petr,
                Just went through your example code and I noticed you had  mpc577xC.h file. Was this generated file  given by NXP, if yes can you please point me from where you got it ?

Hello Petr,

I cannot receives any  CAN-Message with your code. I use the MPC5777C-516DS evaluation board. I copy and paste your code in the SingleTogglePin example .

Please can you tell me what is wrong in my case ?

%3CLINGO-SUB%20id%3D%22lingo-sub-1109280%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20MPC5777C%20MCAN%20simpleTXRX%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1109280%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%20message.%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%20SW%20polling%20is%20used.%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-1109280%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%20message.%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%20SW%20polling%20is%20used.%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-1109280%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-1109283%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Example%20MPC5777C%20MCAN%20simpleTXRX%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1109283%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Petr%2C%20%3C%2FP%3E%3CP%3EI%20cannot%20receives%20any%26nbsp%3B%20CAN-Message%20with%20your%20code.%20I%20use%20the%20MPC5777C-516DS%20evaluation%20board.%20I%20copy%20and%20paste%20your%20code%20in%20the%20SingleTogglePin%20example%20.%3C%2FP%3E%3CP%3EPlease%20can%20you%20tell%20me%20what%20is%20wrong%20in%20my%20case%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1109282%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Example%20MPC5777C%20MCAN%20simpleTXRX%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1109282%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Petr%2C%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Just%20went%20through%20your%20example%20code%20and%20I%20noticed%20you%20had%26nbsp%3B%26nbsp%3Bmpc577xC.h%20file.%20Was%20this%20generated%20file%20%26nbsp%3Bgiven%20by%20NXP%2C%20if%20yes%20can%20you%20please%20point%20me%20from%20where%20you%20got%20it%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1109281%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Example%20MPC5777C%20MCAN%20simpleTXRX%20GHS616%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1109281%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20Petr%2C%20can%20you%20help%20me%20about%20a%20first%20experiment%20with%20your%20code%3F%3C%2FP%3E%3CP%3EI%20'm%20trying%20to%20load%20the%20.elf%20attached%20into%20your%20zip%20and%20I%20note%20that%20no%20activity%20is%20present%20on%20PIN%20CAN%20TX%20of%20the%20uP.%3C%2FP%3E%3CP%3EAnalyzing%20the%20code%20with%20trace32%20I%20see%20that%20for%20a%20first%20time%20the%20microprocessor%20find%20%26nbsp%3B%3CSPAN%3EMCAN_0.TXBRP.R%3D0%20and%20it%20will%20execute%20the%20code%20here%20reported%20(it%20is%20your)%2C%20but%20no%20activity%20I%20see%20in%20the%20CAN%20TX%20PIN%20of%20UP...and%20after%20this%20iteration%20at%20the%20next%20iteration%20it%20will%20be%20alwasy%20find%26nbsp%3BMCAN_0.TXBRP.R%3D1.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Eif%20(MCAN_0.TXBRP.R%20%3D%3D%200)%3CBR%20%2F%3E%20%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B....code%20of%20your%20example%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20MCAN_0.TXBAR.R%20%3D%200x1%3B%20%2F%2F%20start%20transmission%20for%20M_CAN0%20TX%20buffer%200%3CBR%20%2F%3E%20%7D%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EHave%20you%20any%20ideas%3F%3C%2FP%3E%3CP%3EI%20must%20say%20that%20my%20sample%20of%20uP%20is%20marked%20as%26nbsp%3BSPC5777CK3MME3....i.e.%20I%20think%20it%20has%20a%20very%20old%20version%20of%20chip.%3C%2FP%3E%3CP%3EThanks%20in%20advance...and%20best%20regards.%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎09-20-2016 02:33 AM
Updated by: