Sedat-G
Newbie level 6
- Joined
- Aug 5, 2010
- Messages
- 11
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,283
- Location
- East Lansing MI
- Activity points
- 1,371
Hi Everyone,
I am trying to integrate TRF7960 to ez430RF2500. I know CC2500 on the board is using USCI_B0(SPI). So, by driving STE pin to high, I disabled C2500 from SPI communication. I assigned Port2.0 as SS pin to select TRF7960 for SPI communication. So far there is no problem, when I try to sent consecutive commands to TRF, my software gets stuck. Can someone show me where my mistake is?
Part of my code that is related to the SPI comm:
DCOCTL=CALDCO_12MHZ;
BCSCTL1=CALBC1_12MHZ; //Clock is set for 3MHZ operation.
BCSCTL2=DIVM_2 + DIVS_2;
UCB0CTL0 = UCMSB + UCMST + UCMODE_2 + UCSYNC; //Most Significant Bit, Master Mode and 4-PIN SPI (STE active low) is set.
UCB0CTL1 = UCSSEL_2 + UCSWRST; //SMCLK is set.
CSHI; //Turn OFF CC2500 to SPI. --> POUT &= ~0x01
UCB0CTL1 &= ~UCSWRST; //Initialize SPI Communication.
SlaveSelectLOW; //Turn ON TRF7960 to SPI. --->P2OUT &= ~0x01
//RESET...
while(!(IFG2&UCB0TXIFG)); //TXBUF ready??
UCB0TXBUF = RESET;
DELAY();
IFG2 &= ~UCB0TXIFG;
//Reading IRQ status...
while(!(IFG2&UCB0TXIFG)); //TXBUF Ready?? <----THIS is WHERE IT STOPS.
UCB0TXBUF = READ_IRQ;
DELAY();
UCB0CTL0 &= ~UCCKPH; //Switch Clock Polarity.
UCB0TXBUF = 0x00; //Dummy write to start Receive
while(!(IFG2&UCB0RXIFG));
DELAY();
WRT2MEM(UCB0RXBUF); //Write to Info MEM.
I am trying to integrate TRF7960 to ez430RF2500. I know CC2500 on the board is using USCI_B0(SPI). So, by driving STE pin to high, I disabled C2500 from SPI communication. I assigned Port2.0 as SS pin to select TRF7960 for SPI communication. So far there is no problem, when I try to sent consecutive commands to TRF, my software gets stuck. Can someone show me where my mistake is?
Part of my code that is related to the SPI comm:
DCOCTL=CALDCO_12MHZ;
BCSCTL1=CALBC1_12MHZ; //Clock is set for 3MHZ operation.
BCSCTL2=DIVM_2 + DIVS_2;
UCB0CTL0 = UCMSB + UCMST + UCMODE_2 + UCSYNC; //Most Significant Bit, Master Mode and 4-PIN SPI (STE active low) is set.
UCB0CTL1 = UCSSEL_2 + UCSWRST; //SMCLK is set.
CSHI; //Turn OFF CC2500 to SPI. --> POUT &= ~0x01
UCB0CTL1 &= ~UCSWRST; //Initialize SPI Communication.
SlaveSelectLOW; //Turn ON TRF7960 to SPI. --->P2OUT &= ~0x01
//RESET...
while(!(IFG2&UCB0TXIFG)); //TXBUF ready??
UCB0TXBUF = RESET;
DELAY();
IFG2 &= ~UCB0TXIFG;
//Reading IRQ status...
while(!(IFG2&UCB0TXIFG)); //TXBUF Ready?? <----THIS is WHERE IT STOPS.
UCB0TXBUF = READ_IRQ;
DELAY();
UCB0CTL0 &= ~UCCKPH; //Switch Clock Polarity.
UCB0TXBUF = 0x00; //Dummy write to start Receive
while(!(IFG2&UCB0RXIFG));
DELAY();
WRT2MEM(UCB0RXBUF); //Write to Info MEM.
Last edited: