Hi Tony,
ADCIN & the PIC's internal ADC are actually pretty fast, but the sound
command, depending on the note/duration time, can be relatively slow.
RCTIME just measures the time a pin stays in a particular state. POT would
work, but it's really a pain to calibrate.
The time lag you're seeing is most likely due to the time it takes to generate
sound.
You can adjust the sample time for A/D readings by using the PBP
DEFINE ADC_SAMPLEUS option as long as it stays within the parameters
shown in the PIC data sheet for A/D acquisition time.
The default is 50uS unless otherwise specified with DEFINE ADC_SAMPLEUS.




Bookmarks