Hello everyone,
I am currently building our Farmbot and have opted to use a slightly different set up with independent encoders, rather than motor shaft mounted ones. It is most similar to Genesis V1.2 I guess, in that I am utilising the RAMPS 1.4 shield, but most of the hardware is closer to Genesis V1.3.
In order to overcome the limitations of multiple encoders on the same master Arduino, I have made a few standalone controllers that are connected locally at each encoder and track the position internally. These can communicate the current position back to the master over CANbus when requested.
My stand alone bench tests all work well, each remote can update the master when needed, but I am having trouble integrating this into the farmbot arduino code. I have gotten a lot of it written in well enough, but it all falls apart when the interrupt routine is created (not just called). Even if the ISR is empty, the timer associated with millis() stops working, and as such the program is kind of halted there.
My ISR is for handling incoming communications, as the internal message buffer of the CANbus chips I have used (MCP2515) are very small, and I have decided to pull these messages into a software buffer as quickly as they come. The ISR keeps responding to messages even if millis() if stopped. This behaviour is not present on the bench unit, the only difference is the additional farmbot firmware along side it.
I’m kind of stuck here and don’t know what to do next. Is there a function in the stock farmbot firmware which modifies this timer, and then my code interferes? I am happy to share all of the code and designs I have made for this modification, just let me know the best way to upload.
Any help on the matter would be greatly appreciated.
Cheers,
Andrew.