>Robert Lunn wrote: >> >> >I need to measure a continuous frequency between 0 - 250 cycles/MINUTE, >> >and transmit it via RS-232 at 2400 baud in a message containing 6 bytes >> >once 5 seconds. >> >> Peter, what's the six-byte message you send? >> >> (I want to get a handle on the processing required to >> create the message string.) > >Bob, > >Sorry, but there are only five bytes and are as follows; > >Byte Description >----------------------------------------------------------------- > 1 Start of Message ID Constant > 2-3 Unit Identification 15 bits constant (1 bit battery low) > 4 Frequency Value Variable > 5 Checksum Variable > >Sorry for the delay in answering, and thanks for your interest. > >Regards, > >Peter Hmm. A six byte message at 1200 baud takes 0.05 seconds. At 250 rpm the input pulses arrive every 0.3 seconds. So there's enough time between pulses to send multiple messages if necessary. Providing your transmit routine waits until just after a pulse (or counter overflow when there's no input) it should have hardly any problems with packets corrupted by interrupt servicing routines, in fact you should probably disable the interrupt for 100mS after each pulse. Disabling the interrupt allows for the situation where the flag is stationary on the edges of the sensor and produces anomolously high readings. These noise readings appear as 600 rpm and can be filtered out (binned). Just a few thoughts, Keith. ========================================================== Keith Dowsett "Variables won't; constants aren't." E-mail: kdowsett@rpms.ac.uk WWW: http://kd.rpms.ac.uk/index.html