Assuming fosc=4MHz, derive the following information from the program below: #in
ID: 2082882 • Letter: A
Question
Assuming fosc=4MHz, derive the following information from the program below:
#include <p18F452.h>
#include <stdlib.h>
#include <ADC.h>
#include <stio.h>
#include <delays.h>
Int X=0
void main (void) { While (1)
{
OpenADC (ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_1ANA_0REF,
ADC_CH1 & ADC_INT_OFF); Delay1KTCYx(10);
Convert ADC( );
While (BusyADC( ));
X = ReadADC( );
Delay10KTCYx(200); }
}
a) The channel used
b) The number of sensors
c) The period of the A/D converter
d) The acquisition time
e) How often the measurements are done?
Explanation / Answer
a) The channel used : Channel 1 is used for Analog Read.
b) The number of sensors : One Sensor
c) The period of the A/D converter:
Ta/d = 32/4 micro second = 8 micro second.
d) The acquisition time : 11 x Ta/d = 88 micro second.
e) How often the measurements are done?
200 micro second