TonyKramer
New Member
Hello!
For a project I've been working on, I've been using ten PicAxe 40X2s connected to each other over a CAN bus by the use of the MCP2515 and MCP2551 ICs. That being said, although I could find some references to the MCP2515 here and there, I never really found any concrete "Library" functions for it. So over the last few days, I've been working closely with the PicAxe Manual 2 and the MCP2515 datasheet to bring forth this long function. To be honest, I have not tested it yet, because I am looking at refining the code a large amount. The code as of now uses over 1000 bytes. Another thing that I wanted to clear up is the deference between Subroutines and the Macro command. Is there any memory/speed advantage of using one over the other?
I just wanted to put this code out there for further suggestions and also in case someone needs a base upon which to build there own code. I am going to heavily refine it and add other functions, so I will include that later.
Although I've been part of the forum for a fairly long time now, I've never posted anything, so I am sorry if I happen to mess up a bunch of the rules.
Thank you,
-Tony
View attachment CAN Bus Implementation Mk2.bas I just realized that the Mk1 file has the same memory spaces used multiple times over and overwriting each other.
For a project I've been working on, I've been using ten PicAxe 40X2s connected to each other over a CAN bus by the use of the MCP2515 and MCP2551 ICs. That being said, although I could find some references to the MCP2515 here and there, I never really found any concrete "Library" functions for it. So over the last few days, I've been working closely with the PicAxe Manual 2 and the MCP2515 datasheet to bring forth this long function. To be honest, I have not tested it yet, because I am looking at refining the code a large amount. The code as of now uses over 1000 bytes. Another thing that I wanted to clear up is the deference between Subroutines and the Macro command. Is there any memory/speed advantage of using one over the other?
I just wanted to put this code out there for further suggestions and also in case someone needs a base upon which to build there own code. I am going to heavily refine it and add other functions, so I will include that later.
Although I've been part of the forum for a fairly long time now, I've never posted anything, so I am sorry if I happen to mess up a bunch of the rules.
Thank you,
-Tony
View attachment CAN Bus Implementation Mk2.bas I just realized that the Mk1 file has the same memory spaces used multiple times over and overwriting each other.
Attachments
-
16.9 KB Views: 18
Last edited: