Feb 14, 2019
02:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 14, 2019
02:21 PM
Hi,
I have just started to work with infineon xmc 1400 boot kit. After reading through some of its docs and DAVE APP examples,
I was able to transmit and receive packets on the can node connected to the on-board transceiver( pins 4.8 and 4.9).
I am trying to now activate can node on the other pins, like 0.4 and 0.5. However, I dont seem to get any raw signal on the scope from the tx and rx pins (0.4 and 0.5)
and also no packets transmitted when connecting via external transceiver module.
Posting my code below here, which tries to transmit a packet on can node 0 configured to use pins 0.4 and 0.5 to send a packet every second.
Any help would be appreciated. Thanks
I have just started to work with infineon xmc 1400 boot kit. After reading through some of its docs and DAVE APP examples,
I was able to transmit and receive packets on the can node connected to the on-board transceiver( pins 4.8 and 4.9).
I am trying to now activate can node on the other pins, like 0.4 and 0.5. However, I dont seem to get any raw signal on the scope from the tx and rx pins (0.4 and 0.5)
and also no packets transmitted when connecting via external transceiver module.
Posting my code below here, which tries to transmit a packet on can node 0 configured to use pins 0.4 and 0.5 to send a packet every second.
Any help would be appreciated. Thanks
#include//Declarations from DAVE Code Generation (includes SFR declaration)
/**
* @brief main() - Application entry point
*
* Details of function
* This routine is the application entry point. It is invoked by the device startup code. It is responsible for
* invoking the APP initialization dispatcher routine - DAVE_Init() and hosting the place-holder for user application
* code.
*/
#define OneSec 1000000U
void LED_Toggle();
int main(void)
{
DAVE_STATUS_t status;
CAN_NODE_STATUS_t txStatus;
uint32_t timerStatus;
status = DAVE_Init(); /* Initialization of DAVE APPs */
if(status != DAVE_STATUS_SUCCESS)
{
/* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */
XMC_DEBUG("DAVE APPs initialization failed\n");
while(1U)
{
}
}
timerStatus = SYSTIMER_CreateTimer(OneSec,SYSTIMER_MODE_PERIODIC,(void*)LED_Toggle,NULL);
if(timerStatus != 0U)
{
//Timer created successfully
//Start the timer
status = SYSTIMER_StartTimer(timerStatus);
}
/* Placeholder for user application code. The while loop below can be replaced with user application code. */
while(1U)
{
}
}
void LED_Toggle()
{
volatile CAN_NODE_STATUS_t txStatus;
volatile uint32_t status = 0x00;
DIGITAL_IO_SetOutputHigh(&DIGITAL_IO_0);
status = CAN_NODE_MO_GetStatus ( (void*)CAN_NODE_0.lmobj_ptr[0]);
txStatus = CAN_NODE_MO_Transmit(CAN_NODE_0.lmobj_ptr[0]);
if(txStatus == CAN_NODE_STATUS_SUCCESS)
DIGITAL_IO_ToggleOutput(&DIGITAL_IO_0); //Tx Success LED P4.2
DIGITAL_IO_ToggleOutput(&DIGITAL_IO_1); //Timer LED P4.0
}
void EventHandler_CanNode_0()
{
uint32_t status = 0x00;
XMC_CAN_MO_t* lmsgobjct_ptr_1 = CAN_NODE_0.lmobj_ptr[0]->mo_ptr; // CAN_NODE_0 transmit message object pointer
status = CAN_NODE_MO_GetStatus((void*)CAN_NODE_0.lmobj_ptr[0]);
if(status & XMC_CAN_MO_STATUS_TX_PENDING){
CAN_NODE_MO_ClearStatus((void*)CAN_NODE_0.lmobj_ptr[0],XMC_CAN_MO_RESET_STATUS_TX_PENDING);
//Clear the flag
DIGITAL_IO_SetOutputHigh(&DIGITAL_IO_0);
}
// Check for Node error
if ( CAN_NODE_GetStatus(&CAN_NODE_0) & XMC_CAN_NODE_STATUS_ALERT_WARNING )
{
//Clear the flag
CAN_NODE_DisableEvent(&CAN_NODE_0,XMC_CAN_NODE_EVENT_ALERT);
}
}
5 Replies
Feb 18, 2019
05:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 18, 2019
05:37 AM
Hi,
may you please send your project as a .zip file or provide the screenshots of your DAVE APP configuration and most importantly, the CAN TX and RX configuration?
Best regards,
Deni
may you please send your project as a .zip file or provide the screenshots of your DAVE APP configuration and most importantly, the CAN TX and RX configuration?
Best regards,
Deni
Attachments are accessible only for community members.
Feb 18, 2019
07:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 18, 2019
07:12 AM
Hi Deni,
This is my can node configuration. I only have one can_node as you can see in the dave app diagram below.
This is the pin allocation for Can node. I have tried 0.4 and 0.5
These are the hardware signal connections for the can node:
I am also attaching the zip file of my entire project.
Thanks for your time and help
This is my can node configuration. I only have one can_node as you can see in the dave app diagram below.
This is the pin allocation for Can node. I have tried 0.4 and 0.5
These are the hardware signal connections for the can node:
I am also attaching the zip file of my entire project.
Thanks for your time and help
Feb 19, 2019
01:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 19, 2019
01:16 PM
Should I configure the RXEL bits on NPCRx register? The datasheet says particular configurations for different combinations of RXD and TXD, but not sure if it has to be assigned explicitly.
Please let me know, @DRubesa
Please let me know, @DRubesa
Mar 01, 2019
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 01, 2019
09:07 AM
Hi cyberteen,
the RXSEL bits in NPCRx register will be set automatically by the CAN_NODE app itself. There is a call to the following function during the "CAN_NODE_Init":
This function will set the input pin to the correct value.
I´ve checked the project that you sent me and even as I don´t have external transmitter to connect to the pins you selected if I connect TX and RX pins together, I can see the expected CAN pattern on the oscilloscope.
Please try to short circuit TX and RX pins together and have a look do you see the same.
Best regards,
Deni
the RXSEL bits in NPCRx register will be set automatically by the CAN_NODE app itself. There is a call to the following function during the "CAN_NODE_Init":
XMC_CAN_NODE_SetReceiveInput(handle->node_ptr, handle->rx_signal);
This function will set the input pin to the correct value.
I´ve checked the project that you sent me and even as I don´t have external transmitter to connect to the pins you selected if I connect TX and RX pins together, I can see the expected CAN pattern on the oscilloscope.
Please try to short circuit TX and RX pins together and have a look do you see the same.
Best regards,
Deni
Mar 11, 2019
02:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 11, 2019
02:53 PM
Hello Deni,
Thanks for your reply.
I tried short circuiting pins 0.4 and 0.5 on the board and tried to read the signal from one of those pins on a logic analyzer. I am not receiving any valid signals.
Thanks for your reply.
I tried short circuiting pins 0.4 and 0.5 on the board and tried to read the signal from one of those pins on a logic analyzer. I am not receiving any valid signals.