I'm starting to play around with talking to a nRF8001 with MSP430. First thing that I wanted to do is get the SPI up and running so I checked out the G2553 demo code on mspware. Here's the SPI initi code:
P1SEL |= BIT4 + BIT5 + BIT6 + BIT7; P1SEL2 |= BIT4 + BIT5 + BIT6 + BIT7; UCB0CTL0 |= UCCKPL + UCMSB + UCMST + UCSYNC; // 3-pin, 8-bit SPI master UCB0CTL1 |= UCSSEL_2; // SMCLK UCB0STAT = 0; UCB0BR0 |= 0x08; // /2 UCB0BR1 = 0; // UCB0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** IE2 |= UCB0RXIE; // Enable USCI0 RX interrupt
This is what I don't understand, without shorting MISO to MOSI in hardware, the data is looping back.
I would have expected to have UCB0STAT = UCLISTEN
I tried to tie MISO to ground in case there was some coupling through the port, still looping back.
What am I missing?
Also if anyone has a good SPI library or has done any work with nRF8001, would love to hear about it. I tried energia briefly, cool but I'm not sure if it is the right tool for this job.