AnsweredAssumed Answered

Resetting the beCAN error counters

Question asked by forslof.johan on Apr 20, 2015
I'm in the process of implementing a CAN-based ad-hoc communication protocol on the STM8S208C8 MCU. Slave devices in this systems perform auto-baud detection by monitoring the receive error counter and trying the next timing once it reaches the error passive threshold.

My problem is that I cannot seem to reset CAN_RECR on the beCAN peripheral when it comes time to try the next bit timing. The register itself is documented as read-only (and indeed writes seem to do nothing) and entering/leaving initialization mode also appears not to have any effect.

Is there any way of achieving this short of resetting the MCU or going into loopback mode letting the MCU talk to itself? I realize that ideally I ought to be measuring the bit times directly but doing so reliably seems somewhat complicated and error-prone.

Outcomes