初期化のプログラム例 // ---- ADCINC12 setup ADCINC12_1_Start(ADCINC12_1_HIGHPOWER); // set power ADCINC12_1_GetSamples(0); // set ADC to continuous sampling
// ---- PGA setup PGA_1_Start(PGA_1_HIGHPOWER);
M8C_EnableGInt; //CPU ALL Interrupt Enable
void adc12(void) //ADC 12bit disp { int ad;
while(ADCINC12_1_fIsDataAvailable() == 0); // Wait for ready ADCINC12_1_ClearFlag(); // ADC clear flag ad = ADCINC12_1_iGetData()+2048; // Get ADC result(Ref Mux : Band Gap +/- Band Gap) }