This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello All;
I'm trying to communicate via SPI with DAC7750. I'm using MSP-TS430PZ100E target board.
I tried to set the register like this;
UCB0CTLW0 |=UCSWRST;
UCB0CTL1 |= UCSWRST; // Enable SW reset
UCB0CTL0 |= (UCMST+UCMSB+UCSYNC+ UCCKPH); // SPI Master, 3 wire, synchronous mode
UCB0CTL1 |= UCSSEL_2; /* SMCLK */
UCB0BR0 = 8;
UCB0BR1 = 0;
UCB0CTL1 &= ~UCSWRST;
But the register won't get set. What am I doing wrong? As can see below, that register doesn't change but the UCB0BR register does get changed.
I'm using UCA2 for RS-485 communication and it's working well. It's registers get set without problem.
Is UCB0 a special thing?
Please help me!!!!
Sukho
I see two problems.
First, you are ORing bits into the register so other than the reset bit, nothing gets cleared. Second, you are mixing word and byte accesses of the same control register. While there are symbols defined for the various bits to be used when doing so, you aren't using them. So when you try to set UCMST which is 0x0800, it vanishes due to the byte access.
Try using all word accesses to UCB0CTLW0 and put it into reset by starting out with "UCB0CTLW0 =UCSWRST".
**Attention** This is a public forum