I am working on getting the TMAG5170-Q1 up and running and am struggling to get readings. At this point I am suspecting that I am not configuring it properly, so wanted to ask if I am doing everything necessary to read from X, Y, and Z below:
I am sending the 32 bits in 4x byte long increments, starting with the address, then 1/2 data, 1/2 data, and ending with command and CRC in one byte. The first thing I am doing is disabling CRC as per the write found in other posts on the forum, and from there I send all 0's for command and CRC.
Two configs I am unsure of are: do I need to be in active running mode? And do I want to configure MAG_CH_EN as 0x7 = X, Y, Z channel enabled, or 0x8 = XYX channel enabled?
For configuring I am doing the following:
writeRegister(0x04, 0x00, 0x04, 0x07); // from TI support - write a 0x0F000407 which disables CRC in the test config address e2e.ti.com/.../937812
writeRegister(0x01, 0b00011001, 0b11101010, 0x00); //0x1 = SENSOR_CONFIG: Configure X,Y, and Z RANGE to be +/-100mT + activate readings on all axes (they default to off)
writeRegister(0x00, 0b00100001, 0b00100000, 0x00); // 0x0 = DEVICE_CONFIG: Set to 4x averaging + ND temp coefficient + set to active measure mode + disable temp stuff
For reading I am doing the following, sending all 0's after the address:
readRegister(0x89,0x00,0x00,0x00); // read X_CH_RESULT
Does anything look amiss here? Thanks in advance!