Part Number: MSP-EXP432P4111
Other Parts Discussed in Thread: DAC161S997
Hello,
I have a spi configuration code which is written for a msp430 and DAC161S997. But i am trying to use it on my msp-exp432p4111. I think the problem is UCB0BR0 register. The register that i found(BRW) has different use.
msp430 code
UCB0CTL1 |= UCSWRST; // Enable SW reset UCB0CTL0 |= (UCMST + UCMSB + UCSYNC + UCCKPH); // SPI Master, 3 wire, synchronous mode UCB0CTL1 |= UCSSEL_2; //SMCLK UCB0BR0 = 8; // SMCLK/8 = SCLK (1MHz) UCB0BR1 = 0; UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
the code i have made
EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_SWRST; // Enable SW reset
EUSCI_B0->CTLW0 |= (EUSCI_B_CTLW0_MST + EUSCI_B_CTLW0_MSB + EUSCI_B_CTLW0_SYNC + EUSCI_B_CTLW0_CKPH + EUSCI_B_CTLW0_UCSSEL_2); // SPI Master, 3 wire, synchronous mode
EUSCI_B_CMSIS(EUSCI_B0_BASE)->BRW = 48000000 / 1000000;
EUSCI_B0->CTLW0 &= ~EUSCI_B_CTLW0_SWRST; // Clear SW reset, resume operation
