Hello,
I am interfacing the 1298 with the FG4618. I am working with the ADS1298 PDK and the MSP430FG4618 Experimenter's Board.
I have removed the MMB0 from the 1298 PDK and providing 5v and 3.3v from a power supply. The START, RESET and DRDY pins are controlled by the FG4618. The spi link happens though the USCIA0 module.
I have been able to write the 1298 after the start up sequence, send the SDATAC opcode. and control the GPIO1 of the 1298.
Now I am trying to read the control registers in order to understand the read operation.
After the reset and SDATAC opcode, this is what I do:
while (1)
{
while (!(IFG2 & UCA0TXIFG));
UCA0TXBUF = 0x20; // READ OPCODE (0x20) STARTING FROM ID register (0x0)
while (!(IFG2 & UCA0TXIFG));
UCA0TXBUF = 0x00; // READ 1 REGISTER
}
So first I send the read opcodes1/2 and then this repeats providing a clk to receive the data sent by the 1298.
I have the following questions:
The UC0RXIFG is set every time I write on the TX buffer, does this mean that the "received data" is 0x00 although no data is expected to be received? If this is the case, how to differentiate between no data received and 0x00?
Since receiving data on the USCIA module in master mode requires data to be written to the transmit buffer (such that there is a clock and RX/TX happen concurrently) I am able to read only after sending the read opcode asking to start on address 0x00 (ads1298 ID) and the number of registers (1) again. I end up receiving:
0x00 (when I write OPCODE1, as expected)
0x00 (when I write OPCODE2, as expected)
0x92 (ADS1298 ID, what I requested) when I write OPCODE1 for second time)
0x06 (config1?, when I write OPCODE2 for second time)), Why do I receive more than I byte?
I have seen a threat discussing this, http://e2e.ti.com/support/data_converters/precision_data_converters/f/73/t/65949.aspx but still can't understand properly why it sends 2 bytes instead of one, could you elaborate on this?
Finally, the proper way to read N number of registers is then put data on the TX buffer N times after sending the read OPCODES1 and 2? What data should I put on the buffer to make sure it won't affect the operation of the ADS1298?
I hope I was able to express my questions properly, if not please let me know. Also if you need scope screen shots or the whole code please let me know.
Best regards,
Efrain