My AD2S1210 device will be configured in Configuration mode and I want to understand how to write and read to the internal registers. I am confused as how to go about this. If I were to write to a specified address through SPI how should I go? Say I were to write to the LOS Threshold register, and later read it. What would be the process ?
I hope the following example will clarify the configuration process for you using the SPI interface. Using your example suggestion, assume we are writing to the LOS Threshold register (0x88H) some data (NEW_DATA) and we want to read it back after writing to the register. Then as illustrated in the figure we would execute the following sequence.
1) Address the LOS Threshold register by writing 0x88H to the serial bus.
2) In the next frame send the data, NEW_DATA, we want to write to 0x88H, the LOS Threshold register. Note that on SDO we'll receive the current value programmed into the LOS threshold register as we addressed the register in the previous frame.
3) In the third frame we need to address the LOS Threshold register again. This time on SDO we'll receive the data we expect BUT we need to realize this is just a copy of the data that the part just received and NOT the contents of the memory. This can be useful as validation that we sent the correct data however.
4) Finally, in the fourth and final frame we need to address any register; it can be the LOS register or another register save for the SOFT RESET. This operation must be a register address operation otherwise we'll overwrite the content of the LOS Threshold register which we DO NOT want to do. In the same frame we read back the updated content from the LOS Threshold register that we updated in the second frame.
Hope that helps
If I wish to only write to the register, instead of sending again the same address, can I just send another address and keep writing to the next one?
Let me see if I can answer your question clearly.
1) If you wish to verify the result immediately after the write then you must send the desired register address in step 3 to validate the contents of the register in slot 4. However in slot 4 you can then program the next address to be written.
2) If alternatively you wish to write the entire memory contents at once then you could (as I think you're proposing) simply write the whole configuration by writing Address and Data pairs and then do a read sequence at the end that simply sequentially transmitted ADDRESS packets and read back the data during the next serial frame ending say with the FAULT Register (probably addressed twice, once to load the data and once to read out the data.
so for example if I want to write the threshold registers (0x88-0x8EH) the excitation register (0x91) and the control register (0x92) and then read back the contents my pattern might look like
[0x88h, data, 0x89h, data, 0x8Ah, data, 0x8bh, data, 0x8C, data, 0x8D, data, 0x8E, data, 0x91, data, 0x92, data];
then follow with READ with the data from RXBUF processed by the controller starting with the second entry
[0x88h, 0x89h, 0x8Ah, 0x8Bh, 0x8Ch, 0x8Dh, 0x8Eh, 0x91h, 0x92h, 0xFF, 0xFF]
Note that the repeated fault address allows us to access the FAULT data on the second transmission.
I hope that makes sense.
Yes, that's exactly what I needed. One last thing in order to execute a Software Reset, should I write to 0xF0 once or twice in order like in the examples above. So, the device register the reset?
You'll want to only write the register once (0xF0) and I would recommend that you could insert the sequence between the sequential addresses to the Fault Register.