LPC546XX CTIMER configuration question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC546XX CTIMER configuration question

Jump to solution
761 Views
abdel12312
Contributor I

Hello NXP Community,

I'm working with an LPC546xx and need to know if a single CTIMER can simultaneously:

  1. Use channels 0 and 1 for input capture
  2. Use a match register (MR0) for interrupt generation on counter overflow without affecting any pins

My current setup:

  • CTIMER1 channels 0-1: Input capture
  • CTIMER1 channels 2-3: Timeout interrupts

I need to add timer overflow detection using a match register on the same timer. My though was to use Channels 0 or 1 MRs to be able to count number of overflows.

Since MCR (match control), CCR (capture control), and EMR (pin output) are separate registers, I believe they can be configured independently.

Can someone from NXP confirm if using match interrupts alongside input capture is supported?

0 Kudos
Reply
1 Solution
642 Views
Habib_MS
NXP Employee
NXP Employee

Hello @abdel12312, sorry for the late reply.
Yes, you can configure a channel in Input Capture/Match mode and utilize the match register simultaneously. However, the SDK does not provide an example demonstrating both functionalities together. As a reference, you can modify the example named lpcxpresso54628_ctimer_match_interrupt_example, which already includes the match functionality. This thread may also help guide your implementation.

BR
Habib.

View solution in original post

0 Kudos
Reply
1 Reply
643 Views
Habib_MS
NXP Employee
NXP Employee

Hello @abdel12312, sorry for the late reply.
Yes, you can configure a channel in Input Capture/Match mode and utilize the match register simultaneously. However, the SDK does not provide an example demonstrating both functionalities together. As a reference, you can modify the example named lpcxpresso54628_ctimer_match_interrupt_example, which already includes the match functionality. This thread may also help guide your implementation.

BR
Habib.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2172144%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPC546XX%20CTIMER%20configuration%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2172144%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20NXP%20Community%2C%3C%2FP%3E%3CP%3EI'm%20working%20with%20an%20LPC546xx%20and%20need%20to%20know%20if%20a%20single%20CTIMER%20can%20simultaneously%3A%3C%2FP%3E%3COL%3E%3CLI%3EUse%20channels%200%20and%201%20for%20input%20capture%3C%2FLI%3E%3CLI%3EUse%20a%20match%20register%20(MR0)%20for%20interrupt%20generation%20on%20counter%20overflow%20without%20affecting%20any%20pins%3C%2FLI%3E%3C%2FOL%3E%3CP%3EMy%20current%20setup%3A%3C%2FP%3E%3CUL%3E%3CLI%3ECTIMER1%20channels%200-1%3A%20Input%20capture%3C%2FLI%3E%3CLI%3ECTIMER1%20channels%202-3%3A%20Timeout%20interrupts%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI%20need%20to%20add%20timer%20overflow%20detection%20using%20a%20match%20register%20on%20the%20same%20timer.%20My%20though%20was%20to%20use%20Channels%200%20or%201%20MRs%20to%20be%20able%20to%20count%20number%20of%20overflows.%3C%2FP%3E%3CP%3ESince%20MCR%20(match%20control)%2C%20CCR%20(capture%20control)%2C%20and%20EMR%20(pin%20output)%20are%20separate%20registers%2C%20I%20believe%20they%20can%20be%20configured%20independently.%3C%2FP%3E%3CP%3ECan%20someone%20from%20NXP%20confirm%20if%20using%20match%20interrupts%20alongside%20input%20capture%20is%20supported%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2176873%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC546XX%20CTIMER%20configuration%20question%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2176873%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F254989%22%20target%3D%22_blank%22%3E%40abdel12312%3C%2FA%3E%2C%20sorry%20for%20the%20late%20reply.%3CBR%20%2F%3EYes%2C%20you%20can%20configure%20a%20channel%20in%20Input%20Capture%2FMatch%20mode%20and%20utilize%20the%20match%20register%20simultaneously.%20However%2C%20the%20SDK%20does%20not%20provide%20an%20example%20demonstrating%20both%20functionalities%20together.%20As%20a%20reference%2C%20you%20can%20modify%20the%20example%20named%20lpcxpresso54628_ctimer_match_interrupt_example%2C%20which%20already%20includes%20the%20match%20functionality.%20This%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMCUXpresso-SDK%2FCTimer-capture-examples-for-LPC54608%2Fm-p%2F819863%22%20target%3D%22_self%22%3Ethread%3C%2FA%3E%20may%20also%20help%20guide%20your%20implementation.%3C%2FP%3E%0A%3CP%3EBR%3CBR%20%2F%3EHabib.%3C%2FP%3E%3C%2FLINGO-BODY%3E