Other Parts Discussed in Thread: TMS320C5515
I am trying to use the codec on the USBstick to develop DSP code for a test instrumentation product. I must write my own hardware drivers for the C5515 because of how the product will work. I have been able to figure out all the problems myself until I tried to make an interrupt happen when new ADC data is ready. While my logic analyzer shows that the I2S Frame Sync and I2S Bit Clock are present, and are sourced by the codec, I don't get interrupts. As you can see, interrupts should only toggle the DSP external flag for now, but that does not happen, so no interrupts are happening. I have attached my main.c and StkVectors.asm, but not my StkHardware.c (init and drivers) or StkLink.cmd for now; I can provide them later if that helps. Everything compiles together OK.
/********
* main.c
********/
#include "StkHardware.h"
long AdcLData, AdcRData, DacLData, DacRData;
void main(void)
{
PowerUpInit();
EnableInts();
while (1);
return;
} /********** End main ******************/
interrupt void I2SDacIsr(void)
{ /* Interrupt Service Routine for I2S0 DACs is Priority 7 */
/* Interrupt Service Routine for I2S2 DACs is Priority 21 */
/* NOTE: no parameters may be passed into or returned from an
* interrupt service routine. Use Global variables */
volatile unsigned delay;
asm(" bit(ST1, #13) = #1"); /* Set External Flag, XF pin high, LED on */
/* This loop should delay ( 7 + ( 7 * 6)) / 98304000 = 0.0000005 seconds */
for ( delay = 6 ; delay > 0 ; delay-- ){}; /* wait 0.5 microseconds */
asm(" bit(ST1, #13) = #0"); /* Clear External Flag, XF pin low, LED off */
return;
} /********** END I2S0DacIsr() **********************************************/
interrupt void I2SAdcIsr(void)
{ /* Interrupt Service Routine for I2S2 ADCs is Priority 10 */
/* Interrupt Service Routine for I2S0 ADCs is Priority 22 */
/* NOTE: no parameters may be passed into or returned from an
* interrupt service routine. Use Global variables */
volatile unsigned delay;
asm(" bit(ST1, #13) = #1"); /* Set External Flag, XF pin high, LED on */
/* This loop should delay ( 7 + ( 7 * 28)) / 98304000 = 0.0000021 seconds */
for ( delay = 28 ; delay > 0 ; delay-- ){}; /* wait 2.1 microseconds */
asm(" bit(ST1, #13) = #0"); /* Clear External Flag, XF pin low, LED off */
return;
} /********** END I2S0AdcIsr() **********/
