Maxim Integrated 10-6
MAX31782 User’s Guide
Revision 0; 8/11
10.4 Tachometer Code Example
The following pseudocode shows how to set up tachometer 0. This example does not generate any interrupts, but
instead the captured tachometer value can be periodically polled by software.
Tachometer setup:
TACHCN0_bit.TPS=3; //tachometerclockissysclk/64or62.5kHz
TACHCN0_bit.TRPS=1; //setfor2pulsesperrevolution
TACHCN0_bit.TEXEN=1; //enableedgecaptureofTACH.0pin
TACHCN0_bit.TACHE=1; //startthetachometercount
Reading the tachometer:
tach_counts=TACHR0; //storethecapturedtachometercountsforthelast
revolutioninavariable
Comentários a estes Manuais