cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting the beCAN error counters

johanf
Associate
Posted on April 20, 2015 at 14:28

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.

#becan #can #stm8
0 REPLIES 0