You are here

Bug found in AS5047P encoder driver

1 post / 0 new
dpeinado
Offline
Last seen: 1 day 21 hours ago
VESC Free
Joined: 2022-01-14 11:59
Posts: 20
Bug found in AS5047P encoder driver

In the file enc_as504x.c, there is the definition of the registers addresses as:

#define AS504x_SPI_DIAG_ADR                                      0x3FFD
#define AS504x_SPI_MAGN_ADR                                    0x3FFE
#define AS504x_SPI_CLEAR_ERROR_ADR                    0x0001

This is correct for the AS5048A encoder, BUT for the AS5047P the correct addresses are:
#define AS504x_SPI_DIAG_ADR                                    0x3FFC
#define AS504x_SPI_MAGN_ADR                                  0x3FFD
#define AS504x_SPI_CLEAR_ERROR_ADR                  0x0001

In vesc-tool if you select the AS5047P the driver called is this one: enc_as504x.c, so you will have troubles for sure. This issue is here from the beggining and as the normal setup is to connect the MISO to Vcc, this problem is masked. Sometimes it works, but sometimes it does not, and you will get crazy for sure.

I think that this shall be taken into account as soon as possible in the firmware.

I will open an issue in the github repository