Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

Not applicable
i wanted to ask a few basic question regarding CAN configuration on XMC4500...
1. If you dont enable the loopback mode does the CAN node itself connects to the external TX and RX or do you have to tell it to be setting some bit, if you have to which bit it is?
2. There are 16 interrupts line but on Keil uVision 5' System Viewer it says that only CAN0,1,2,3 and 7 interrupts can be used where as in startup files there are only 8 interrupts.
3. Can i test external bus by connecting the Tx of Node 0 with Rx of Node 1 and simillarly for Rx of Node 0 without using the transceiver IC?
4. You can select the Rx line by RXSEL fiel in NPCR but can you do anything about the Tx for CAN nodes or the signal is forwarded to all of the connected Tx to the node and is used on only those lines where
the Port configuration corresponds to the alternate function for CANx.Tx?
Thanks in advance..
0 Likes
5 Replies
Not applicable
Hello some answers below:
Arslan wrote:
i wanted to ask a few basic question regarding CAN configuration on XMC4500...
1. If you dont enable the loopback mode does the CAN node itself connects to the external TX and RX or do you have to tell it to be setting some bit, if you have to which bit it is?

You have to assign the TX pin explicitly by assigning the alternate function to one of the possible GPIO pins.
The same with RXD. In the case of RX it is a MultiCAN Port Input Control register NPCRx.RXSEL.
Both are easy done with DAVE 3.x. I'm still looking for the best way doing it with XMC Library coming with DAVE 4.0

2. There are 16 interrupts line but on Keil uVision 5' System Viewer it says that only CAN0,1,2,3 and 7 interrupts can be used where as in startup files there are only 8 interrupts.

no idea

3. Can i test external bus by connecting the Tx of Node 0 with Rx of Node 1 and simillarly for Rx of Node 0 without using the transceiver IC?

This could work when you only connect two nodes, but I'm not sure, never done it this way.

4. You can select the Rx line by RXSEL fiel in NPCR but can you do anything about the Tx for CAN nodes or the signal is forwarded to all of the connected Tx to the node and is used on only those lines where
the Port configuration corresponds to the alternate function for CANx.Tx?
Thanks in advance..

Each nodes TX line can be connected only to special pins dedicated to this node. You have to set IOCR in some way, like this example

/* Configure the TXD Pin as alternate function pin */
WR_REG(PORT1->IOCR4, 0xb800U, PORT_IOCR_PC1_PCR_Pos, 0x11U);
0 Likes
Not applicable
Thanks it really helped..as far selection for RXSEL is concerned the DAVE 4 peripheral library provides a function call to input select you can look it up in header file of CAN peripheral..
0 Likes
Not applicable
Arslan wrote:
Thanks it really helped..as far selection for RXSEL is concerned the DAVE 4 peripheral library provides a function call to input select you can look it up in header file of CAN peripheral..


Thanks, found the XMC_... function.
Still looking how I can configure the GPIO alternate function for CAN TXD
0 Likes
Not applicable
I think the CAN tx signal is routed to all the selected pins however is outputted only on the pins for which the Alternate function is selected. tell me is that works for you. you can change the function of pin by XMC_GPIO_SetMode(); function
0 Likes
Not applicable
Thanks again Arslan a just figured out the following

/* Configure the TXD Pin as alternate function pin
* This is for XMC4200 Node1 P1.5
* See 16.7.4 MultiCAN Module External Registers
* And GPIO
* XMC4400 Table 24-5 Standard PCx Coding
* XMC4100/4200 Table 22-5 Standard PCx Coding
*
* GPIO Output has to be set to Push-pull Alternate Output Function x
* according XMC family, CAN Node number and Pin
*
* */

XMC_GPIO_SetMode(XMC_GPIO_PORT1, 5, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT1);


I will test later if theory meets practice.
Heinz
0 Likes