CTIMER one-shot setup?

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

CTIMER one-shot setup?

2,089 Views
davenadler
Senior Contributor I

Really simple question, I hope!
I need to set up a one-shot timer, one external trigger pin, one output pin, which:

- timer starts on external trigger (for example positive transition)
- after 5usec, sets output pin to 0

- after 10usec, timer stops and pin reverts to 1
- next positive transition on external trigger, repeat the above steps...

How do I do this with a CTIMER (on LPC55S12)?
Thanks!
Best Regards, Dave

Labels (4)
Tags (1)
0 Kudos
7 Replies

1,944 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dave Nadler,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'm afraid CTIMER's too hard to implement your application, so I'd like to suggest you use the SCTimer/PWM (SCT) to do it.
in addition, I've attached an application note which is a collection of examples and usage notes for the SCTimer/PWM block used in NXP microcontrollers, please refer to it for details.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,944 Views
davenadler
Senior Contributor I

jeremyzhou‌ - Thanks but I must use SCTIMER for a different purpose.
Is it not possible to:

  • use a capture channel to start the timer from an input pin,
  • use a match channel to drive output low
  • use a 2nd match channel to stop+reset timer
  • on stop+reset of timer, output pin should again go high

Is this not correct?
Thanks,
Best Regards, Dave

0 Kudos

1,944 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dave Nadler,

Thanks for your reply.
1) Is this not correct?
-- Except t the first operation, the CTIMER is available to do the rest of operations, as CTIMER doesn't support to trigger the timer's counter starts to run via capture pin, however, you can use a GPIO pin to detect the external signal instead of capture pin, then enable the timer's counter.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

1,944 Views
davenadler
Senior Contributor I

jeremyzhou‌ - I'm looking at UM11126 LPC55S6x/LPC55S2x/LPC552x User manual Rev. 1.9 — 15 November 2019. In chapter 25, please see Table 544. Count Control Register (CTCR, offset 0x070), SELCC field:

Bits 7:4 of this register are also used to enable and configure the capture-clears-timer
feature. This feature allows for a designated edge on a particular CAP input to reset the
timer to all zeros. Using this mechanism to clear the timer on the leading edge of an input
pulse and performing a capture on the trailing edge, permits direct pulse-width
measurement using a single capture input without the need to perform a subtraction
operation in software.

Is this not what I am looking for??
Thanks,
Best Regards, Dave

0 Kudos

1,944 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dave Nadler,

Thanks for your reply.
1) Is this not what I am looking for??
-- I think it's available to implement your purpose via configuring the SELCC filed.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
----------------------------------------------------------------------------

0 Kudos

1,944 Views
davenadler
Senior Contributor I

jeremyzhou‌ - Are you sure? Does this turn on the timer if it is not already running??

0 Kudos

1,944 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Dave Nadler,

Thanks for your reply.
1) Are you sure?
-- Yes.
2)  Does this turn on the timer if it is not already running??
-- No, I don't think so.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
----------------------------------------------------------------------------

0 Kudos