unconfigured tcpwm

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
suno_285741
Level 3
Level 3
10 sign-ins 10 replies posted First solution authored

Hi

   

I used CY8C4014SXI

   

I want to use unconfigured tcpwm for timer capture and pwm.

   

I will use these separately.

   

first of all I set the capture config like this. (my tcpwm component name is timer)

   

 

   

    /* Enable the global interrupt */
    CyGlobalIntEnable;       
    TC_CC_ISR_StartEx(InterruptHandler);  
       
    Timer_SetMode(Timer_MODE_TIMER_CAPTURE);
    Timer_SetCaptureMode(Timer_TRIG_FALLING);   
    Timer_SetPrescaler(Timer_PRESCALE_DIVBY1);
    Timer_SetCounterMode(Timer_COUNT_UP);  
    Timer_SetOneShot(0);
    Timer_SetInterruptMode(Timer_INTR_MASK_CC_MATCH);
    Timer_TriggerCommand(Timer_CAPTURE_MASK, Timer_CMD_CAPTURE);
   
    Timer_WritePeriod(65000);
    Timer_WriteCounter(0);
    Timer_WriteCompare(0);
   
    //Timer_Enable();     
    Timer_Init();  
    Timer_Start();

   

but it is not working.

   

What am I missing the config for timer capure?

   

 

   

Thanks

0 Likes
1 Reply
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

As I understand the Timer_Init() will initialize the component with the configuration from design-time. Use that as the first call. Timer_Start() will call Timer_Init(), you should use Timer_Enable().

   

 

   

Bob

0 Likes