pierremolinaro / acan2515

MCP2515 CAN Controller Driver for Arduino
MIT License
77 stars 30 forks source link

Sleep mode example #32

Open joeholdsworth opened 2 years ago

joeholdsworth commented 2 years ago

Firstly thank you for this library it is very very useful.

I'm trying to understand the sleep function, would it be possible to add to your examples, that would be great.

At the moment I put the transiever in standby then change the mode to sleep. I have also enabled the interrupt pins wake on CAN function.

When there is traffic on the CAN the interrupt works, I then take the transiever out of standby and change the mode to normal. The return value from the changeModeOnTheFly function is 0, so appears good.

I then use CAN tryandsend (which returns true) but nothing appears on the CAN bus where as it did before I put the unit into sleep.

If I don't put the can transiever into stanby and only use sleep the same happens.

When I come out of sleep mode the can recieve message appears to be constanlty fired as if the read register bit is not being cleared anymore....

I could well be doing something wrong and thanks for any help.