Not applicable
Mar 14, 2015
05:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 14, 2015
05:33 AM
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..
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..
5 Replies
Not applicable
Mar 15, 2015
02:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 15, 2015
02:41 AM
Hello some answers below:
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
no idea
This could work when you only connect two nodes, but I'm not sure, never done it this way.
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);
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);
Not applicable
Mar 16, 2015
05:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 16, 2015
05:02 AM
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..
Not applicable
Mar 19, 2015
02:27 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 19, 2015
02:27 PM
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
Not applicable
Mar 21, 2015
12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 21, 2015
12:09 AM
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
Not applicable
Mar 21, 2015
11:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 21, 2015
11:21 AM
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
/* 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