This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to configure CAPCOM1

Hello!

I have a bit problem. I don't know how I can configure the CC1_CC4 in this mode: Cap/Com p/n Trans.

Thanks.

  • You can not configure one channel for Capture and Compare at the same time.

    A lot of open questions, which timer are you going to associate it with (T0 or T1)? Then which mode, capture or compare (but since you are looking for edges then I assume you really want a capture). You also realize that CAPCOM timers only count up have a user defined reload register and are free running.

    You didn't say what kind of device Infineon or ST (C166 or XC166).

    So you could do this with DAVE (XC16x) and get the bare minimum.

    void CC1_vInit(void)
    {
       CC1_M1         = 0x0003; /* any edge */
       CC1_CC4IC      = 0x0070; /* interrupt group/level */
       CC1_T01CON_T0R = 1;      /* start timer 0 run bit */
    }
    
    void CC1_viCC4(void) interrupt 0x14 {
      /* read the value in CC1_CC4 */
    }