ping, bs2 OEM timer question
hi, i've been observing the maximum value of the timer of the bs2 OEM when used with the ping. i positioned the sensor in such a way that there are no obstructions within 5m. I expected that I would get a constant value for the time (maximum value) however, what i got was values ranging from around 9990-1010. I also noticed that this has a linear relationship with temperature. can someone please shed some light on this? i know that transit time is dependent on the temperature. but in this case, it seems to show that the timer also is.
code:
PULSOUT 15, 5
PULSIN 15, 1, time
DEBUG HOME, DEC5 time
sample result:
temperature time
28 09991
28 09991
29 09994
...
34 10005
code:
PULSOUT 15, 5
PULSIN 15, 1, time
DEBUG HOME, DEC5 time
sample result:
temperature time
28 09991
28 09991
29 09994
...
34 10005
Comments
The resonator that the BS2 uses for its timing is also temperature dependent, but not much. I couldn't give you numbers without doing some research that you could do yourself. The effect of temperature on sound velocity would completely overwhelm any effect on the BS2's resonator.
The PING uses an SX28AC for control. I don't see a resonator or crystal on the PING, so this SX would be using its internal RC clock for timing and the RC clock is indeed sensitive to ambient temperature. This doesn't affect the PING distance readings because that timing is done in the Stamp which does have a stable clock.