Mcp2515 Module with arduino uno

Hello , I used Mcp2515 module connected with arduino uno to control motor with can bus communcation.

connect the module with mcp2515 through spi pins

CS to pin 10
Si to pin 11
so to pin 12
sck to pin 13
and gnd to GND
VCC to 5v

the problem when i use a new module with ardunio it's working fine and when i put any other codes for arduino and back again to use mcp2515 module with Arduino and the motor the module doesn't work anymore and i can't see any output signal from oscilloscope, is that problem related to the module quality or what??

Thank you in advance