AnsweredAssumed Answered

the problem of SPORT Current Channel Register in multichannel for the  send of sport

Question asked by yunchangxiao on May 21, 2013
Latest reply on May 29, 2013 by yunchangxiao

BF518+AD1934,like the next picture:

single_chain.jpg

I configure the sport in multichannel mode(16 channels). I want to send data through detecting the sport current channel register all the time  in sport status interrupt. So I open the interrupt of sport1 status.The frame signal is 48khz,the duty cycle is 50%; the BCLK is 24.576Mhz.

This is the configuration of sport.

void Init_Sport1(void)

{

          *pSPORT1_RCR1 = RFSR | LTFS;

          *pSPORT1_RCR2 = SLEN_32;

          *pSPORT1_TCR1 = TFSR | LTFS;

          *pSPORT1_TCR2 = SLEN_32;

          // Enable MCM 8 transmit & receive channels

          *pSPORT1_MTCS0 = 0x0000FFFF;

          // Set MCM configuration register and enable MCM mode

          *pSPORT1_MCMC1 = 0x1000;

          *pSPORT1_MCMC2 = 0x0010;     ////MFD[3:0] (Multichannel Frame Delay) 0个

}

This is the configuration of interrupt.

void Init_Interrupts(void)

{

          *pSIC_IAR1 = 0xffffff0f;  // open sport1 status

          *pSIC_IAR2 = 0xf3ffffff;   //open DMA8 (UART0 RX)

          register_handler(ik_ivg10, UART0_ISR);       

          register_handler(ik_ivg7, SPORT1_Status_ISR);

          //*pSIC_IMASK0 |=0x00400000 ; // enable UART0 RX interrupt

          //*pSIC_IMASK0 |=0x00000200 ; // enable SPORT1 status interrupt

          *pSIC_IMASK0 |=0x00400200 ;

          ssync();

}

This is function of interrupt of sport status.

EX_INTERRUPT_HANDLER(SPORT1_Status_ISR)

{

          sport1_status_temp=*pSPORT1_STAT;

          //sport1_channel_temp=*pSPORT1_CHNL;

          if(sport1_status_temp & 0x0040)

             {

                          //*pSPORT1_STAT &=0x006f;  //clear TUVF

                          switch(*pSPORT1_CHNL & 0x000f)

                          {

                                      case 0x0000:

                                               *pSPORT1_TX=(*DDRdata_4)<<16;//0

                                               temp_counter[0]++;

                                         break;

                                      case 0x0001:

                                              *pSPORT1_TX=(*(DDRdata_4+1))<<16;  //1

                                        DDRdata_4 = DDRdata_4+2;

                                              if(DDRdata_4>=DDRdata_4_E)

                                {

                                    DDRdata_4 = DDRdata_4_S;

                                }

                             temp_counter[1]++;

                                         break;

                                      case 0x0002:

                                              *pSPORT1_TX=(*DDRdata_5)<<16;  //2

                                              temp_counter[2]++;

                                         break;

                                      case 0x0003:

                                              *pSPORT1_TX=(*(DDRdata_5+1))<<16;  //3

                                              DDRdata_5 = DDRdata_5+2;

                                              if(DDRdata_5>=DDRdata_5_E)

                               {

                                       DDRdata_5 = DDRdata_5_S;

                               }

                            temp_counter[3]++;

                                         break;

                                      case 0x0004:

                                              *pSPORT1_TX=(*DDRdata_1)<<16; //4

                                              temp_counter[4]++;

                                         break;

                                      case 0x0005:

                                              *pSPORT1_TX=(*(DDRdata_1+1))<<16; //5

                                              temp_counter[5]++;

                                         break;

                                      case 0x0006:

                                              *pSPORT1_TX=(*DDRdata_2)<<16; //6

                                              temp_counter[6]++;

                                         break;

                                      case 0x0007:

                                              *pSPORT1_TX=(*(DDRdata_2+1))<<16; //7

                                              temp_counter[7]++;

                                         break;

                                      case 0x0008:

                                              *pSPORT1_TX=(*DDRdata_1)<<16;  //8

                                              temp_counter[8]++;

                                         break;

                                      case 0x0009:

                                              *pSPORT1_TX=(*(DDRdata_1+1))<<16; //9

                                              DDRdata_1 = DDRdata_1+2;

                                              if(DDRdata_1>=DDRdata_1_E)

                                              {

                                                          DDRdata_1 = DDRdata_1_S;

                                              }

                                              temp_counter[9]++;

                                         break;

                                      case 0x000a:

                                              *pSPORT1_TX=(*DDRdata_2)<<16;  //10

                                              temp_counter[10]++;

                                         break;

                                      case 0x000b:

                                              *pSPORT1_TX=(*(DDRdata_2+1))<<16;  //11

                                              DDRdata_2 = DDRdata_2+2;

                                              if(DDRdata_2>=DDRdata_2_E)

                               {

                                       DDRdata_2 = DDRdata_2_S;

                               }

                            temp_counter[11]++;

                                         break;

                                      case 0x000c:

                                              *pSPORT1_TX=(*DDRdata_3)<<16; //12

                                              temp_counter[12]++;

                                         break;

                                      case 0x000d:

                                              *pSPORT1_TX=(*(DDRdata_3+1))<<16; //13

                                              DDRdata_3 = DDRdata_3+2;

                                              if(DDRdata_3>=DDRdata_3_E)

                               {

                                        DDRdata_3 = DDRdata_3_S;

                               }

                            temp_counter[13]++;

                                         break;

                                      case 0x000e:

                                              *pSPORT1_TX=(*DDRdata_1)<<16; //14

                                              temp_counter[14]++;

                                         break;

                                      case 0x000f:

                                              *pSPORT1_TX=(*(DDRdata_1+1))<<16; //15

                                              //DDRdata_1 = DDRdata_1+2;

                                              //if(DDRdata_1>=DDRdata_1_E)

                               {

                                    //    DDRdata_1 = DDRdata_1_S;

                               }

                            temp_counter[15]++;

                                         break;

                                      default:

                                         break;

                          }

             }

}

In function of switch that there is counter about number of times of access the channel.This is temp_counter.But when access this interrupt, the times of accessing channel0 and channel15 have problem.This is the picture about this problem.

temp—counter.jpg

I don't kown why the channel0 is only two,the channel15 is 0x005a4fc3 (2d27e2 * 2~~5a4fc3)?

Outcomes