I am using the N2HET PCNT instruction to measure the shaft speed of a 6-pole machine. There is a sine wave generated by the machine which is then converted to a square wave by electronics, and then sampled in my NHET program as this:
L22 PCNT {next=L23,hr_lr=HIGH,reqnum=0,request=NOREQ,type=FALL2FALL,pin=5,period=0,data=0,hr_data=0}
The problem I have now is that by the physical nature of the machine, each pole produces pulses that are not exactly alike, so I am getting some jitter in my speed readings. What I would like to do is be able to measure every sixth pulse, so I would be measuring the pulse produced by the same physical pole each time.
Do you have a suggestion how I might accomplish this?
Thanks
Alan