The program shows how to use the A/D converter of the 80552.
The sensor for this flow meter was made from a turbine (fan) with 2 * magnets mounted on it separated by 180deg's opposite polarity's out.
A Hall sensor that switches on with one polarity and of with the other was mounted on the out side of a pice of polly pipe.
This signal is then fed to a 4018 chip running in / by 10 mode, it's output is sent to P4.0 as the input signal for the 80C552.
If this setup was to be used in another application it would be wise to use / switches on the 4018 to allow for more calibration.
This code is far from complete or bug free, but it might be useful to you.
P.S. The flow rate is output on the LCD or to a terminal when requested.
Four buttons allow you to scroll menu's on the LCD.