What's wrong with my code for reading register of MagAlpha MA730?

I’m learning how to use MagAlpha MA730. I can read the angle correctly.
But when I want to read the register, I get the angle value twice, not the register value.
Then what’s the reason?
I’m using Atmel ASF4. The MCU is ATSAMD21. Here is the code snippet.

	/* read register*/
	uint8_t txData1[2];
	uint8_t rxData1[2];
	uint8_t txData2[2];
	uint8_t rxData2[2];
	uint8_t address=0x01;
	txData1[0]=(0x2<<5)|(0x1F&address);
	txData1[1]=0x00;
	txData2[0]=0x00;
	txData2[1]=0x00;
	
           //First frame
	gpio_set_pin_level(CS,false);
	spi_packet.rxbuf=rxData1;
	spi_packet.txbuf=txData1;
	spi_packet.size=2;
	result=spi_m_sync_transfer(&SPI_0,&spi_packet);
	gpio_set_pin_level(CS,true);
	
	delay_ms(2);

            //Second frame
	gpio_set_pin_level(CS,false);
	spi_packet.rxbuf=rxData2;
	spi_packet.txbuf=txData2;
	spi_packet.size=2;
	result=spi_m_sync_transfer(&SPI_0,&spi_packet);
	gpio_set_pin_level(CS,true);

Values in rxData1 and rxData2 are all angle values.

Hi xdpcz,
Your code looks ok for my first look:
MOSI: 0b0100.0001 0b0000.0000

can You ensure that the t_MOSI is sufficiently long that after CS=0?
can You provide a logic analyzer diagram for modes, timing and content?
Did You change the position and maybe program the position into the Z(15:8) = Register 0x01?

If the Command is not detected, the sensor will provide always the angle in the second 16-bit frame.

Best regards,
Marko

I think I’ve confused the model of Magalpha MA730 with MP9960. After I get the datasheet of MP9960, maybe it will be clear.