Hello,
I am working on SPI communication with cc2530 using z-stack home 1.2.1.
I have initialized SPI as shown below-
****************************************************************************************************
#define UART_BAUD_M 59
#define UART_BAUD_E 8
// Set system clock source to HS XOSC, with no pre-scaling.
CLKCONCMD &=~ BV(6);
CLKCONCMD &=~ BV(2)|BV(1)|BV(0);
// Wait until clock source has changed.
while (CLKCONSTA & BV(6));
///////////////////////////////////////////////////////////////////////
// Setup I/O ports
//
// Port and pins used by USART1 operating in SPI-mode, at the Alternative 2
// location are:
// MISO : P1_7
// MOSI : P1_6
// CLK : P1_5
// SS : P1_4
//
// These pins must be set to function as peripheral I/O to be used by UART1.
PERCFG |= BV(1);
// Give priority to USART 1 over Timer 1 for port 0 pins.
P2SEL &=~ BV(5);
P2SEL |= BV(6);
// Set pins 7, 6 and 5 as peripheral I/O and pin 4 as GPIO output.
P1SEL |= BV(7);
P1SEL |= BV(6);
P1SEL |= BV(5);
P1SEL &=~ BV(4); P1DIR |= BV(4);
P1SEL &=~ BV(3); P1DIR |= BV(3);
////////////////////////////////////////////////////////////
// Configure UART
// Initialise bitrate = 115.2 kbps.
U1BAUD = UART_BAUD_M;
U1GCR = 0xFF & UART_BAUD_E;
// Initialise UART protocol (start/stop bit, data bits, parity, etc.):
// USART mode = SPI (U1CSR.MODE = 0)
U1CSR &=~ BV(7);
// SPI MASTER MODE
U1CSR &=~ BV(5);
U1UCR = 0x02;
U1GCR &=~ BV(6);
U1GCR |= BV(7);
U1GCR |= BV(5);
U1CSR = 0x40;
*****************************************************************************************************
But the issue with this is,Clock signal is not generating on P1_5.
what can be the probable issue???
Regards
DC