Hi,
void CAN_transmit_Msg(CAN_Type * CANchannel, uint32_t *transmitDATA, uint32_t transmitID) {
CANchannel->IFLAG1 = 0x00000001; /* Clear CAN 0 MB 1 flag without clearing others*/
// Assign the MsgID to the Transmit data
CANchannel->RAMn[ 0*MSG_BUF_SIZE + 1] = (transmitID) << 18; // Assign the Transmit Message ID
// Prepare Data Word 0 and Data Word 1, by saving in required MBuff, which needs to be transmitted to Bus
CANchannel->RAMn[ 0*MSG_BUF_SIZE + 2] = transmitDATA[0]; // MB0 word 2: data word 0
CANchannel->RAMn[ 0*MSG_BUF_SIZE + 3] = transmitDATA[1]; // MB0 word 3: data word 1
//Set the parameters of the CAN Protocol, and activate channel to transmit message on Bus
CANchannel->RAMn[ 0*MSG_BUF_SIZE + 0] = 0x0C400000 | 8 <<CAN_WMBn_CS_DLC_SHIFT;// MB0 word 0: // EDL,BRS,ESI=0: CANFD not used
// CODE=0xC: Activate msg buf to transmit
// IDE=0: Standard ID
// SRR=1 Tx frame (not req'd for std ID)
// RTR = 0: data, not remote tx request frame
// DLC = 8 bytes
}
This is the function written for transmitting in MB0. When i changed it to MB1 and MB2 by replacing 0 by 1 and 2. its not working. Which all places i should change ?