I am trying to learn C and in the process also howto use the CANbus. Now, Ive read that there are bugs in the CAN lib. I have enough problems with C alone, w/o bugs in the core-can-lib so if someone would like to share a fixed version of the CAN-lib we could ask James to put the bugfixed AN-source on www.piclist.com ? Link to the CAN-lib: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appn ote=en011822 Comments/questions on my current problem with AN738 so far is mixed in with the source below: #include "can18xx8.h" #include // CAN module related variables typedef unsigned long NewMessage; typedef BYTE NewMessageData[8]; typedef BYTE MessageData[8]; typedef BYTE NewMessageLen; enum CAN_RX_MSG_FLAGS NewMessageFlags; typedef BYTE RxFilterMatch; // Above I added 'typdef' and 'enum' that helped to get it compiled beyond // CAN_RX_MSG_FLAGS NewMessageFlags; which failed before. // I am not sure if enum is the same as typedef but atleast it compiles. // The intention here must be to declare the variable NewMessageFlags // as of type CAN_RX_MSG_FLAGS ? // Application specific initialization code follows // ------------------------------------------------ // Setup the Node for 1 Megabits/sec using a 40MHz clock CANInitialize(1, // SJW 1, // BRP 8, // PHSEG1 8, // PHSEG2 3, // PROPSEG CAN_CONFIG_PHSEG2_PRG_BIT & CAN_CONFIG_VALID_STD_MSG & CAN_CONFIG_STD_MSG & CAN_CONFIG_DBL_BUFFER_ON); // I get syntax error on the line above starting with: CANInitialize... // its defined in the headerfile "can18xx8.h" as: void CANInitialize(BYTE SJW, BYTE BRP, BYTE PHSEG1, BYTE PHSEG2, BYTE PROPSEG, enum CAN_CONFIG_FLAGS config); What can be wrong?? TIA -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist