Home > other >  DSP28335MCBSP configuration problem
DSP28335MCBSP configuration problem

Time:12-04

There are two sets of MCBSP DSP28335, I gave them the same configuration, connection AIC320 audio module, MCBSPA can receive and send data, normal but MCBSPB cannot receive data is excuse me why? Configuration problem is difficult to? Configuration code and the main program is as follows,

Configuration: void InitMcbspa (void)
{

//McBSP - A register Settings

McbspaRegs. SPCR1. All=0;
McbspaRegs. SPCR2. All=0;
McbspaRegs. SPCR1. All=SPCR10_VAL;
McbspaRegs. SPCR2. All=SPCR20_VAL;
McbspaRegs. PCR. All=PCR0_VAL;

McbspaRegs. XCR1. All=XCR10_VAL;
McbspaRegs. XCR2. All=XCR20_VAL;
McbspaRegs. RCR1. All=RCR10_VAL;
McbspaRegs. RCR2. All=RCR20_VAL;

McbspaRegs. DXR1. All=0;

McbspaRegs. MFFINT. Bit. RINT=1;
McbspaRegs. SPCR1. Bit. RRST=1;
McbspaRegs. SPCR2. Bit. XRST=1;



}


# if (DSP28_MCBSPB)
Void InitMcbspb (void)
{

//McBSP - B register Settings

McbspbRegs. SPCR1. All=0;
McbspbRegs. SPCR2. All=0;
McbspbRegs. SPCR1. All=SPCR10_VAL;
McbspbRegs. SPCR2. All=SPCR20_VAL;
McbspbRegs. PCR. All=PCR0_VAL;

McbspbRegs. XCR1. All=XCR10_VAL;
McbspbRegs. XCR2. All=XCR20_VAL;
McbspbRegs. RCR1. All=RCR10_VAL;
McbspbRegs. RCR2. All=RCR20_VAL;

McbspbRegs. DXR1. All=0;

McbspbRegs. MFFINT. Bit. RINT=1;
McbspbRegs. SPCR1. Bit. RRST=1;
McbspbRegs. SPCR2. Bit. XRST=1;
}


# endif//end DSP28_MCBSPB

The main program:

Void main ()
{
Uint16 temp, I;
Int m, n, m1, n1=0;
Int x=0;

InitSysCtrl ();
InitPieCtrl ();
IER=0 x0000;
IFR=0 x0000;
InitPieVectTable ();

LED_Init ();
TIM0_Init (150500, 000);//200 ms
UARTa_Init (4800);

//InitMcbspaGpio ();//zq
InitMcbspbGpio ();//zq
InitI2CGpio ();

I2CA_Init ();

AIC23Write (0 x00 to 0 x00);
Delay(100);
AIC23Write (0 x02, 0 x00);
Delay(100);
X04 AIC23Write (0, 0 x40);
Delay(100);
X06 AIC23Write (0, 0 x40);
Delay(100);
AIC23Write (0 x08, 0 x14);
Delay(100);
X0a AIC23Write (0, 0 x00);
Delay(100);
X0c AIC23Write (0, 0 x00);
Delay(100);
X43 x0e AIC23Write (0, 0);
Delay(100);
AIC23Write (0 x10, 0 x23);
Delay(100);
X12 AIC23Write (0, 0 x01);
Delay(100);//AIC23Init

//InitMcbspa ();//Initalize the Mcbsp -a
InitMcbspb ();//Initalize the Mcbsp - B

//send out alarm
While (1)
{
For (temp=30000; Temp> 0; Temp -
=100){
for(i=0; i<2; I++)
{
Y=50000;
x++;
//m=McbspaRegs DRR1. All;//left sound channel output data
//n=McbspaRegs. DRR2. All;//right sound channel output data
M1=McbspbRegs. DRR1. All;//left sound channel output data
N1.=McbspbRegs DRR2. All;//right sound channel output data
Y=50000;

//McbspaRegs. DXR2. All=n;//left sound channel output data
//McbspaRegs. DXR1. All=m;//right sound channel output data
McbspbRegs. DXR2. All=n1;//left sound channel output data
McbspbRegs. DXR1. All=m1;//right sound channel output data
}
}
}
}
  • Related