As the MS CANbus implementation is at 500k and using extended 29 bit identifiers and most OEM driveline implementations are using 500k and 11 bit IDs, there is no reason why they can't coexist in a project vehicle.
Modifications to source code needed
{FIle}
{approximate Line Number} {code Change}
- Code: Select all
ms2_extra.h
122 #define MSG_STD 11
1174 void ECANSendMessage(unsigned int id, unsigned char *data, unsigned char dataLen, unsigned char msgType) FAR_TEXT39_ATTR;
1221 void user_defined(long tmptime) FAR_TEXT3b_ATTR; // was 3a change to 3b
- Code: Select all
ms2_can_isr.c
29 case MSG_STD: // msg format 11 bit STD - do not let MSII mess with it
// reset identifier registers for standard ID
CAN_TB0_IDR0 = (unsigned char)(can[ix].cx_destvaroff[jx] >> 3);
// 8 high bits in IDR0, 3 low bits in IDR1
CAN_TB0_IDR1 = (unsigned char)((can[ix].cx_destvaroff[jx] & 0x0007) << 5);
CAN_TB0_IDR2 = (unsigned char)(0x00);
CAN_TB0_IDR3 = (unsigned char)(0x01);
CAN_TB0_DLR = (unsigned char) (can[ix].cx_varbyt[jx]);
for (kx = 0;kx < CAN_TB0_DLR;kx++) {
*(&CAN_TB0_DSR0 + kx) = can[ix].cx_datbuf[jx][kx];
}
break;
Thats it for the changes to existing source code - the new function and main high level code can be held in ms2_extra_user.c as detailed in Part 2 below



