Other Parts Discussed in Thread: LDC1312,
Hello everyone in MSP430 land,
I have a project on a custom board. I’m using an MSP430FR5994 with an LDC1312 (inductance to digital converter) on an I2C bus (actually there are four LDCs, each on its own I2C interface). It is the only device on the bus. The MSP430 is the Master.
In the past, I have successfully “bare metal’d” such code, but this time I decided to use the MSP430 Driverlub. I believe I’m now accessing the LDC registers to configure the device (Write to registers, but having a considerable amount of trouble reading the registers. When reading the registers, the Driverlib returns 0. However, accessing the registers from CCS, UCBxRXBUF (x= 0, for this interface), there’s other than 0 in the memory-mapped register. I scope’d the I2C bus and it looks like data is coming across the interface that matches the MSP430 Receive Buffer; however, as stated the Driverlib only returns 0.
This read interface to the LDC requires a “I2C Restart.” Not sure if I’m doing it correctly using the Driverlib. (The setMode statements don’t seem to make any differences
The I2C interface of the MSP430 is initialized elsewhere as well as configuring the LDC Registers.
I’ve tried many different code attempts, including reading the register directly after the Driverlib receive request with no difference. Out of options. What do you think?
The LDC is at I2C address 0x2A. The Data Read is 0.
BaseAddress = 0x0640 (I2C Interface b0), LDC1312Register = 0
Simple code:
uint8_t RxMSB, RxLSB;
EUSCI_B_I2C_setMode (BASEADDRESS_I2C2, EUSCI_B_I2C_TRANSMIT_MODE);
EUSCI_B_I2C_masterSendMultiByteStart (BaseAddresss,LDC1312Register); // sends Slave Address on I2C Bus provided by "setSlaveAddress()"
EUSCI_B_I2C_masterSendMultiByteFinish (BaseAddresss, LDC1312Register);
EUSCI_B_I2C_setMode (BASEADDRESS_I2C2, EUSCI_B_I2C_RECEIVE_MODE);
EUSCI_B_I2C_masterReceiveStart(BaseAddresss); // sends Slave Address on I2C Bus
RxMSB = EUSCI_B_I2C_masterReceiveMultiByteNext(BaseAddresss);
RxLSB = EUSCI_B_I2C_masterReceiveMultiByteFinish (BaseAddresss);
I’ve tried a couple different ways to read the Receive Buffer, but it is always 0.
I am including scope screenshot.