Using AS5048(SPI) and firmware update


We are using the 56V Odrive V3.6 . We are trying to use the AS5048 SPI encoder and have merged the update provided to Tobinhall with the latest version of the firmware. We flashed the new firmware on to the drive and it failed to read the bus voltage and keeps displaying 12V, although we supply 48V.

We went back and flashed with the older versions of the firmware and the problem persists.

Would like some support to get the firmware up and running which can handle the AS5048 SPI encoder.


Please use the RazorsEdgeTesting branch, it’s in Beta testing now and supports the AS5048


Thank you for your response. Tried using this branch and couldnt get the encoder to work. pos_cpr always shows 0.

Here are some notes:

  • First of, everytime after power cycle of the board, if the MOSI of the encoder is connected to the 3.3V on the ODrive board, then odrv0.vbus_voltage always spits 12.0. But if we disconnect the MOSI from 3.3V and reconnect, then the odr0.vbus_voltage spits the correct voltage of 48V. This is very strange and happened with both the RazorsEdge and the Tobinhall branch.

  • Next, we had merged the TobinHall and the latest firmware branches and we got the encoder to work. It was spitting out the correct values. But we were unable to run the calibration successfully. When we tried the dump error command it said the encoder mode is unsupported (which we had set to 257 according to the instructions given at the end of encoder page).

PLease let us know if any config has to be specifically changed for the RazerEdge branch??

Thank you.

Sounds like you have a bad encoder configuration to me. Make sure CS is high when left floating, and MOSI/MISO/CLK are not held high. Make sure the MOSI on the encoder is not connected to MOSI on the ODrive - the SPI bus is shared with the motor drivers, and they need to be configured during startup.