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.

SYS/BIOS progression...and questions

All:

I am using SYS/BIOS on the F28335. So far, I have been able to use the Experimenter's Kit to go through the following steps:

1. Add peripheral header files to Idle time function, to be able to use GPIO to blink and LED from the idle time function.

2. Move on to adding an SWI function, so now I have 2 blinking LEDs, one from an SWI and a second from the idle time function.

3. Add peripheral clock initialization and flash initialization - I am now able to generate a PWM waveform while blinking 2 LEDs.

I am now trying to add HWI support, and I am having some problems, particularly with the use of the Peripheral Interrupt Expansion of the F28335:

  I have tried to migrate the PWM interrupt example from the F28335 example code into the above environment, but so far no interrupts...

  Do I use "Add the portable Hwi management module to my configuration? (I think the answer is No.)

 Under "Device-specific Hwi Support" I have tried to add an interrupt service routine for epwm1_isr( ) by clicking on the Add... and filling in these values for the required settings:  Handle = PWM1 (Is this correct?)

                 ISR function = epwm1_isr

                 Interrupt number = 48

However, once I have done this and loaded the error-free compile, I do not stop at a breakpoint at the epwm1_isr function. Any help?

  • Todd,

    I don't have specific advice on your questions but perhaps this app note on the wiki would give you the general approach to using interrupts on C28x with SYS/BIOS:

    http://processors.wiki.ti.com/index.php/SYS/BIOS_and_controlSUITE_ADC_Example

    Mark

  • Thanks, Mark - I will look into that example.

     

  • Is there a reason why the ADC example did not use SYS/BIOS to generate the system clock? Here is the code for main( ) from the example, with some questions...

    Void main()

    {

        // Initialize System Control:  --- QUESTION: Could this have been done by SYS/BIOS, leaving a smaller main( ) ?

        // PLL, WatchDog, enable Peripheral Clocks

        // This example function is found in the DSP2833x_SysCtrl.c file.

        InitSysCtrl();

     

        // Copy time critical code and Flash setup code to RAM  --- QUESTION: This must be done outside of SYS/BIOS, correct?

        // The  RamfuncsLoadStart, RamfuncsLoadEnd, and RamfuncsRunStart

        // symbols are created by the linker.

        MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

     

        // Call Flash Initialization to setup flash waitstates QUESTION: This must be done outside of SYS/BIOS, correct?

        // This function must reside in RAM

        InitFlash();

     

        // Specific clock setting for this example: -  QUESTION: This must be done outside of SYS/BIOS, correct?

        EALLOW;

        SysCtrlRegs.HISPCP.all = ADC_MODCLK; // HSPCLK = SYSCLKOUT/ADC_MODCLK

        EDIS;

     

        InitAdc();  // Init the ADC  QUESTION: This must be done outside of SYS/BIOS, correct?

     

        // Specific ADC setup for this example: - QUESTION: Could this be included into InitADC?

         AdcRegs.ADCTRL1.bit.ACQ_PS = ADC_SHCLK;

        AdcRegs.ADCTRL3.bit.ADCCLKPS = ADC_CKPS;

        AdcRegs.ADCTRL1.bit.SEQ_CASC = 1;       // Cascaded mode

        AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x0;

        AdcRegs.ADCTRL1.bit.CONT_RUN = 0;       // Setup Start and Stop Mode

        AdcRegs.ADCTRL2.bit.INT_ENA_SEQ1 = 1;   // This bit enables the interrupt request to CPU by INT SEQ1.

        AdcRegs.ADCTRL2.bit.SOC_SEQ1 = 1;       // This is used to initiate a software initiated conversion.

     

        BIOS_start();    /* does not return */

        }