According to the datasheet, the STBY pin has an internal pullup, so with nothing connected it will be a 1 (i.e. in Standby Mode).giacomoalbe wrote:Many thanks @dhylands for the lighting fast answer!
You are a life saver, really!
Since I noticed you are really a PRO with CAN and uPython , I'd like to ask two questions about what you said:
1) Does the STBY pin need to be connected to ground? If I leave it simply as is (no connection) would't it be "0" always?
The datasheet says that the MCP2161/2 is rated for 1 Mbps. I just happened to pick 125 kbits for experimenting. In my notes I have the following (which I think I got from another post in the forum):2) Is it possible to increase the baud rate with the by changing the settings in the can init OR with MCP2562 the maximum speed is 125kbaud? This chip should support high speed CAN, so it seems to be that this can be easily achieved by setting things in the right way, but asking is never wrong, in my opinion
Code: Select all
# This worked for 125k baud rate
can1.init(CAN.NORMAL, extframe=False, prescaler=16, sjw=1, bs1=14, bs2=6)
# This worked for 250k baud rate
can1.init(CAN.NORMAL, extframe=False, prescaler=8, sjw=1, bs1=14, bs2=6)
# This worked for 500k baud rate
can1.init(CAN.NORMAL, extframe=False, prescaler=4, sjw=1, bs1=14, bs2=6)
# This worked for 1M baud rate
can1.init(CAN.NORMAL, extframe=False, prescaler=2, sjw=1, bs1=14, bs2=6)
It would probably be good to put some examples on the doc page.Tomorrow morning I'll try to apply your suggestion both in the hardware and in the software, then I'll let you know if I'll work!
After that should be a good thing to post a guide somewhere on the Web in order for other to easily manage to setup CAN communication with uPython! Thinking about doing this, in order to give back to the (astonishingly kind) community who helped out!