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.

c5505 interrupt vector table

Other Parts Discussed in Thread: TMS320C5505

 hai i am using tms320c5505 ezdsp and i was unable to work with interrupt and while adding vector.asm i has some 84 errors help me in sort out the problem

  • hi,

    What example are you using? 

    Which vector.asm are you using?

    Regards,

    Hyun

  • hai i am using the adc program

    when i compile the error message is [E9999] 

     

    /*  ============================================================================
    *   Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005, 2008
    *
    *   Use of this software is controlled by the terms and conditions found in the
    *   license agreement under which this software has been supplied.
    *  ============================================================================
    */

    /** @file csl_sar_IntcExample.c
    *
    *  @brief SAR functional layer sample source file
    *
    *  Path: \(CSLPATH)\examples\sar\example3
    */

    /* ============================================================================
    * Revision History
    * ================
    * 20-Sept-2008 Created
    * ============================================================================
    */

    /** @section Overview
        This example file is created to test SAR working in Interrupt mode --
        It registers ISR for SAR. It test the keypad voltage measurement     
    */

    /* Inclusion of header files */
    #include "csl_sar.h"
    #include "csl_intc.h"
    #include "stdio.h"

    /* CSL example test failed */
    #define CSL_TEST_FAILED         (1)
    /* CSL example test passed */
    #define CSL_TEST_PASSED         (0)

    /* Global Structure Declaration*/

    CSL_SarHandleObj SarObj;            /* SAR object structure */
    CSL_SarHandleObj *SarHandle;        /* SAR handle           */
    Uint16           readBuffer;        /* SAR Read Buffer      */
    int i = 0;
    //---------Function prototypes---------//

    /** Interrupt Service Routine */
    interrupt void sarISR(void);

    /* Reference the start of the interrupt vector table */
    /* This symbol is defined in file vectors.asm       */
    extern void VECSTART(void);

    /* To test sar in Interrupt mode */
    int  sar_test_Int_keypad_voltage();


    int main()
    {
        int status;
        status = sar_test_Int_keypad_voltage();
        if(CSL_TEST_PASSED == status)
        {
        printf("sar_test_Int_keypad_voltage is passed\n");
        }
        else
        {
        printf("sar_test_Int_keypad_voltage is failed\n");
        }
        return 0;
    }

    int sar_test_Int_keypad_voltage(void)
    {
        Bool flag = 1;
        int result;
        /* Testing of SAR A/D Keypad Voltage Measurement */
        CSL_Status    status;
        CSL_SarChSetup param;
        int chanNo;
        result = CSL_TEST_FAILED ;
        printf("Testing SAR in Interrupt mode\n");

        //Disable interrupt
        IRQ_globalDisable();
        /* Initialize Interrupt Vector table */
        IRQ_setVecs((Uint32)(&VECSTART));

        /* Initialize the SAR module */
        status = SAR_init();
        if(status != CSL_SOK)
        {
            printf("SAR Init Failed!!\n");
            return (result) ;
        }

        /* Open SAR channel */
        status = SAR_chanOpen(&SarObj,CSL_SAR_CHAN_3);
        SarHandle = &SarObj;
        if(status != CSL_SOK)
        {
            printf("SAR_chanOpen Failed!!\n");
            return result;
        }

        /* Initialize channel */
        status = SAR_chanInit(SarHandle);
        if(status != CSL_SOK)
        {
            printf("SAR_chanInit Failed!!\n");
            return(result);
        }

        /* Clear any pending Interrupt */
        IRQ_clear(SAR_EVENT);
        IRQ_test(SAR_EVENT,&flag);
        /* Register the ISR */
        IRQ_plug(SAR_EVENT,&sarISR);

        param.OpMode =  CSL_SAR_INTERRUPT;
        param.MultiCh = CSL_SAR_NO_DISCHARGE;
        param.RefVoltage = CSL_SAR_REF_VIN;
        param.SysClkDiv = 11 ;
        /* Configuration for SAR module */
        status = SAR_chanSetup(SarHandle,&param);
        if(status != CSL_SOK)
        {
            printf("SAR_chanConfig Failed!!\n");
            return(result);
        }

        /* Set channel cycle set */
        status = SAR_chanCycSet(SarHandle,CSL_SAR_CONTINUOUS_CONVERSION);
        if(status != CSL_SOK)
        {
            printf("SAR_chanCycSet Failed!!\n");
            return(result);
        }
        /* set ADC Measurement parameters */
        status = SAR_A2DMeasParamSet(SarHandle,CSL_KEYPAD_MEAS,&chanNo);
        if(status != CSL_SOK)
        {
            printf("SAR_A2DMeasParamSet Failed!!\n");
            return(result);
        }
        printf("Channel Number selected %d\n",chanNo);

        /* Enabling Interrupt */
        IRQ_enable(SAR_EVENT);
        IRQ_globalEnable();

        /* 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;
        }

        /* Stop the conversion */
        status = SAR_stopConversion(SarHandle);
        if(status != CSL_SOK)
        {
            printf("SAR_stopConversion Failed!!\n");
            return(result);
        }
     IRQ_clear(SAR_EVENT);
        /* Close the channel */
        status = SAR_chanClose(SarHandle);
        if(status != CSL_SOK)
        {
            printf("SAR_chanClose Failed!!\n");
            return(result);
        }
        /* Deinit */
        status = SAR_deInit();
        if(status != CSL_SOK)
        {
            printf("SAR_deInit Failed!!\n");
            return(result);
        }
        result = CSL_TEST_PASSED;
        return(result);

    }


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

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