adlerweb / CAN_BUS_Shield

(Mostly deprecated, use upstream!)
MIT License
7 stars 6 forks source link

Handling the hardware reset pin #5

Open Stephen-Bath opened 1 year ago

Stephen-Bath commented 1 year ago

Currently the library does not perform any handling for pins that might be connected to the devices hardware reset line, is this intentional?

Boards such as the CAN SPI Click connect up the hardware reset line which needs to be actively pulled high to remove the device from reset.

Currently I modified the library to optionally perform a hardware reset (holding the reset line low for a period of time before pulling it high again) as part of library initialisation. Default behaviour, if no reset pin is defined, is the same as the unmodified libraries behaviour.

I'm happy to raise a pull request providing this functionality if desired but wasn't sure whether this behaviour was deliberately not part of the libraries functionality.

adlerweb commented 1 year ago

Hi, this is a snapshot of https://github.com/Seeed-Studio/Seeed_Arduino_CAN, so best check over there for latest development or pull requests.

On my boards I connected MCP-RST to MCU-RST, so they both use the same manual reset switch. For normal boot, a software reset as called during initialization should be sufficient to get the MCP to a defined state.