I am trying to take readings from the Melexis Tri-axis Hall effect sensor MLX90393, but all I seem to get is garbage.
I am reading the sensor over SPI, with a 1MHz clock. Here is an example of a couple of SPI transactions with the device, just to show that the waveform is nice. I have shown the two transactions closer together than they really are, just to fit them on the image. In reality they are 3ms apart.
Here is a description of the full set of transactions:
- Reset. Send F000 (then wait 3ms)
- Write Mem adr 00 with 000C (wait 100us)
- Write Mem adr 01 with C380 (wait 100us)
- Write Mem adr 02 with 0068 (wait 100us)
- Start single measurement read: Send 3E (wait 1ms)
- Read Measurement: Send 4E, receive FF75 8FEF FFFB (wait 100ms)
Then I loop 5. and 6. over and over.
The values I get back seem to make no sense. They certainly don't look like a slightly noise analog signal, which is what I would expect. For example, multiple reads from channel 0 look like: FFFB 0707 0707 8FEF 0707 F3AF FF75
What am I doing wrong?