Other Parts Discussed in Thread: CC2500
Hi everyone,
I searched a lot, but did not find the thread related to my case. I am designing a system to transmit the data in sd card using rf block. Unfortunately, sd card must share the buses with CC2500. My program is that read a sctor data from sd card, turn to rf to transmit, then go back to sd card. So the swtich between sd card and rf block is frequently. When turn to the new block, no matter sd to rf or rf to sd, before doing anything, the circuit should be initialized first. The problem i meet is that initialization of network(SMPL_Init) is fail when i switch from sd block.
Following is the code intialize sd card, which is successful.
{
unsigned char status = 1;
unsigned
BCSCTL1 = CALBC1_8MHZ;
DCOCTL = CALDCO_8MHZ;
BCSCTL3 |= LFXT1S_2;
TACCTL0 = CCIE; TACCR0 = 12000;
TACTL = TASSEL_1 + MC_1;
while (status != 0)
{
status = mmcInit(); timeout++;
if (timeout == 51) break;
}
After read data from SD card, I initalize MSP430 and try to execute SMPL_Init(). It stucked at SPI initial fail. Here is the code initial MSP430.
if ( Flash_Addr[0] == 0xFF && Flash_Addr[1] == 0xFF && Flash_Addr[2] == 0xFF && Flash_Addr[3] == 0xFF )
{
createRandomAddress();
// set Random device address at initial startup
} lAddr.addr[0]=Flash_Addr[0]; lAddr.addr[1]=Flash_Addr[1]; lAddr.addr[2]=Flash_Addr[2]; lAddr.addr[3]=Flash_Addr[3]; SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, &lAddr); BCSCTL1 = CALBC1_8MHZ;
DCOCTL = CALDCO_8MHZ; BCSCTL3 |= LFXT1S_2;
TACCTL0 = CCIE;
TACCR0 = 12000;
TACTL = TASSEL_1 + MC_1;
Why i get SPI initialization fail? Pls help me. Thanks!
Sun Li
//Initialisation of the MMC/SD-card