Hey guys, anyone know what would cause a CAN Tx timeout when calling the SendMessage() function? My CanInit() returns OK and if my channels were either not available or all in use, I would get a different return value from SendMessage(). I have my CAN Rx and Tx connected to a CAN transceiver as well but if there was a wiring issue, would that cause this error?
It looks like you may be confusing which CAN module you're using. You mention you're initializing CAN0, then set up the pins for CAN1. If you're using CAN0 (and the canif.h files), you need to actually initialize pins 39 and 42. While CanInit may return OK, the init call pretty much sets up the appropriate registers for use, turns on an interrupt then says I'm ready to run. If you're using CAN1, you'll need to use the multican.h files as your include and interface. The functionality is the same as the canif.h files, there's just an extra argument in front of all the calls for which CAN module you're addressing.
If you're doing what I think you're doing, you've initialized the registers for CAN0, but want to use the CAN1 lines. The chip says it's inited okay, but you're timing out because the CAN module is trying to listen on the 0 lines and not hearing anything.
If this is your first time using our CAN module, you'll also need to know that you'll probably need an external CAN transceiver. The MOD-DEV-70s do not have one of these. If you're using a MOD-DEV-100, it does, but you'll have to configure the jumpers such that the CAN1 pins are attached to the transceiver to get this working properly if that's what you're doing. If you're using your own hardware, I'm just assuming you've connected things appropriately, but it may also be helpful for debugging here for you to include a schematic or diagram or explanation of how you've attached your hardware.
Ok, I made the change to CAN0 (no need to use CAN1 on my side). So with that said, everything is the same but still get the -5 return. I am using a CAN transceiver, so if my wiring is not correct, would this cause a timeout? Just trying to understand from the CAN side of things what causes timeouts....