I have a question about using the M90E32AS and its SPI registers. I believe I am having some timing issues but I can't determine at which point they occur.
I'm using a SAM3X chip and have set the SPI speed to 1MHz. I've tried to follow along the wait times according to the datasheet on page 76.
Basically, I start out by calibrating the registers and setting the offset/gain registers etc.
When I step through the code in debugging mode, I do not experience any problems, the registers set and I can keep stepping through the code and get very accurate current, voltage and power readings.
However, when I run the code at full speed, the CfgRegAccEn does not take the initial value to allow offset/gain writes to the chip (it remains at 0xFFFF instead of changing 0x55AA). I am still getting Urms and Irms values that correspond with the default gain, but obviously, without the offset and calibration they are not correct.
These timings are recommended in the datasheet so I have:
Wait 8 us
I think the reads are working just fine but nothing gets written to the registers (and I confirm this by checking the value immediately after). Am I misinterpreting the datasheet? What are the timing requirements for this chip other than what I've seen in the datasheet?