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.

CC2540 SPI config and write

Other Parts Discussed in Thread: CC2540, CC2541

Hi All,

We are using CC2540 custom board, in that the DIsplay is connected to spi interface .

Here will be pin details.

p1.6 - SCLK

p1.7- Mosi

p1.5 -CS

p1.4- DC

The display dont have MISO line.

Now i did configuration with bit banking method. with that display is not working.

Now i need to test register configuration method, can you tell how to do spi init and spi write in register mode.

For register mode i did following steps , but it dont work.

void lcd_init()
{
  PERCFG |= 0x01;
 
  P1SEL &= ~BIT2;
  P1SEL &= ~BIT3;
  P1SEL &= ~BIT4;
  P1SEL &= ~BIT5;
  P1SEL &= ~BIT6;
  P1SEL &= ~BIT7;
 // P1SEL &= ~BIT0;
  
  P1DIR &= ~BIT2;
  P1DIR |= BIT3;
  P1DIR |= BIT4;
  P1DIR |= BIT5;
  P1DIR |= BIT6;
  P1DIR |= BIT7;
 // P1DIR |= BIT0;
  U1CSR &= ~(U0CSR_MODE | U0CSR_SLAVE);
  U1BAUD = SPI_BAUD_M;
   U1GCR = (U1GCR & ~(U0GCR_BAUD_E | U0GCR_CPOL | U0GCR_CPHA | U0GCR_ORDER))
       | SPI_BAUD_E;
  //U1GCR = 0x20;
   // U1GCR |= 0x0D;
    //U1BAUD = 0xEC;
  //U0GCR = 0x20;
//U0GCR |= 0x0D;
//U0BAUD = 0xEC;
}
TO write Data
void spi_write(uint8_t TEMPCOM)
{
 U1CSR &= ~0x02;                 // Clear TX_BYTE
        U1DBUF = TEMPCOM;
        while (!(U1CSR & 0x02));     
}

Kindly suggest me the answer.

Regards
Punith