This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Why there is no interrupt for this simple ezDSP5535 project?

Hi,

I create a simple ezDSP5535 DSP/BIOS project. Because it is very simple, I hope I can get more help in this forum for the initialization etc. issues.

Here is the code. I expect the keys (SW1, SW2) can trigger a gpio interrupt, which post a SWI. Then SWI has a LOG_printf output.

I set a breakpoint inside gpioISR, but nothing occurs.

I have used EZDSP5535_GPIO_init() to initialize GPIO. Are there anything I forget?

Thanks,

6431.ezDSP5535_switch_BIOS.zip

Void swiFxn0(Void);
Void task(Arg id_arg); /* Function for tasks created with Config Tool */
/** Interrupt Service Routine */
//interrupt void sarISR(void);
void sarISR(void);
void gpioISR(void);
extern void EZDSP5535_GPIO_init();

/*
* ======== main ========
*/
Void main()
{/*
Bool flag = 1;
CSL_SarChSetup param;*/

EZDSP5535_GPIO_init();
HWI_enable();
// SWI_post(&SWI0);
LOG_printf(&trace,"Main done!\n");
}

void gpioISR(void)
{
SWI_post(&SWI0);
;
}

void sarISR(void)
{
;
}

/*
* ======== swiFxn0 ========
*/
Void swiFxn0(Void)
{
LOG_printf(&trace,"swiFxn0 posts SWI1\n");
// SWI_post(&SWI1);
LOG_printf(&trace,"SWI0 done!\n");
}

  • Hi,

    Team is working on and we will let you know the update as soon as possible.

    Thanks & regards,

    Sivaraj K

  • Because it seems there are more settings on GPIO than SAR ADC, I temporarily modify SAR INTC CSL example to DSP/BIOS with the following code:

    void sarISR(void)
    {
    SEM_post(&SEM_led0);
    SAR_readData(SarHandle, &readBuffer);
    LOG_printf(&trace,"return ADC %d\n", readBuffer);
    }

    /*

    * ======== task ========
    */
    Void task(Arg id_arg)
    {
    Int id = ArgToInt (id_arg);
    Int i;

    while(1){
    SEM_pend(&SEM_led0, SYS_FOREVER);

    EZDSP5535_LED_toggle(0);

    EZDSP5535_LED_toggle(2);
    }

     

    Although sarISR is interrupted continuously (through breakpoint setting inside ISR), task is not run at all. Considering SAR can only be 64k SPS maximum, it is weird.

    I also see IER0/SAR: 0-DISABLE while IFR0/SAR: 1-ENABLED. This project uses DSP/BIOS 5.42.1.09. The HWI_INT13 for SAR INTC is correct?

    Thanks

  • Hi,

    I write my code on earlier post is from the following csl_sar_IntcExample.c. I think that sarISR(void) generates 40 ADC data. Thus, I can make HWI void sarISR(void) run forever. In my BIOS project, void sarISR(void) will not turn back to task anymore (considering 64 KSPS maximum)? Any SAR expert can explain it to me?


    /* start the conversion */
    status = SAR_startConversion(SarHandle);
    if(status != CSL_SOK)
    {
    printf("SAR_startConversion Failed!!\n");
    return(result);
    }
    /* ISR runs for 40 times */
    while(TRUE)
    {
    if(i == 40)
    break;
    }

    ......

    // ISR to read ADC data
    interrupt void sarISR(void)
    {

    SAR_readData(SarHandle, &readBuffer);
    printf("SAR ADC read data 0x%x\n",readBuffer);
    i++;
    /* For 40 times */
    if(i == 40)
    IRQ_disable(SAR_EVENT);

    }

    Now, I modify my code to:

    void sarISR(void)
    {
    SEM_post(&SEM_led0);
    SAR_readData(SarHandle, &readBuffer);
    status = SAR_stopConversion(SarHandle);
    LOG_printf(&trace,"return ADC %d\n", readBuffer);
    }


    /*
    * ======== task ========
    */
    Void task(Arg id_arg)
    {
    Int i=0;

    while(1){
    SEM_pend(&SEM_led0, SYS_FOREVER);
    LOG_printf(&trace,"task=%d \n", i);
    i++;
    status = SAR_startConversion(SarHandle);
    TSK_sleep(100);
    EZDSP5535_LED_toggle(0);
    EZDSP5535_LED_toggle(2);
    }

    }

    There is acknowledge between ISR and the task. It runs both ISR and task now. The new problem is that there are three samples (from the trace line see). Even I add a TSK_sleep in task, there are the same ADC samples each time task stops at a breakpoint inside task. Why are there three ADC samples? The three different values are for two keys and no key cases. Can you explain it to me?

    Thanks,