SCT (lpc43xx): need a second counter while using the L-State machine....

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

SCT (lpc43xx): need a second counter while using the L-State machine....

663 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc_guy469 on Mon Mar 10 10:02:23 MST 2014
Hello,


I am using the LPC43xx micro-controller, along with the SCT, to control a sensor.  I am also using the SCT Design Tool in conjunction with the Keil IDE.  This works fine.  I can control the output lines that manipulate the sensor.  This implementation using an L-State design to perform matching with the events.  However, it is important that I use another counter to keep track of an "expiration time"....at which point the control sequence will be restarted.

Originally, I thought that I could use the H_COUNT (pre-scaled with a factor) register to keep track of the "expiration time".  However, I have learned that the SCT only supports one state machine....either L-State, H-State, or Unified-State.  So, I am looking for a way to use the H-COUNT register (or some other means) to "watch" the "expiration time" from inside the SCT state machine.  The "expiration time" can be as short as milliseconds to hours.

Does anyone know of a way to accomplish this?

Thanks in advance for your assistance.


.....lpc_guy469
Labels (1)
0 Kudos
3 Replies

585 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JoeHale on Thu Mar 13 13:35:28 MST 2014
Hi,

In the FSM design tool install folder there is a folder called examples it contains the same kind of start stop example which includes a high and low state machine on the in the same file.

On my machine the file is at: C:\Tools\NXP\SCT-Tools2\examples\LPC4300\start_stop\start_stop.fzm

Having said that I'd recommend trying out the "Red State" tool in LPCxpresso as the FSM design tool is not under active development. You are able to generate code in it that you can then import back into Keil.

0 Kudos

585 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpc_guy469 on Thu Mar 13 12:32:06 MST 2014
Thank you for your reply.

I am using the FSM design tool which will not allow 2 state machines to co-exist (on the same page).  I will review the suggested hyperlink and let you know what I find out.

....lpc_guy469
0 Kudos

585 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JoeHale on Thu Mar 13 12:18:59 MST 2014
Hi,

The SCT support either a unified timer or a split timer. When split you can use both the H and the L counters. Both the high and low counter would each have their own state machines (which would be designed on the same page).

Look at the SCT_start_stop example in the SCT Cookbook:
http://www.lpcware.com/content/nxpfile/lpc80-sct-cookbook-and-tutorial-code-examples

There is probably a similar example in the SCT Design tool,

The SCT on 43xx is just a bigger version of the lpc800's SCT. Anything that works on the lpc800 will work on the lpc43xx.

Hope that helps.
0 Kudos