K8055 - Time measuring with own PWM frequency

Hi,

In case of a K8055 is it possible to count the PWM output on the I1 digital input? It seems to work in case bounce is set to zero and DA1 is set to 127. For me it counts about 50000 in 30sec, This gives about 1,6kHz, which is about 0,6ms. Is it possible to use K8055 in such a setup? What is the PWM frequency in this case?

I’d like to use this to measure time in about 3-15 sec range. The idea would be to connect the PWM out to the I1 input via a switch. This set-up would be count till the switch is connected. By knowing the frequency and the counter value I can tell the time. Accuracy should be at least 0,1sec.

Any idea about this?
Thanks in advance for any advise.

The K8055 counter can count max. 2kHz.
The PWM output frequency is 23.4375kHz.
You have to use an external frequency divider.
Please see this thread (p. 4) how to connect the divider:
viewtopic.php?f=3&t=4738&p=21339

Thank you for the advice. The circuit you mentioned is simply enough.
One question though. When I do what I described earlier, so the PWM1 (with debounce 0 and Analog output A1 on 127) connected to to the Digital input I1, it still counts. I tested it a few times and it seems that it gives the same number for the same time. Measured by hand so far, but it seems stable. It counts till the end of the two byte 65535 in 40sec, which is 65535/40=1638Hz. So it seems OK for me. How is this possible?

Is it possible to use one of the digital output as the power supply for this simple frequency divider (with 40402)? I need quick solution without any additional PCB.

Meanwhile I found it. SK2 upper PIN could be the source of the +5V.

Thanks

[quote]One question though. When I do what I described earlier, so the PWM1 (with debounce 0 and Analog output A1 on 127) connected to to the Digital input I1, it still counts.[/quote]When the debounce time is set to zero, the counter counts if it founds any pulses and pauses. Even the 23kHz PWM signal can cause some reading to the counter.
The counter result is highly dependent on the PWM setting.

i have been able to get a fairly stable count of 500 pulses per second if i set like this

OutputAnalogChannel(1, 141)

try it for yourself and see what results you get

Thanks for the idea. My experience was the same. Meanwhile I finished the PCB on the official way, so I divided the base frequency with 32 on a separated PCB. It works well. The extension PCB for the K8055 controls a counting between two signs coming into my PCB from a watter flow measure device. It gives a sign in every time when one liter watter went through the tube. This PCB enables the divided frequency to the DI1 between two signs, then disable the frequency to go to DI1 and puts DI3 to HIGH as a ready sign. I developed a small program to detect this ready sign, read the counter, reset it and sending a HIGH to the DO1 to resets my PCB and it starts the cycle again. Having the number in the counter and knowing the frequency I can calculate how many liter watter goes through the tube in a minute.