breakpoints and interrupts

Started by Roberto Espinosa September 2, 2003
Dear Sir or Madam,
I have got to execute the Brint0 interrupt using a routine written in assembly
code. My code is the following:
void Prueba_Roberto_Mode_2(void)
int i,j,dato,control[5],direccion,mispcr10,mispcr20;
int IFR_value;
/******* Configuraci de los registros de control para Data Mode *******/

asm(" SSBX INTM");

control[0]=0x8100; /*Palabra de control 1: registro B con DMCLK=MCLK;
Serial Clock Divider=DMCLK/8; Decimation/Interpolation Rate=DMCLK/2048*/
control[1]=0x8279; /*Palabra de control 2: registro C con power-un device=On;
ADC and DAC power=On; Ref power=On and Refout=On*/
control[2]=0x8300; /*Palabra de control 3: registro D con ganancias de 0 dB de
entrada y 6 dB de salida*/
control[3]=0x8520; /*Palabra de control 4: registro F indica Single-Ended
control[4]=0x8001; /*Palabra de control 4: registro A indica Data_Mode*/ for (i=0; i<5; i++) /*Escritura de los registros de control*/
while (!MCBSP_xrdy(mhMcbsp));
MCBSP_write16 (mhMcbsp,control[i]);
}; i=2;

*IMR =0x0010;/*b*/
i=2; i=2;
i=2;/*b prueba jorge linares*/

*IFR =0x0010;
i=2;/*b*//*b prueba jorge linares*/
asm(" RSBX INTM");/*b*//*b prueba jorge linares*/
i=2;/*b*//*despu de aqusalta a bxint0*//*b prueba jorge linares*/
i=2;/*b*//*b prueba jorge linares*/
i=2;/*b prueba jorge linares*/

{ }

}/*Fin de Prueba_Roberto_Mode_2*/
And my Isr is:
interrupt void lee_dato_2(void)
/*void lee_dato(void)*/
int i;

As you can see, it only copies the value of DXR10 into DRR10.
I am using an external codec who is converting a 2 KHz sine wave and I want to
read this data with the
codec. This has to convert into digital signal which goes into the Dsp and Dsp
has to output the same value at the DXR10 pin to go to the codec to be converted
into an analog signal.
When I push run button, my program is permanently in the while(1) in spite of
the fact that the register DRR10 is receiving data and Spcr1007 (Rint is
driven by rrdy) so the Brint0 should be executed . When I push halt button, I
observe that the value of DXR10 register is 8100, which is the last value that
the MCBSP_write16 (mhMcbsp,control[i]) instruction has written so the Brint0
has not be executed!!!. Consecuently, I do not observe any signal in the
If a put a breakpoint in the instructions before asm(" RSBX INTM"); my program
stops there. When I push Run my program works properly and it goes to the Isr
and I observe the proper signal in the oscilloscope.

In conclusion, If I execute my program it does not execute any Brint0 interrupt
in spite of the fact the Mcbsp0 port is receiving data. It needs a breakpoint in
any instruction before enabling the maskable interrupts.

What is the reason of this fact?
Roberto Espinosa Hernandez