Water Meter - pulse counting using T0 EXT CLK possible?

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
pavelius
Posts: 5
Joined: 29 Jan 2021 12:05

Water Meter - pulse counting using T0 EXT CLK possible?

Post by pavelius »

(new to this forum, but not to electronics)

Hello,
I am looking for help with exploring different possibilities of counting puses with ZUNO.

The plan is to build a water meter, using ZUNO to count pulses from water sensor. The sensor has a very fine granularity so it outputs a many of pulses per liter. It has clean output signal (no need to debounce)

I see three options to do the counting:
* The example provided with ZUNO uses SW to count edges from the sensor. That is not good enough for me, as I can get the pulses quite close to each other.

*A better option that I find in documentation would be to use the external interrupt ZEROX. That would likely work, but I am not sure if that is always given priority when the Z-Wave is working. If not, a pulse could be missed.
Does ZEROX have highest priority and has guaranteed time to execution?

* The most elegant solution I would use on my other processor would be to use timer to count edges.
ZUNO pinout shows T0/T1 EXT CLK input, so the name suggests it has exactly what I need.However, But I can't find any documentation how to set it up.
Anybody has info or pointer to documentation about the EXT CLK pins?

Thanks,
Pavel
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Water Meter - pulse counting using T0 EXT CLK possible?

Post by PoltoS »

The highest prio is always RF, then INT1/INT0/ZEROX/T0/T1

I would suggest you to use interrupts (INT0 or INT1) as this code will be more universal and portable and will continue to work on the next Z-Uno 7gen too.

Check this: https://z-uno.z-wave.me/Reference/Interrupts/
pavelius
Posts: 5
Joined: 29 Jan 2021 12:05

Re: Water Meter - pulse counting using T0 EXT CLK possible?

Post by pavelius »

Thanks, I have mistakenly assumed that the ZEROX will be best since it has half the fastest execution time compared to INTx. (https://z-uno.z-wave.me/Reference/zunoExtIntMode/)
I now see that it is not correct, as execution time and priority is two things. All I need is that an interrupt is processed before next one comes. 40us is enough, so I will then use the INTx as you suggested for portability reason.

But while not so much difference for the water meter case(as pulse length will be >10ms), but I am still curious about the question of what does the "T0 EXT CLK" in the ZUNO pinout diagram means and what is its intended use?
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Water Meter - pulse counting using T0 EXT CLK possible?

Post by PoltoS »

It was for external clock for T0 timer, but since 7th gen Z-Uno will not have it in that way we don't suggest to dig into
pavelius
Posts: 5
Joined: 29 Jan 2021 12:05

Re: Water Meter - pulse counting using T0 EXT CLK possible?

Post by pavelius »

Ok, fair enough. Thanks!
Post Reply