Hi Rob,
Sorry, I was busy to unexpeted work during this week and worked very late
everyday.
You have to use the firmware I sent earlier.

I would create a main process that evaluate start conditions and initate sub
process that handle the action until duration.

some comments in your code below.

I will write you a sample skeleton later today.

Pascal



2010/3/27 Rob Conway <rjcon...@bigpond.com>

>  Hi,
>
> I was hoping to get some feedback on the AE engine and creating some simple
> output timers based upon energizing outputs based on time of day.  I can
> already set the RTC from the HOST and it resets at midnight, so the RTC
> represents seconds since midnight.
>
> This is what I am trying to achieve on the stack
>
>     IF RTC > ON_TIME and RTC <(ON-TIME+DURATION)
>     then DUTY1,0
>     else DUTY1,10001
>
> This is some rough code I thought I could use however not tested, I wanted
> to know if I was on the correct track and if the stack can handle maths
> results that go negative.
>
yes,
for Byte, values above 127 are considered negative
for Word, values above 32767 are considered negative
for Long, values above 2147483647 are considered negative


>
//  ON / OFF TIMES  (Seconds)
> //   L_UserN  ON time for Relay1   Seconds since Midnight
> //   W_UserL  Duration for PIO       Duration for relay ON time, seconds
>
what's the max duration? ,maybe fit in 255 range or 65535  to use B or W
instead variable.

>
>
> relay1_ctl:
> CMP.L    L_RTC,L_USERL
> BLE        relay1_off
>
> PUSH.L    L_RTC          //Get time since midnight
> PUSH.L   L_USERN      //  get user ON time in seconds since midnight
> SUB                             // Find out how many seconds difference
> between RTC and on time
> CMP.W     @-1, W_USERL    // See if difference is less than Duration, if so
> the output should be ON
>
as operands are L_ types, use CMP.L, also, @-4 needed for the L_ type who
require 4 bytes
important to retore stack pointer to inital value  after stack operation AIX
-4

> BGR        relay_off
> BLE         relay_on
> END
>
> relay1_on
> SET.W    W_DUTY1,0
> BRA Relay2_ctl
>
> Relay1_off
>  SET.W    W_DUTY1,10001
>  BRA Relay2_ctl
>
>
>  relay2_ctl:
> ~ code similar to relay 1
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Owfs-developers mailing list
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
>


-- 
Pascal
www.brain4home.eu
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to