How can I change the state of SCT upper timer by using an event on the lower?

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

How can I change the state of SCT upper timer by using an event on the lower?

565 Views
waterdragon900
Contributor II

I am trying to produce a signal from SCT2 which changes from 650Hz to 1000Hz and back at a rate of 5Hz. I set the timer to be non-unified. I set the lower counter to give an output event and change of state at 5Hz and the upper to give 650/1000Hz, depending on state. What I didn't realise is that the states for upper and lower seem to be independent so this didn't work. I then wondered if I could connect the output from the lower timer event to the input of the upper timer but I can't find any way of doing this. The chip is LPC1549 and the movable functions do not include SCTIN so I can't fudge it by connecting an input and an output to the same physical pin.

One more requirement is not to use interrupts or have any regular processor involvement. It should be set and forget.

Has anybody any ideas about this?

0 Kudos
2 Replies

446 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Colin Burn,

   If you define the UNIFY =0, and control two 16-bit counter, actually, you can consider it is two independent 16bit timer.

   Do you want to out put the 5HZ and 650Hz to 1000Hz wave in the same output pin in the different time?

   Could you give more details about it?

   If you want to out put it in the same pin, maybe you can change the SCT configuration when the time is reached.


Have a great day,
Kerry

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

0 Kudos

446 Views
waterdragon900
Contributor II

Hi Kerry,

Many thanks for your response.

I don’t need to have a physical output from the 5Hz counter. I just need the logical 5Hz signal to toggle the second counter between 650 Hz and 1000Hz.

Then I do need a physical pin output from the 650/1000Hz counter.

I can’t really think of any other details to give other than those I already posted.

In summary, I suppose, all I am asking is how to connect one counter’s output to another counter’s input and create an event with it. I have already successfully run the two non-unified counters and proven that my code works.

It’s just connecting between the two that is the problem.

I don’t mind using two SCTs in unified mode if that helps.

Any ideas?

Kind regards,

Colin.

0 Kudos