Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I'm trying to create a module that listens to CANbus using a CY8CKIT-059 with an MCP2551 CAN transceiver, and it's not working at all.
I've created an empty project with a CAN component, and implemented every interrupt callback as a function that increments a counter and toggles the LED. When I run it, there's a constant stream of error interrupts. The LED pin emits an almost perfect 29Hsz square wave, so an interrupt every 17ms, mostly bit stuffing errors and bit errors, and a few overloads, even when the CAN bus is idle (whether or not there's traffic on the bus doesn't seem to effect behavior). When I do post messages to the bus using one of the other devices, the CAN_ReceiveMsgCallback never gets called.
I have one receive buffer set to basic, and all the transmit buffers disabled. I have 3 other devices on the CAN bus (a bus debugger and 2 motor controllers), and they all get along fine, but the PSoC gets nothing but errors. I've scoped the bus and the transceiver output looks correct, I've double checked that all the bauds match up (250kbps). I'm guessing I'm doing something wrong with the component initialization or clocks. I've never done CAN before so I'm a bit at a loss as to where to start debugging.
Attached is the project that demonstrates the issue.