Other Parts Discussed in Thread: BOOSTXL-DAC-PORT, DAC53608, MSP-EXP432E401Y
I am trying to develop a code in CCS that allows me to control the DAC53608EVM from the XDS110 but I have not had any favorable results.
I have tried to program it using the I2C protocol using the PN4 and PN5 ports corresponding to the I2C2 register of the microcontroller. Unfortunately, observing the signals from these two ports using an oscilloscope, you do not have a coherent response to the I2C protocol, only noise is displayed. As a final result of the code, we want to obtain 1V at the output of channel A of the DAC.
The code that I have modified is the following:
/ * DriverLib Includes * / #include <ti / devices / msp432e4 / driverlib / driverlib.h> / * Standard Includes * / #include <stdint.h> #include <stdbool.h> // // Definition of the I2C bus parameters // #define SLAVE_ADD 0x4A // // Variables for I2C data // uint16_t data = 0x0000; uint16_t data2 = 0x0668; int main (void) { uint32_t ui32SysClock; // // Setup System Clock for 120MHz // ui32SysClock = SysCtlClockFreqSet ((SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_25MHZ | SYSCTL_CFG_VCO_480), 120000000); // // Pause the Clock, Reset it and enable the I2C module in the Master function // SysCtlPeripheralDisable (SYSCTL_PERIPH_I2C2); SysCtlPeripheralReset (SYSCTL_PERIPH_I2C2); // // Enable I2C peripheral // SysCtlPeripheralEnable (SYSCTL_PERIPH_I2C2); SysCtlPeripheralEnable (SYSCTL_PERIPH_GPION); GPIOPinConfigure (GPIO_PN5_I2C2SCL); GPIOPinConfigure (GPIO_PN4_I2C2SDA); GPIOPinTypeI2CSCL (GPIO_PORTN_BASE, GPIO_PIN_5); GPIOPinTypeI2C (GPIO_PORTN_BASE, GPIO_PIN_4); // // Enable Pull-Up Resistors // GPION-> PUR | = (GPIO_PIN_4 | GPIO_PIN_5); // // Wait for the I2C module to be ready // while (! SysCtlPeripheralReady (SYSCTL_PERIPH_GPION)) { } // I2CMasterSlaveAddrSet (I2C2_BASE, SLAVE_ADD, false); is when you want to write and // I2CMasterSlaveAddrSet (I2C2_BASE, SLAVE_ADD, true); is when you want to read from I2C bus // // Initialization of Master and Slave // I2CMasterInitExpClk (I2C2_BASE, ui32SysClock, true); // // Specify the slave address // I2CMasterSlaveAddrSet (I2C2_BASE, SLAVE_ADD, false); while (1) { // register to be read I2CMasterDataPut (I2C2_BASE, 0x01); // send control byte and register address byte to slave device I2CMasterControl (I2C2_BASE, I2C_MASTER_CMD_BURST_SEND_START); // wait for MCU to finish transaction while (I2CMasterBusy (I2C2_BASE)); I2CMasterSlaveAddrSet (I2C2_BASE, SLAVE_ADD, true); // specify data to be written to the above mentioned device_register I2CMasterDataPut (I2C2_BASE, data); // wait while checking for MCU to complete the transaction I2CMasterControl (I2C2_BASE, I2C_MASTER_CMD_BURST_SEND_CONT); // wait for MCU & device to complete transaction while (I2CMasterBusy (I2C2_BASE)); //////////////////////////////////////////////////// ///////////////////////// // register to be read I2CMasterDataPut (I2C2_BASE, 0x08); // send control byte and register address byte to slave device I2CMasterControl (I2C2_BASE, I2C_MASTER_CMD_BURST_SEND_START); // wait for MCU to finish transaction while (I2CMasterBusy (I2C2_BASE)); I2CMasterSlaveAddrSet (I2C2_BASE, SLAVE_ADD, true); // specify data to be written to the above mentioned device_register I2CMasterDataPut (I2C2_BASE, data2); // wait while checking for MCU to complete the transaction I2CMasterControl (I2C2_BASE, I2C_MASTER_CMD_BURST_SEND_CONT); // wait for MCU & device to complete transaction while (I2CMasterBusy (I2C2_BASE)); } }