LPC54102 - Configuring CTIMER0 Capture Channel 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SDK Version 2.6.1
The _ctimer_capture_channel value kCTIMER_Capture_3 is only compiled in to the SDK if FSL_FEATURE_CTIMER_HAS_CCR_CAP3 is defined:
/*! @brief List of Timer capture channels */typedef enum _ctimer_capture_channel{kCTIMER_Capture_0 = 0U, /*!< Timer capture channel 0 */kCTIMER_Capture_1, /*!< Timer capture channel 1 */kCTIMER_Capture_2, /*!< Timer capture channel 2 */#if defined(FSL_FEATURE_CTIMER_HAS_CCR_CAP3) && FSL_FEATURE_CTIMER_HAS_CCR_CAP3kCTIMER_Capture_3 /*!< Timer capture channel 3 */#endif /* FSL_FEATURE_CTIMER_HAS_IR_CR3INT */} ctimer_capture_channel_t;
For LPC54102, however, this value is not defined (in LPC54102_cm4_features.h) so kCTIMER_Capture_3 is not provided.
Why is this not the case? There are a number of pins that can be set up via pinmux for capture for ctimer0 input channel 3. So why is FSL_FEATURE_CTIMER_HAS_CCR_CAP3 not defined for LPC54102?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the respons. The problem is that the compiler option is not dependent on the index of the timer. In other words, if that option is not defined, then input capture channel 3 is made unavailable for ALL timers, irrespective of index. And as I indicated in the original post, FSL_FEATURE_CTIMER_HAS_CCR_CAP3 is NOT defined in LPC54102_cm4_features.h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The capture pins are dependent on the CTimer index, I suppose you can define the FSL_FEATURE_CTIMER_HAS_CCR_CAP3=1 in compiler option, but you remember that only CTimerB0/B1 have the CAP3 pins.
Hope it can help you
BR
XiangJun Rong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As you know that the LPC54102 has 4 CTimer CT32B0,CT32B1,CT32B2 and CT32B3. The CT32B0 has 4 Capture pins CT32B0_CAP0~3, CT32B1 has 4 Capture pins CT32B1_CAP0~3, the CT32B2 has 3 Capture pins CT32B2_CAP0~2, the CT32B3 has 3 Capture pins CT32B3_CAP0~2.
So the CT32Bx_CAP3 is dependent on the the Ctimer index, that is why a compiler option FSL_FEATURE_CTIMER_HAS_CCR_CAP3 is defined.
Hope it can help you
BR
XiangJun Rong