Page 195 - Making PIC Microcontroller Instruments and Controllers
P. 195
PFOJECI I t9i
j$!!i!i-lild€{:: Photo of pulse senerator
The PIC will aclually take 0.25+ seconds to execute this command (because ofthe
counting time specified) and there is nothing else that can be done while this command
is being executed (because of the way the compiler is designed). Since we could get a
feel for the rpm in a much shorter time at hjgher rpm, this can definitely be considered
a low-rpm problem. The sollrlion to this low count sjtuation is to have a higher count
encoder on the shaft so a large number of counts can be intercepted in a shorl pedod of
time. However, as we will see, there is a trade-off at the high speed end when we
increase the encoder count.
HIGH SPEED COI{SIDERAIIONS
There is also a limit to how high the frequency can be and stilt be in ihe range that drc
PIC can respond to. For the PIC 16F87?A that we are using in combjnation with the
PBP software, this frequency is 100 kHz for a 20 MHz OSC and 25 kHz fot a 4 MHz
OSC (ow case).If we were using an encoder that had 1000 counts per revolution, we
could keep up with a shaft that was rotating at 25 revolutions per second.
/
2 5 , 0 0 01 0 0 0 = 2 s
A motor running at 3600 rpm, which is quile common, spins at 60 revolutions per
second. We can see that we starl to exceed the limit of what we can do rather rapidly.