This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F280049C: CAN Bus external transmit, node not recognized

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: C2000WARE

Hey there,

First, I am a student engineer and the opposite of experienced, so please excuse obvious stupidity.

Now, I am using the C2000 example project "can_ex3_external_transmit", and I've changed the receive module from CAN-B to CAN-A and deleted every command concerning CAN-B.

I have a transceiver set up, which is working on 4V high level, which shouldn't be a problem (?)

I have an oscilloscope hooked up to the Rx-pin GPIO30 and i am seeing the message being sent on 50kbps.

Now, there is never any interrupt triggered, and therefore no ACK, which has my CAN BUS ANALYZER on "error passive" TX ERR: 128...

I'm not exactly sure what to do next and would appreciate help.

Thanks in advance

Chris

Here my Code:


// $
//#############################################################################

//
// Included Files
//
#include "driverlib.h"
#include "device.h"

//
// Defines
//
#define TXCOUNT 100
#define MSG_DATA_LENGTH 4
#define TX_MSG_OBJ_ID 1
#define RX_MSG_OBJ_ID 1

//
// Globals
//
volatile unsigned long i;
volatile uint32_t txMsgCount = 0;
volatile uint32_t rxMsgCount = 0;
volatile uint32_t errorFlag = 0;
uint16_t txMsgData[4];
uint16_t rxMsgData[4];

//
// Function Prototypes
//
__interrupt void canaISR(void);

//
// Main
//
void main(void)
{
//
// Initialize device clock and peripherals
//
Device_init();

//
// Initialize GPIO and configure GPIO pins for CANTX/CANRX
// on module A and B
//
Device_initGPIO();
GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXA);
GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXA);

//
// Initialize the CAN controllers
//
CAN_initModule(CANA_BASE);

//
// Set up the CAN bus bit rate to 500kHz for each module
// Refer to the Driver Library User Guide for information on how to set
// tighter timing control. Additionally, consult the device data sheet
// for more information about the CAN module clocking.
//
CAN_setBitRate(CANA_BASE, DEVICE_SYSCLK_FREQ, 50000, 20);

//
// Enable interrupts on the CAN B peripheral.
//
CAN_enableInterrupt(CANA_BASE, CAN_INT_IE0 | CAN_INT_ERROR |
CAN_INT_STATUS);

//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();

//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();

//
// Enable Global Interrupt (INTM) and realtime interrupt (DBGM)
//
EINT;
ERTM;

//
// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.
// This registers the interrupt handler in PIE vector table.
//
Interrupt_register(INT_CANA0, &canaISR);

//
// Enable the CAN-B interrupt signal
//
Interrupt_enable(INT_CANA0);
CAN_enableGlobalInterrupt(CANA_BASE, CAN_GLOBAL_INT_CANINT0);


// Initialize the receive message object used for receiving CAN messages.
// Message Object Parameters:
// CAN Module: B
// Message Object ID Number: 1
// Message Identifier: 0x95555555
// Message Frame: Extended
// Message Type: Receive
// Message ID Mask: 0x0
// Message Object Flags: Receive Interrupt
// Message Data Length: 4 Bytes
//
CAN_setupMessageObject(CANA_BASE, RX_MSG_OBJ_ID, 0x001,
CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_RX, 0,
CAN_MSG_OBJ_RX_INT_ENABLE, MSG_DATA_LENGTH);

//
// Start CAN module A and B operations
//
CAN_startModule(CANA_BASE);

//
// Transmit messages from CAN-A to CAN-B
//
for(i = 0; i < TXCOUNT; i++)
{
//
// Check the error flag to see if errors occurred
//
if(errorFlag)
{
asm(" ESTOP0");
}

}
for(;;)
{IDLE;}
//
// Stop application
//
asm(" ESTOP0");
}

//
// CAN B ISR - The interrupt service routine called when a CAN interrupt is
// triggered on CAN module B.
//
__interrupt void
canaISR(void)
{

//
// Get the received message
//
CAN_readMessage(CANA_BASE, RX_MSG_OBJ_ID, rxMsgData);

//
// Getting to this point means that the RX interrupt occurred on
// message object 1, and the message RX is complete. Clear the
// message object interrupt.
//
CAN_clearInterruptStatus(CANA_BASE, RX_MSG_OBJ_ID);

//
// Increment a counter to keep track of how many messages have been
// received. In a real application this could be used to set flags to
// indicate when a message is received.
//
rxMsgCount++;


//
// Clear the global interrupt flag for the CAN interrupt line
//
CAN_clearGlobalInterruptStatus(CANA_BASE, CAN_GLOBAL_INT_CANINT0);

//
// Acknowledge this interrupt located in group 9
//
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
}

//
// End of File
//