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.

CCS: The CCS Bug?

Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Tool/software: Code Composer Studio

  Hi, everybody!

          I wanted to use tms28335  to cap  23kHz frequency, but  the program can't  step into the interrupt .  

         Then I separated the cap  code  from my project and   stepping ,   I found that  the program worked but  the registers of ecap5  always were zero .

          I don't konw why ?  

       CAP test.zip   Help me !

  • Please check if clock to the module is enabled.
  • Yes, the clock is enabled.

        EALLOW;
        SysCtrlRegs.PCLKCR1.bit.ECAP5ENCLK=1;
        EDIS;
       The project is in the annex.

        The issuse:  the code can't change the registers of ecap5 (the value is all '0').

       I put the code about the ecap in other project , and  work normal . The value of eCAP5's registers  is right .

      I don't konw what happen in the project ,help me .

      Thanks !

  • I presume the other project works fine in the same device, which means we can rule out a bad device. If all registers/bits of a module is "0", the problem is almost always clock not being enabled. Is there a possibility subsequent code turned off the clock after it was enabled? Have you verified the value of ECAP5ENCLK bit through CCS (Watch expression or Memory window)? Are you able to manually write values directly into the register via CSS (i.e. not using code)? Please compare this code with the one that is working fine and identify what you are doing different here.
  • Thanks for your help!

              I verified the value of ECAP5ENCLK bit through CCS .

             

             The value of  PCLKR1 indicate the  ECAP5ENCLK bit  is '1'.

            In the issuse project , the value of ecap5 registers :

     Then,I manually write values directly into the register via CSS.

    But, it can't setp into the cap5 interruput . The other project can work .

    However,the counters(CAP1\CAP2\CAP3\CAP4) always are '0'  .

    I don't  konw why?

    Best regards !

    Clack

  • Since the other project works just fine, it is evident that there is no hardware issue here. As suggested before, please compare the two codes to identify what is causing the issue. The Controlsuite/c2000ware examples are a good source of reference as well.

  • Hi,Hareesh

             Thanks for your help .

             The  fine project is the controlsuite examples .The differentia is  that  the code is changed from the bad project.

            The codes are same .         

            The CMD are same too,so I can't find the the difference between the two projects .

           Can you check my cap test project?

            Thanks!

           Best regards!

    Clack

  • Clack,

    Have you looked at your input signal to the eCAP? It looks like the CAP isn't detecting any rising edges.

    Just to confirm, are only the CAP1-4 registers 0? Or are ALL of the eCAP registers 0?

    Regards,
    Kris
  • Hi,Kris

        Thanks for your help !

        1. I had looked at theinput signal to the eCAP, the rising edges and trailing edges are good,  I had checked.

        2. I creat two project ;

        3. The first project is that  all of the eCAP registers  are 0 , the project is the  attached project (CAP test);

        4. The seccond project is changed from ControlSUite(Example_2833xECap_Capture_Pwm), and the control regsiters of CAP5  can be changed  and  the pc  can run at the breakpoint  (ISR of cap5) , but  the CAP1-4 registers are 0 and  the code is same as the first project.  In the ISR , i  make GPIO29 toggle between 0 and 1. On oscilloscope, the wave of GPIO29 is  right .

        I don't konw why?

       Thanks again!

    Clack