28x1 external counter & special timer variable

Natalie Wilkie

New Member
I am using the DS1307 rtc and outputting an external (1 second) pulse to the 28x1 input0 (leg 11). I would like to use it as an external counter and then use this counter for another use. I know that I have to set the timer like this "settimer count 65535" and the special timer variable will automatically increment.

My question is how do I or how can I use/access this timer variable??

Any help would be greatly appreciated.

Regards
Natalie
 

Technical

Technical Support
Staff member
timer is a variable just like b1, w1 etc, so to access it you can use
let w1= timer
or
if timer > 5 then...
etc.
 

Natalie Wilkie

New Member
Hi again,

I am still having trouble with this problem and was hoping I could be instructed a little further please.

With this special "Timer" I would like to make w1 count on every high on portc 0. I have setup a few commands and by using the simulator I am watching w1 and nothing is happening.

I have:

let w1 = Timer
main:
settimer count 65535
high portc 0 ' to simulate external high from rtc
w2=w1+1
low portc 0 'low from rtc
'let toflag=0 ' this is to reset the flag but it never sets to 1
goto main

Does anyone have any suggestion on what I am not doing right please, if I haven't made myself clear please let me know and I will try to explain further.

Thanks
Cheers
Natalie
 

Technical

Technical Support
Staff member
You can't use 'high portc 0' - we understand the intention but it is wrong and just won't work.

To test connect an external resistor/switch as an input and physically press the switch!
 
Top