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.

ADC disable sys bios Clocks

Other Parts Discussed in Thread: SYSBIOS

Hi All,

I'm using sysbios 6.40.01.15, and F28069 Piccolo control card.

I have several sysbios clocks (as I understand, they are implemented as SWI):

var Clock = xdc.useModule('ti.sysbios.knl.Clock');
Clock.tickPeriod = 5000;
Clock.timerId = -1;var clock3Params = new Clock.Params();
clock3Params.instance.name = "ProcessDataClk";
clock3Params.period = 1;
clock3Params.startFlag = true;
Program.global.ProcessDataClk = Clock.create("&ProcessData", 1, clock3Params);

I config my ADC module to be triggered by PWM:

SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1;
EALLOW;
AdcRegs.ADCCTL2.bit.ADCNONOVERLAP = 1;
AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1; AdcRegs.INTSEL1N2.bit.INT1E = 1; 
AdcRegs.INTSEL1N2.bit.INT1CONT = 1; 
AdcRegs.INTSEL1N2.bit.INT1SEL = 1; AdcRegs.ADCSOC0CTL.bit.CHSEL = 0;
AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; 
AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; AdcRegs.ADCSOC1CTL.bit.CHSEL = 1;
AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5; 
EDIS;
 
I enable the ADC from the PWM module init by calling:
 
EPwm1Regs.ETPS.bit.SOCAPRD = 1
It seems that calling this line mask the clocks and they are never called.
I am a novice in RT / EMBEDDED area ( in case that it is a beginner's mistake)
Regards,
Dov
  • Clock module uses one of the timers on the device.  Are you configuring any other timer? Can you share your configuration file (i.e. .cfg file)?

    For more information on TI-RTOS Kernel (formerly SYS/BIOS), the following links may help you:

    1. User guide
    2. TI-RTOS Kernel wiki
    3. TI-RTOS Kernel wiki for C28x
  • Hi Vikram,

    I don't use any Tasks.

    4503.TestProject.cfg

    Thanks,

    Dov

  • Thanks for the .cfg file. I don't see the TI-RTOS Timer module being used, so that's fine. Also, clock.timerId = -1 looks fine too. The timerId = -1 selects the available timer. So I don't see any problem in .cfg.

    I see that you don't use any Tasks but again back to original question are you defining any timers (by directly accessing timer registers) in your c code?

    Few other things, we could try is:

    • In ROV (its under Tools->RTOS Object View in debug mode), can you check Clock Module view to see if its ticking? ROV works in stop mode, so you should take a reading, resume the program, halt and take another reading.
    • In ROV, can you take a screenshot of Timer Basic module and paste it here?

    Meanwhile, I don't have the setup here. So I will set it up to imitate your settings.

    Vikram

  • Hi Vikram,

    I didn't defined any Timers in my C code.

    Attached the ROV screenshot of the Timer basic module:

    I notice that clearing the ADC int1 cause the Clocks halt:

    AdcRegs.ADCINTFLGCLR.bit.ADCINT1 = 1;

    Regards

  • Hi Dov,

    From the screenshot, it looks like the correct timer is assigned for the Clock. Timer Id # 2 which is reserved for RTOS is being assigned and it has an interrupt number 14. If you look at the doc, page 169 the diagram clearly shows only the cpu timer #2 is assigned to interrupt 14. Unless the ADCINTFLGCLR is disabling interrupt globally which I was not able to reproduce, the ADC should not be causing the Clock to stop.

    Is there a sample test project that you could send me so that I can reproduce the issue?

    Vikram