Hi,
I am using MSP430F2419 and OMAP3525 in my design. I was trying to communicate with MSP430 thro' SPI interface, configuring OMAP as master. Iam operating at very low speed (11.7KHz approx), and i have enabled Phase, Clock Polarity, MSB first, 8-bit & Chip select as high to low transition. In-between the signal lines i am using an 1.8V to 3.3V level translator. But iam always receiving data incorrectly value in MSP430 with 2 or 3 bit shift in the result value. only few time it is showing data correctly. i have found there is no problem with the level translator.can any one help e to solve this...
void main(void)
{
volatile unsigned int i;
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
if (CALBC1_16MHZ ==0xFF || CALDCO_16MHZ == 0xFF)
{
while(1); // If calibration constants erased
// do not load, trap CPU!!
}
BCSCTL1 = CALBC1_16MHZ; // Set DCO to 1MHz
DCOCTL = CALDCO_16MHZ;
//while(!(P3IN&0x08)); // If clock sig from mstr stays low,
//----------------------------------------------------------------------------//
UCB0CTL1 = UCSWRST; // **Put state machine in reset**
UCB0CTL0 |= (UCSYNC+UCMSB+UCCKPL+UCCKPH+UCMODE_2);
P3DIR |= 0x04; // it is not yet in SPI mode
P3SEL |= 0x0F; // P3.3,2,1 option select
UCB0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
//----------------------------------------------------------------------------//
IE2 |= (UCB0RXIE+UCB0TXIE); // Enable USCI_B0 TX,RX interrupt
_BIS_SR(GIE);
while(1);
}
// Echo character
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCIB0RX_ISR (void)
{
cRxBuff[cRxBuffIndex++] = UCB0RXBUF;
cRxBuffIndex %= RXBUFFLEN;
}
#pragma vector=USCIAB0TX_VECTOR
__interrupt void usciab0tx_isr(void)
{
if ((IFG2 & UCB0TXIFG)) // USCI_B0 TX buffer ready?
UCB0TXBUF = 0xF0;
}