I need have a sampling rate of 8kHz so that the microprocessor will sample an input of a sensor at the correct rate. How do I code such a thing to ensure proper data acquisition?