dS378
dS378
User Manual v2.19
Counters, Timers and Schedules can be combined. As an example lets assume we want to
count the pulses on input 2. We need to know the number of pules per hour coming in.
First we need a 1 hour time base, we’ll use counter/timer 1 for this.
Using T1 for the count input will make the counter increment once per second. There are 3600
seconds in 1 hour so we reset the counter when its greater than 3599 with C1>3599. The
counter will count from 0-3599.
Next we will use counter 2 to do the counting of input 2 pulses.
The count input is set to D2 to count the pulses. The reset input is controlled be counter 1.
When it gets reset to zero each hour, so does counter 2. As the capture input is blank the reset
event also captures the count value. This may be read any time in the next hour.
The internal time base, T1 is derived from the crystal on the module. It’s accurate but will drift
Copyright
© 2016-2017,
Devantech Ltd.
All rights reserved.
22
www.pishrobot.com