MA302 and MA310 NPP Register

Hi,
I am using a MagAlpha sensor in a BLDC application, the motor has 4 poles and due to size constraints I have a 2 pole target magnet from which I am sensing the angle from, and i am using the UVW outputs to a motor controller.

From my understanding because of my pole count, I need to change the NPP register value to 001 to get 2 pulses per revolution for each output. My problem is that this doesn’t happen when i change the register. I am programing the sensor with an Arduino using the official MagAlpha Arduino library, and the when I write to and read the registers I get the expected values, but I still only end up with 1 pulse per revolution on each UVW output.
What am I doing wrong? happens on both MA3xx sensors

Here is my Arduino code below.

/*

*/

#include <SPI.h>

#include <MagAlphaGen3.h>
#include <MagAlphaPartProperties.h>

//Setup SPI for the magnetic sensor
#define SPI_CS_PIN (7) //Using Digital Pin 7 since its right next to the other SPI pins on the MKR1000 WIFI
#define SPI_SCLK_FREQUENCY (1000000)

MagAlphaGen3 magalpha;

double angle_real;
uint16_t zero, bct, angle_raw;
uint8_t register_value[9];
bool crc_error;

void setup() {

magalpha.begin(SPI_SCLK_FREQUENCY, MagAlphaSPIMode::MODE_0, SPI_CS_PIN, &SPI);

Serial.begin(115200);
while(!Serial);

register_value[6] = magalpha.writeRegister(0x7, B001);//write number of pole pairs to NPP default is 000
//magalpha.setBct(57);
//delay(50);
}

void loop() {
register_value[6] = magalpha.readRegister(0x7);
Serial.println(register_value[6], BIN);
//delay(2000);

}

Hello jamesdonker,

The NPP is not used for specifying the number of poles for the magnet but for the motor. This is to commutate the motor a full 360 degrees as the number of poles of the motor is increased. Increasing magnet beyond 1 pair of poles sacrifices the ability to determine absolute position.

Sense magnet MUST have 2 poles. No option for that.
To set MOTOR polepairs:
Also you have the register bitposition wrong.
void MagAlphaSetPole2Pairs() // For a “4 pole motor”
{
MagAlphaWriteRegister(7, 1 << 5);

}