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.

LAUNCHXL-F28379D: AET resources and debug mode

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I join a short and simple project for this question.

In a first version, this programm simply uses the EPWM1 interrupt to force the Start of Conversion of ADCA. 

Everyting is fine, but this solution is not elegant.

So I put away the ADC_forceSOC in the interrupt, and prefer

- to ask to EPWM2 module to generate SOCA Trigger

- to ask to ADCA Module to be triggered by SOCA of PWM2

Not only I never enter in the ADC Interrupt, but I even cannot run the debug mode:

Please note the message:

C28xx_CPU1: If erase/program (E/P) operation is being done on one core, the other core should not execute from shared-RAM (SR) as they are used for the E/P code. Also, CPU1 will be halted to determine SR ownership for the CPU which will run the Flash Plugin code, after which CPU1 will be set to run its application. User code execution from SR could commence after both flash banks are programmed.
C28xx_CPU1: AutoRun: Target not run as breakpoint could not be set: Error enabling this function: This task cannot be accomplished with the existing 

Can somebody help me ? This problem is critical for us. Thank you

Archive4TI_PWMandADC.zip

  • edit: "existing AET resources" 

  • Hi Vincent,

    Please allow me a day to try to replicate your issue. 

    Best Regards,

    Ben Collier

  • Hello Benjamin. Glad to speak to you again.

    This problem is very serious for me. I reproduced this. Let me explain to you extacly what I done (maybe oit will help you:

    1- I started from a project without any PWM or ADC

    2- I used SysConfig to configure a PWM, which generates an interrupt each COMPA overflow --> OK

    3- I tried to add an ADC handler with SysConfig. There was a lack oh RAM. Instead of add RAM blocks for the text section, I switched the active configuration to FLASH --> OK

    4- I asked to SysConfig to Enable SOCA Trigger, and to trig the SOC on SOCA PWM1. There was a lack of Flash Memory for cinit section, so I added a FLASH block for cinit

    I don't think it is a good idea because the cinit section is not splitted. I don't know why, but it worked (in release mode butr also in debug mode). I still entered in the PWM interrupt; but not in the ADC Interrupt

    5- I juste tried to insert the EPWM_clearADCTriggerFlag driverlib function in my code. --> here comes the AET message in the debug mode

    6- I tried to come back to the previous configuration. This is impossible. the debug mode is no more available, and the programm do not work

  • Vincent,

    I imported the project that you attached, and I was entering the EPWM interrupt, but never the ADC interrupt, like you mentioned. I went to our adc_ex2_soc_epwm example, and I copied the initialization code for the EPWM module, and pasted it into your empty_bitfield_driverlib_main.c file. 

    void initEPWM(void)
    {
        //
        // Disable SOCA
        //
        EPWM_disableADCTrigger(EPWM2_BASE, EPWM_SOC_A);
    
        //
        // Configure the SOC to occur on the first up-count event
        //
        EPWM_setADCTriggerSource(EPWM2_BASE, EPWM_SOC_A, EPWM_SOC_TBCTR_U_CMPA);
        EPWM_setADCTriggerEventPrescale(EPWM2_BASE, EPWM_SOC_A, 1);
    
        //
        // Set the compare A value to 1000 and the period to 1999
        // Assuming ePWM clock is 100MHz, this would give 50kHz sampling
        // 50MHz ePWM clock would give 25kHz sampling, etc.
        // The sample rate can also be modulated by changing the ePWM period
        // directly (ensure that the compare A value is less than the period).
        //
        EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, 1000);
        EPWM_setTimeBasePeriod(EPWM2_BASE, 1999);
    
        //
        // Set the local ePWM module clock divider to /1
        //
        EPWM_setClockPrescaler(EPWM2_BASE,
                               EPWM_CLOCK_DIVIDER_1,
                               EPWM_HSCLOCK_DIVIDER_1);
    
        //
        // Freeze the counter
        //
        EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_STOP_FREEZE);
    }
    

    I called this function after board_init(), so it overwrites the settings from SysConfig. 

    I then enabled the EPWM for counter mode up and enabled it to trigger the ADC right before the main while loop: 

        EPWM_enableADCTrigger(EPWM2_BASE, EPWM_SOC_A);
        EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_UP);

    With these changes to how EPWM2 is configured, I was able to enter both the EPWM and ADC interrupts.

    I hope this helps.

    Best Regards,

    Ben Collier

  • Hello Benjamin,

    My problem didn t deals directly with ADC but why the debug mode.

    It seems it was due to the limited uimber of hardware breakpoints. I resolved this int the debug configuration (asking to erase the previous BP in each new session) But I think there are others things to adjust to di this properly. I will inverstigate.

    So, since I could nit use the FLASH for my debug session, I combined RAM regions. Then the RAM can contain the programm, I the debug mode allowed me to do what I wanted with the ADC.

    I have another problem, but I gonna open a new ticket for that