Author Topic: CC2500 for sending data gives trouble  (Read 2952 times)

0 Members and 1 Guest are viewing this topic.

Offline CC2500troubleTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
CC2500 for sending data gives trouble
« on: November 06, 2009, 12:38:13 AM »
Hello,

I am using Altera FPGA and am using their standard SPI communication method to communicate with the CC2500.

I load this routine in a loop to ensure I have all properly running: calibrate synthesizer, send five packets of data. I hoped to run through 0xFFFF loops, but more often than not, it fails somewhere in the middle.

Any thoughts?

  for (u8RX=0; u8RX<0xFFFF; u8RX++) {
    IOWR(LED_BASE,0,u8RX&0x00FF);
    //RF2500 Calibration
    //SIDLE, Exit RX/TX, turn off frequency synthesizer
    u8S[0]=0x36;                  alt_avalon_spi_command(SPI_BASE,SSl,0x01,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3D;              do {alt_avalon_spi_command(SPI_BASE,SSl,0x01,&u8S[0],0x01,&u8R[0],SFl);} while (!((u8R[0]&0xF0)==0x00));
    //SRX, Enable RX, Perform Calibration since FS_AUTOCAL=
    u8S[0]=0x34;                  alt_avalon_spi_command(SPI_BASE,SSl,0x01,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3D;              do {alt_avalon_spi_command(SPI_BASE,SSl,0x01,&u8S[0],0x01,&u8R[0],SFl);} while (!((u8R[0]&0xF0)==0x10));
    IOWR(TIMERR_BASE,0x0,0x0000); //CLEAR timer R
    IOWR(TIMERR_BASE,0x1,0x0004); //START timer R
    while (!(IORD(TIMERR_BASE,0) & 0x1)); //STAY while !TimeOut true; time delay for RF Calibration
    //End of RF2500 Calibration
   
    u8S[0]=0x3F; u8S[1]=0x05;     alt_avalon_spi_command(SPI_BASE,SSl,0x02,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3F; u8S[1]=BSta;     alt_avalon_spi_command(SPI_BASE,SSl,0x02,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3F; u8S[1]=UReC;     alt_avalon_spi_command(SPI_BASE,SSl,0x02,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3F; u8S[1]=Mac4;     alt_avalon_spi_command(SPI_BASE,SSl,0x02,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3F; u8S[1]=Mac5;     alt_avalon_spi_command(SPI_BASE,SSl,0x02,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3F; u8S[1]=Mac6;     alt_avalon_spi_command(SPI_BASE,SSl,0x02,&u8S[0],0x01,&u8R[0],SFl);
    //STX, start transmission (will go RX when done TX)
    u8S[0]=0x35;                  alt_avalon_spi_command(SPI_BASE,SSl,0x01,&u8S[0],0x01,&u8R[0],SFl);
    u8S[0]=0x3D;              do {alt_avalon_spi_command(SPI_BASE,SSl,0x01,&u8S[0],0x01,&u8R[0],SFl);} while (!((u8R[0]&0xF0)==0x10));
    IOWR(TIMERS_BASE,0x0,0x0000); //CLEAR timer S
    IOWR(TIMERS_BASE,0x1,0x0004); //START timer S
    while (!(IORD(TIMERS_BASE,0) & 0x1)); //STAY while !TimeOut true; delay for RXTX conversion
    iGDO0--; iGDO0--; //Reset from SyncWord and End of Packet notifications
  }

 


Get Your Ad Here