Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12620 Discussions

MCP2515 CANbus implementation in NIOS using alt_avalon_spi_command on 10M50DA

Honored Contributor II



Straight off, I am a newbie to the FPGA game, but am (trying to) temporarily help fill a hole on our team. 


I have an Altera 10m50da, and am attempting to implement canbus communication using an mcp2515 controller through the alt_avalon_spi commands. 


  1. The main FPGA code was developed by someone other than me, and we have someone to support that, including the Qsys setup for the CANbus on SPI (3 Wire Serial) and CAN_interrupt on PIO (Parallel I/O). 

  2. I was given example NIOS2 code, I have the MCP2515 .c and .h files, and am able to send a CANbus message, but the message keeps repeating itself. 

  3. I cannot read CANbus messages yet. 

  4. I also need to be able to eventually read and write to the FPGA registers on the I2C Master ( 



If anyone has some example NIOS code (reference design), I would appreciate it. 


My code is included in the attachments (if they attached correctly). I think some of this code was referenced from


Thanks for any help!
0 Kudos
1 Reply
Honored Contributor II

Hi, I have started to work on MCP25625, which is similar to your MCP2515. Were you able to get it to work for you with nios? 


0 Kudos