kentindell / canhack

The Yes We CAN project of Canis Labs
MIT License
348 stars 65 forks source link

RuntimeError: Cannot put MCP2517/18FD into config mode #12

Open jhonrputra opened 2 years ago

jhonrputra commented 2 years ago

Hi,

I tried these commands: from canpico import * c = CAN()

Then it raised an error: RuntimeError: Cannot put MCP2517/18FD into config mode

Any insight?

Thank you.

Regards, Jhon R Putra

kentindell commented 2 years ago

That indicates the controller chip has failed to respond to the SPI command to put it into config mode. It could be a hardware failure: bad SPI connection, or a chip fault. Or it could possibly be the USB power supply isn't powering up the controller properly.

There are two versions of the CANPico: one where the Pico was hand-soldered down on the board, and one where the pick and place machine did it. Do you know which you have? (All the boards we send out are individually tested, and the "add your Pico" board was tested using a 'bed of nails' rig, so it's possible that the later hand soldering of a Pico had a problem).

kentindell commented 2 years ago

Also is it a MCP2517FD or a MCP2518FD CAN controller on the PCB?

kentindell commented 2 years ago

Have been doing some investigation and I think the pick and place machine that assembled the Pico on to the CANPico didn't do a proper job in some cases, causing the soldering of the SPI pins on the Pico to be bad, which in turn causes a lack of communication with the CAN controller, and then the software doesn't hear back and gives that error message.

We are now going back to our PCB assembler to get the boards re-worked. But if you want to get up and running now this can be fixed easily enough with a quick bit of soldering: if you're confident enough for that: hand solder the pins on the Pico that are connected to the CANPico underneath (you don't have to do all the Pico's pins: just the ones that have labels on the underside of the CANPico PCB).

zelat commented 11 months ago

Why your board don't share GND with Pico board? Do I need to connect the CAN board's GND to Pico's GND?

kentindell commented 11 months ago

It does share a ground. The boards come assembled with a Pico W, so this should not be an issue.