- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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