Other Parts Discussed in Thread: SN65HVD23
Tool/software:
I used syscfg to generate the driver code, and I referred to EX1, EX2, and EX5 in the routine, and the expected effect was that when I sent data from an external CAN analyzer, the CANB received an interrupt and replied with a message. But the actual effect is that I use a logic analyzer to directly observe the CANB transceiver pins (pin12 and pin13), and only the transmit pin in external loopback mode can observe the outgoing data, and only the data on the receiving pin in silent mode can cause the receive interruption.
here I insert the syscfg and some of my code:
/** * These arguments were used when this file was generated. They will be automatically applied on subsequent loads * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. * @cliArgs --board "/boards/LAUNCHXL_F280049C" --context "system" --product "C2000WARE@4.03.00.00" * @versions {"tool":"1.20.0+3587"} */ /** * Import the modules used in this configuration. */ const can = scripting.addModule("/driverlib/can.js", {}, false); const can1 = can.addInstance(); /** * Write custom configuration values to the imported modules. */ can1.$name = "myCAN0"; can1.enableInterrupt = true; can1.registerInterrupts = true; can1.interruptFlags = ["CAN_INT_IE0"]; can1.interruptLine = ["CAN_GLOBAL_INT_CANINT0"]; can1.msgObjsUsed = [1,2]; can1.can.can_rxPin.$assign = "boosterpack1.3"; can1.can.can_txPin.$assign = "boosterpack2.51"; can1.can0Int.enableInterrupt = true; can1.msgObj1.$name = "msgObj0"; can1.msgObj1.msgType = "CAN_MSG_OBJ_TYPE_TX"; can1.msgObj1.flags = ["CAN_MSG_OBJ_TX_INT_ENABLE"]; can1.msgObj1.msgLen = 4; can1.msgObj2.$name = "msgObj1"; can1.msgObj2.flags = ["CAN_MSG_OBJ_RX_INT_ENABLE"]; /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ can1.can.$suggestSolution = "CANB";