Hey all,
I am just new to both freescale DSPs and these forums. I have a good background with microcontroller programming, and I have just purchased the soundbite dev board and am using Symphony Studio.
My first quesion is with regards to interrupts. I have noticed that in the "Eight-channel-C-template" sample code (
avaliable here) the author has done a manual push and pop in the interrupt routines for the ESAI. I am confused as in my experience the compiler should instert the required code to push and pop the necessary registers for the ISRs. Although this is not a problem by itself, when I use a variable inside the ISR, my application stops working! For example, I am simply passing audio through the board at the moment, and one line in the ISR is as follows:
data.inBuffR[0] = *(YREG M_RX1_1);
Of course, data.inBuffR is my buffer array, and *(YREG M_RX1_1) is reading the RX1_1 register. However, if I change this to the following:
index = 0;
data.inBuffR[index] = *(YREG M_RX1_1);
where index is a global variable, my application stops working! index is set to zero so it should not change anything. I do not know the problem, but another problem I found is this...
In the same ISR, using code I know works, if i put "int i;" at the start before the registered are pushed, it also stops my application from working! I DO know why. It is because this line generates an extra push at the start of the routine, however because I seem to have to do a manual "RTI" at the end, the final pop is not executed! The compiler only does a "RTS" at the end instead of a "RTI"! WHY DOES THE COMPILER NOT GENERATE THE CORRECT CODE?
Now, it is clear to me that the author of the sample code, who must be a freescale technician KNOWS about this problem, which is why the manual "RTI' was inserted. However, why are these problems not fixed?
Yes, I am new to this compiler, so if there are solutions to these problems, or reason why it is happening that I do not know about, I would LOVE sometone to explain.
Cheers,
Carl