24
59 DAFTAR PUSTAKA 1. Schroder, Dieter K, (1990), Semikonductor Material and Device Characterization, John Willey & Sons, Inc, Canada 2. Sze, S. M, (1981), Physics of Semiconductor Devices 2 nd Edition, John Willey & Sons, Inc, Canada. 3. Sze, S. M et all, (1990), High Speed Semiconductor Devices, John Willey & Sons, Inc, Canada 4. Mego, T.J, (1986), Improved Feedback Charge Method for Quasistatic CV Measurements in Semiconductors, Rev. Sci. Instr. 57, 11. 5. Mego, T.J, (1986), Improved Quasistatic CV Measurement Method for MOS, Solid State Technology, 29, 11, S19-21 6. Lopez, A.D. (1973), Using the Quasistatic Method for MOS Measurements, Rev.Sci.Instr 44, 200. 7. Keithley Instruments (1986), Model 595 Quasistatic CV Meter Instruction manual, Keithley Instruments Inc, Ohio. 8. Stewart, J. W. dan Miao, K. X. (1999), The 8051 Microcontroller, Prentice-Hall, Inc, NewJersey. 9. Hall, D. V. (1992), Microprocessors and Interfacing, McGraw-Hill, Singapore. 10. Gray , Nicholas, (2004), ABCs of ADCs Analog-to-Digital Converter Basics, National Semiconductor Corp. California. 11. Sutrisno, (1986), Elektronika, Jilid 1, 2 dan 3, Penerbit ITB, Bandung. 12. Sutrisno, Elektronika Lanjut Teori Dasar dan Penerapannya, Diktat Kuliah, Program Studi Fisika, ITB, Bandung. 13. Hewlett Packard, (1988), Analysis of Semiconductor Capacitance Characteristics Using the HP 4280A 1 MHz C Meter/C-V Plotter, Application Note 232

08 CV DAFTAR PUSTAKA - Institut Teknologi · PDF fileDAFTAR PUSTAKA 1. Schroder, Dieter K, ... Thaha, and Maman Budiman, ... Engineering Education 2007

  • Upload
    letuyen

  • View
    214

  • Download
    1

Embed Size (px)

Citation preview

59

DAFTAR PUSTAKA

1. Schroder, Dieter K, (1990), Semikonductor Material and Device

Characterization, John Willey & Sons, Inc, Canada

2. Sze, S. M, (1981), Physics of Semiconductor Devices 2nd Edition, John

Willey & Sons, Inc, Canada.

3. Sze, S. M et all, (1990), High Speed Semiconductor Devices, John Willey

& Sons, Inc, Canada

4. Mego, T.J, (1986), Improved Feedback Charge Method for Quasistatic

CV Measurements in Semiconductors, Rev. Sci. Instr. 57, 11.

5. Mego, T.J, (1986), Improved Quasistatic CV Measurement Method for

MOS, Solid State Technology, 29, 11, S19-21

6. Lopez, A.D. (1973), Using the Quasistatic Method for MOS

Measurements, Rev.Sci.Instr 44, 200.

7. Keithley Instruments (1986), Model 595 Quasistatic CV Meter Instruction

manual, Keithley Instruments Inc, Ohio.

8. Stewart, J. W. dan Miao, K. X. (1999), The 8051 Microcontroller,

Prentice-Hall, Inc, NewJersey.

9. Hall, D. V. (1992), Microprocessors and Interfacing, McGraw-Hill,

Singapore.

10. Gray , Nicholas, (2004), ABCs of ADCs Analog-to-Digital Converter

Basics, National Semiconductor Corp. California.

11. Sutrisno, (1986), Elektronika, Jilid 1, 2 dan 3, Penerbit ITB, Bandung.

12. Sutrisno, Elektronika Lanjut Teori Dasar dan Penerapannya, Diktat

Kuliah, Program Studi Fisika, ITB, Bandung.

13. Hewlett Packard, (1988), Analysis of Semiconductor Capacitance

Characteristics Using the HP 4280A 1 MHz C Meter/C-V Plotter,

Application Note 232

60

14. OnSemi, MV2105 Silicon Tuning Diodes datasheet, On Semiconductor

15. Silabs (2005), 8 k ISP Flash MCU Family, C8051F350/1/2/3 data sheet,

Silicon Laboratories.

16. MacKenzie, I. S. (1992), The 8051 Microcontroller, Prentice-Hall, Inc,

NewJersey.

17. Cantu, M. (1997) Mastering Delphi 3, Sybex, Inc, Alamenda.

18. Fluke (1999), Model 45 dual display multimeter users manual, Fluke

Corporation.

19. Fluke (1992), 5100B series calibrators instruction manual, Fluke

Corporation.

61

DAFTAR PUBLIKASI

1. Asep Suhendi, Muhammad M. Munir, Hernawan Mahfudz, Mikrajuddin Abdullah, and Khairurrijal, “Temperature and Humidity Logger using SHT11 Sensor and MCS-51 Based Microcontroller”, International Conference on Mathematics and Natural Sciences (ICMNS) (Bandung, 29-30 November 2006), pp.

2. Asep Suhendi, Muhammad M. Munir, Mikrajuddin Abdullah, and Khairurrijal, “Upgrading Software and Hardware of Keithley 617 Electrometer“, International Conference on Mathematics and Natural Sciences (ICMNS) (Bandung, 29-30 November 2006), pp. 981-983.

3. A. Suhendi, M. M. Munir, and Khairurrijal, “A Four-Probe Technique Using Logarithmic Electrometers for Resistivity Measurement”, International Conference on Instrumentation, Communication, and Information Technology (ICICI) 2005 (Bandung, 3-5 August 2005), pp.366-369.

4. A. Suhendi, H. Thaha, M. M. Munir, and Khairurrijal, “Sistem Pengukuran Level Air dengan Data Logger Berbasis Mikrokontroler MCS-51 (Water Level Measurement System with MCS-51 Microcontroller-Based Data Logger)”, Prosiding Seminar Instrumentasi Berbasis Fisika II (Bandung, 22-23 Juli 2004), pp. 109-111. (in Indonesian)

5. Arif Surachman, Asep Suhendi, Muhammad M. Munir, and Khairurrijal, “Cygnal Microtrainer as an Educational Hardware for Learning Microcontroller System”, International Conference on Mathematics and Natural Sciences (ICMNS) (Bandung, 29-30 November 2006), pp. 1026-1028.

6. M. M. Munir, A. Suhendi, A. Surachman, M. Abdullah and Khairurrijal, “Recalibration of Keithley 617 Electrometer”, Prosiding Seminar Instrumentasi Berbasis Fisika (Bandung, 31 Agustus 2006), pp.97-99.

7. M.M. Munir, A. Suhendi, Mikrajuddin, and Khairurrijal, “Inexpensive I-V Meter for Semiconductor Characterization in Electronics Education”, Asian Physics Symposium (APS) 2005 (Bandung, 7-8 December 2005), pp. 168-170.

8. M. M. Munir, A. Suhendi, and Khairurrijal, “A Wide Range Logarithmic Electrometer for Characterizing MOS Capacitors with Nanometer-Thick Oxides”, International Conference on Instrumentation, Communication, and Information Technology (ICICI) 2005 (Bandung, 3-5 August 2005), pp.363-365.

62

9. M.M. Munir, A. Suhendi, dan Khairurrijal, “Simulator MCS-51 V9.0 Papan Tunggal: Perangkat Keras Penunjang Pembelajaran Sistem Instrumentasi Berbasis Mikrokontroler (Single Board V9.0 MCS-51 Simulator: Hardware for Learning Microcontroller-Based Instrumentation System)”, Prosiding Seminar Instrumentasi Berbasis Fisika II (Bandung, 22-23 Juli 2004), pp. 130-133. (in Indonesian)

10. Khairurrijal, Mikrajuddin Abdullah, Asep Suhendi, Muhammad M. Munir, and Arif Surachman, “A Simple Microcontroller-Based Current Electrometer Made from LOG112 and C8051F006 for Measuring Current in Metal-Oxide-Semiconductor Devices”, accepted for publication in Measurement Science and Technology 2007

11. Khairurrijal, Muhammad Miftahul Munir, Asep Suhendi, Hendrayana Thaha, and Maman Budiman, “An AT89S52 Microcontroller-Based Single Board Computer for Teaching an Instrumentation System Course”, accepted for publication in Computer Applications in Engineering Education 2007.

12. I. Chandra, M.M. Munir, A. Suhendi, M. Abdullah, and Khairurrijal, “Water Quality Monitoring System with Telemetry over GSM”, Environmental Technology and Management Conference 2006 (Bandung, 7-8 September 2006), pp. WR-O-05-1 - WR-O-05-5.

13. A. Surachman, M.M. Munir, A. Suhendi, dan Khairurrijal, “Sistem Telemetri Radio untuk Pengajaran Sistem Instrumentasi Nirkabel (Radio Telemetry System for Teaching Wireless Instrumentation System), Prosiding Seminar Instrumentasi Berbasis Fisika (Bandung, 31 Agustus 2006), pp. 206-209. (in Indonesian)

14. Khairurrijal, M.M. Munir, A. Suhendi, and Mikrajuddin, “Meter I-V (Arus-Tegangan) untuk Karakterisasi Devais Dioda MOS (Metal-Oksida-Semikonduktor) dengan Oksida Berketebalan Nanometer (An I-V Meter for Characterization of MOS Diodes with Nanometer-Thick Oxides)”, Proceedings of 3rd Kentingan Physics Forum (Solo, 24 September 2005), pp. 50-52 (in Indonesian)

15. Khairurrijal, Mikrajuddin Abdullah, Muhammad M. Munir, Asep Suhendi, and Arif Surachman, “Home-Made Electronic Components Characterization System for Electronics Course at Undergraduate Level”, The 5th WSEAS International Conference on Education and Educational Technology (EDU’06) (Tenerife, Canary Islands, Spain, 16-18 December 2006), pp.176-178.

16. Khairurrijal, Mikrajuddin Abdullah, Muhammad M. Munir, Arif Surachman, and Asep Suhendi, “Low Cost and User-friendly Electronic Components Characterization System for Undergraduate Students”, WSEAS Transactions on Advances in Engineering Education, Vol. 3, No. 11 (November 2006), pp. 971-976.

63

Lampiran 2 Program pada SoC C8051F350 //----------------------------------------------------------------------------- // MainSystem.c //----------------------------------------------------------------------------- // Copyright 2007 Elkahfi // // AUTH: Asep Suhendi // DATE: Aug , 2007 // Start: Sept 11th, 2007 // Edit: Sept 12th, 2007 // Last: Feb 3rd 2008 // This program designed for C-V Measurements // // Target: C8051F350 // // Tool chain: KEIL Eval 'c' // //----------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------- #include <c8051f350.h> // SFR declarations #include <stdio.h> //----------------------------------------------------------------------------- // 16-bit SFR Definitions for 'F35x //----------------------------------------------------------------------------- sfr16 TMR2RL = 0xca; // Timer2 reload value sfr16 TMR2 = 0xcc; // Timer2 counter //----------------------------------------------------------------------------- // Global CONSTANTS //----------------------------------------------------------------------------- sbit S_On = P1^5; // S_On ='0' means Vout activated sbit Res = P1^4; // Res = '0' means Cf Cleared sbit Sel = P1^3; // Sel='0'means Cf =110 pF sbit StepC = P1^2; // StepCBA : sbit StepB = P1^1; // 000: 10 mV sbit StepA = P1^0; // 001: 20 mV // 010: 50 mV // 011: 100 mV // 100: 3300 mV sbit LED = P0^7; // LED='1' means ON sbit LED1 = P0^6; // LED='1' means ON float BufCal [0x10]; char BufRx [0x20]; unsigned char StrBuf [0x10]; unsigned char xdata ADCHi[0x7f], ADCLo[0x7f]; bit bdata StartPFlag,FinishPFlag,OnPacket; bit bdata Timer2Flag, CollectData; char idata Str_[18]; unsigned char idata ADCBuf[3]; unsigned int BufRx_n; unsigned char DataCount, TimeCount,TimeCount1, LoopCount;

64

//----------------------------------------------------------------------------- // Function PROTOTYPES //----------------------------------------------------------------------------- void CekPaketData(); void ADC_Init(); void Port_IO_Init(); void Timer2_Init (int counts); void Timer2_ISR (void); void Oscillator_Init(); void Interrupts_Init(void); void Init_Device(void); void SendChar(unsigned char TxChar); void SendStr(unsigned char *Buffer); void Interrupts_Init(void); void Init_System(void); //----------------------------------------------------------------------------- // MAIN Routine //----------------------------------------------------------------------------- void main (void) { //unsigned char Temp; // disable watchdog timer PCA0MD &= ~0x40; // WDTE = 0 (clear watchdog timer Init_Device(); Init_System(); sprintf(StrBuf,"C-V Meter Program%c\n",13); SendStr(&StrBuf); sprintf(StrBuf," by assuh102 %c\n",13); SendStr(&StrBuf); CollectData = 0; while (1) { // Bekerja Tanpa Henti if (OnPacket==1){ CekPaketData(); OnPacket=0; } if (Timer2Flag){ Timer2Flag = 0; if (TimeCount < 100) TimeCount++; else { LED = ~LED; // change state of LED LED1 = ~LED// change state of LED TimeCount = 0; } if (CollectData) { TimeCount1++; if (TimeCount1 == 1) { Res = 1; DataCount= 0;} // 0 ms // t = 0 else if (TimeCount1 == 5) { // tA =20 ms //t = 2xdelay ADCLo[2] = ADC0M; //Q1 ADCHi[2] = ADC0H; } else if (TimeCount1 == 10){ // t1 = 40 ms t = 9xdelay P1 |= 0x07; P1 &= 0xf9; // Step 20 mV } else if (TimeCount1 == 100){ // tB=80ms t = 89xdelay ADCLo[3] = ADC0M; //Q2 ADCHi[3] = ADC0H;

65

} else if (TimeCount1 == 125){ // t0=150ms 99xdelay ADCLo[4] = ADC0M; //Q3 ADCHi[4] = ADC0H; } else if (TimeCount1 == 130){ // t = 2xdelay TimeCount1 = 0; Res = 1; P1 |= 0x07; CollectData = 0; Res = 0; sprintf(StrBuf, "Selesai%c\n", 13); SendStr(&StrBuf); } }/**/ } } } //------------------------------------------------------------------------------------ // Check Paket Data routine //------------------------------------------------------------------------------------ void CekPaketData(){ bit FlagError; unsigned int temp, Loop; unsigned int DATA_AD; unsigned char DATA_ADM; //---------------------------------------------------------------------------------------- FlagError=0; //======================================= // DAC0 (dec) // format LD0=xxxx // keluaran IDAC0 untuk mendapatkan tegangan positif // xxx = data IDAC (dec) 000-255 decimal // x = Skala Penuh IDAC //======================================= if ((BufRx[0]=='D')&&(BufRx[1]=='0')){ if ((BufRx[2]=='=')){ temp = 100*(BufRx[3]-48)+10*(BufRx[4]-48)+(BufRx[5]-48); IDA0 = temp; switch (BufRx[6]) { case '0': {IDA0CN = 0xF0; break;} case '1': {IDA0CN = 0xF1; break;} case '2': {IDA0CN = 0xF2; break;} case '3': {IDA0CN = 0xF3; break;} default: break; } sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= // DAC1 (dec) // format LD1=xxx // keluaran IDAC1 untuk mendapatkan tegangan positif // xxx = data IDAC (dec) 000-255 decimal //======================================= else if ((BufRx[0]=='D')&&(BufRx[1]=='1')){ if ((BufRx[2]=='=')){ temp = 100*(BufRx[3]-48)+10*(BufRx[4]-48)+(BufRx[5]-48); IDA1 = temp;

66

switch (BufRx[6]) { case '0': {IDA0CN = 0xF0; break;} case '1': {IDA0CN = 0xF1; break;} case '2': {IDA0CN = 0xF2; break;} case '3': {IDA0CN = 0xF3; break;} default: break; } sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= else if ((BufRx[0]=='C')&&(BufRx[1]=='1')){ if ((BufRx[2]=='=')){ CollectData = 1; DataCount = 0; Res = 1; sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= else if ((BufRx[0]=='C')&&(BufRx[1]=='F')){ if ((BufRx[2]=='=')){ for (Loop=2;Loop<5;Loop++){

sprintf(StrBuf, "ADC0 = %2.2bX:%2.2bX:%2.2bX %c\n",ADCHi[Loop],ADCLo[Loop],ADC0L,13);

SendStr(&StrBuf); } }else{FlagError=1;} } //======================================= // Volt Step // format LVS=x // Memilih keluaran tegangan step // x = masukan untuk multiplekser pemilih step //======================================= else if ((BufRx[0]=='V')&&(BufRx[1]=='S')){ if ((BufRx[2]=='=')){ P1 |= 0x07; if (BufRx[3]=='1') P1 &= 0xf8; // Step 10 mV else if (BufRx[3]=='2') P1 &= 0xf9;// Step 20mV else if (BufRx[3]=='3') P1 &= 0xfA;// Step 50mV else if (BufRx[3]=='4') P1 &= 0xfB;//Step 100mV sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= // Volt Out // format LVO=x // Mengatur kondisi tegangan keluaran // x = 0 Tegangan Keluaran terputus // x = 1 Tegangan Keluaran terhubung //======================================= else if ((BufRx[0]=='V')&&(BufRx[1]=='O')){ if ((BufRx[2]=='=')){ if (BufRx[3] == '1') S_On = 0; else if (BufRx[3] == '0') S_On = 1;

67

sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= // Cf Clear // format LCC=x // Mengatur kondisi Saklar Cf // x = 0 Cf = Terbuka // x = 1 Cf = Clear //======================================= else if ((BufRx[0]=='C')&&(BufRx[1]=='C')){ if ((BufRx[2]=='=')){ if (BufRx[3] == '1') Res = 0; else if (BufRx[3] == '0') Res = 1; sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= // Cf Tambah // format LCT=x // Mengatur kondisi Saklar Cf // x = 0 Cf = 10 pF // x = 1 Cf = 110 pF //======================================= else if ((BufRx[0]=='C')&&(BufRx[1]=='T')){ if ((BufRx[2]=='=')){ if (BufRx[3] == '1') Sel = 0; else if (BufRx[3] == '0') Sel = 1; sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); }else{FlagError=1;} } //======================================= // Test CV // Permintaan Nilai Pembacaan ADC // format LAD //======================================= else if ((BufRx[0]=='C')&&(BufRx[1]=='V')){ if ((BufRx[2]=='=')){ sprintf(StrBuf, "OK%c\n", 13); SendStr(&StrBuf); } } /**/ //======================================= // ADC1 // Permintaan Nilai Pembacaan ADC // format LAD //======================================= else if ((BufRx[0]=='A')&&(BufRx[1]=='D')){ DATA_AD = 0; for (Loop=0;Loop<64;Loop++){ DATA_AD += ADC0M; } DATA_ADM = DATA_AD >> 6;

68

if (BufRx[3] == '1') sprintf(StrBuf, "A1 = %2.2bX:%2.2bX:%2.2bX %c\n",ADC0H,DATA_ADM,ADC0L,13); if (BufRx[3] == '2') sprintf(StrBuf, "A2 = %2.2bX:%2.2bX:%2.2bX %c\n",ADC0H,DATA_ADM,ADC0L,13); if (BufRx[3] == '3') sprintf(StrBuf, "A3 = %2.2bX:%2.2bX:%2.2bX %c\n",ADC0H,DATA_ADM,ADC0L,13); SendStr(&StrBuf); } //======================================= else{FlagError=1;} if (FlagError==1){ sprintf(StrBuf, "Command Error!!!%c\n",13); SendStr(&StrBuf); sprintf(StrBuf, "Please Try Again!%c\n",13); SendStr(&StrBuf); } } //------------------------------------------------------------------------------------ // ISR serial routine //------------------------------------------------------------------------------------ void Serial_ISR (void) interrupt 4 { unsigned char BufferM; if ((RI0==1)&&(OnPacket==0)) { RI0 = 0; BufferM=SBUF0; //Kirim(BufferM); ///jika dikehendaki perontah dikirm kembali if (StartPFlag==0){ if (BufferM =='L') { StartPFlag=1; BufRx_n=0; } } else{ if (FinishPFlag==0){ if (BufferM ==13){ FinishPFlag=1; } else { BufRx[BufRx_n]=BufferM; BufRx_n += 1; if (BufRx_n>0x200) { FinishPFlag=1; } } if (BufferM =='L') { //antisipasi ada 2/lebih start StartPFlag=1; BufRx_n=0; } if (FinishPFlag==1){ ///disini diisi program reaksi selanjutnya //////------mulai tulis isi reaksi---------------------- BufRx[BufRx_n]=0; OnPacket=1; BufRx_n=0; //kedaan awal siap terima paket

69

StartPFlag=0; //kedaan awal siap terima paket FinishPFlag=0; //kedaan awal siap terima paket } } } } } void SendStr(unsigned char *Buffer){ unsigned int i; i=0; while (Buffer[i]!=0) { SendChar(Buffer[i]); if (i>255) {Buffer[i]=0;} i+=1; } } void SendChar(unsigned char TxChar){ SBUF0 = TxChar; while (TI0==0); TI0 = 0; } //----------------------------------------------------------------------------- // Inits //----------------------------------------------------------------------------- void Timer_Init() { TCON = 0x40; TMOD = 0x20; CKCON = 0x08; TH1 = 0x26; } void UART_Init() { SCON0 = 0x10; } void ADC_Init() { ADC0CN = 0x00; ADC0CF = 0x10; // Fast Filter // ADC0MD = 0x82; // ADC0 Enable Single Connversion ADC0MD = 0x83; // ADC0 Enable Continuous Connversion ADC0CLK = 0x09; ADC0DECH = 0x00; //Decimation Ratio = 192 = 10 ms wordrate // ADC0DECL = 0xBF; // 99 Hz = 10 ms ADC0DECL = 0x17; // 99 Hz = 1.254 ms ADC0MUX = 0x08; // Input + = AIN0.0; - = AGND } void DAC_Init() { IDA0CN = 0xF0; IDA1CN = 0xF0;

70

} void Voltage_Reference_Init() { REF0CN = 0x03; } void Port_IO_Init() { // P0.0 - SCK (SPI0), Open-Drain, Digital // P0.1 - MISO (SPI0), Open-Drain, Digital // P0.2 - MOSI (SPI0), Open-Drain, Digital // P0.3 - NSS (SPI0), Open-Drain, Digital // P0.4 - TX0 (UART0), Open-Drain, Digital // P0.5 - RX0 (UART0), Open-Drain, Digital // P0.6 - SDA (SMBus), Open-Drain, Digital // P0.7 - SCL (SMBus), Open-Drain, Digital // P1.0 - Unassigned, Push-Pull, Digital // P1.1 - Unassigned, Push-Pull, Digital // P1.2 - Unassigned, Push-Pull, Digital // P1.3 - Unassigned, Open-Drain, Digital // P1.4 - Unassigned, Open-Drain, Digital // P1.5 - Unassigned, Open-Drain, Digital // P1.6 - Skipped, Open-Drain, Digital // P1.7 - Skipped, Open-Drain, Digital P0MDOUT = 0xC0; P1MDOUT = 0x07; P1SKIP = 0xC0; XBR0 = 0x05; XBR1 = 0x40; } void Oscillator_Init() { OSCICN = 0x83; } void Interrupts_Init() { IE |= 0x90; } // Initialization function for device, // Call Init_Device() from your main program void Init_Device(void) { Timer_Init(); // Timer2_Init (0x27e0); //5ms Timer2_Init (0x4fc0); //10ms // Timer2_Init (0x9f81); //20ms // Timer2_Init (0xef42); //20ms UART_Init(); ADC_Init(); DAC_Init(); Voltage_Reference_Init(); Port_IO_Init();

71

Oscillator_Init(); Interrupts_Init(); } void Init_System(void){ IDA0 = 0; // DAC0 = 0 IDA1 = 0; // DAC1 = 0 P1 |= 0x07; // VStep = 0 mV S_On = 1; // Keluaran terputus Res = 0; // Cf di reset (S = on) Sel = 1; // Cf = 10 pF } //----------------------------------------------------------------------------- // Timer2_Init //----------------------------------------------------------------------------- // // Configure Timer2 to 16-bit auto-reload and generate an interrupt at // interval specified by <counts> using SYSCLK/48 as its time base. // void Timer2_Init (int counts) { TMR2CN = 0x00; // Stop Timer2; Clear TF2; // use SYSCLK/12 as timebase CKCON &= ~0x60; // Timer2 clocked based on T2XCLK; TMR2RL = -counts; // Init reload values TMR2 = 0xffff; // set to reload immediately ET2 = 1; // enable Timer2 interrupts TR2 = 1; // start Timer2 } //----------------------------------------------------------------------------- // Interrupt Service Routines //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // Timer2_ISR //----------------------------------------------------------------------------- // This routine changes the state of the LED whenever Timer2 overflows. // void Timer2_ISR (void) interrupt 5 { TF2H = 0; // clear Timer2 interrupt flag Timer2Flag = 1; }

72

Lampiran 3 Program pada komputer menggunakan Delphi 7 unit IEEEUni; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, TeEngine, Series, TeeProcs, Chart, StdCtrls, ExtCtrls, Menus, OleServer, ComObj, CPort, ComCtrls; type Str2 = String[2]; TForm1 = class(TForm) Panel3: TPanel; Panel2: TPanel; Panel4: TPanel; Button4: TButton; CheckBox4: TCheckBox; Button2: TButton; ComboBox7: TComboBox; ColorBox1: TColorBox; StaticText1: TStaticText; Edit10: TEdit; StaticText3: TStaticText; Panel1: TPanel; Label3: TLabel; Chart1: TChart; Series1: TLineSeries; Series2: TLineSeries; Series3: TLineSeries; Series4: TLineSeries; Series5: TLineSeries; Button1: TButton; Button5: TButton; ComboBox1: TComboBox; ComboBox2: TComboBox; ComboBox3: TComboBox; ComboBox4: TComboBox; ComboBox5: TComboBox; Panel5: TPanel; StaticText4: TStaticText; Edit1: TEdit; ComboBox6: TComboBox; Panel6: TPanel; StaticText5: TStaticText; Edit2: TEdit; ComboBox8: TComboBox; StaticText6: TStaticText; StaticText7: TStaticText; StaticText8: TStaticText; Edit3: TEdit; ComboBox9: TComboBox; GroupBox1: TGroupBox; Timer1: TTimer;

73

Panel7: TPanel; Panel8: TPanel; StaticText13: TStaticText; Edit9: TEdit; ComboBox10: TComboBox; StaticText2: TStaticText; CheckBox1: TCheckBox; StaticText9: TStaticText; Button3: TButton; StaticText10: TStaticText; Edit8: TEdit; StaticText11: TStaticText; Timer2: TTimer; Label5: TLabel; Label1: TLabel; Label2: TLabel; Label4: TLabel; ComPort1: TComPort; ComDataPacket1: TComDataPacket; StatusBar1: TStatusBar; StaticText12: TStaticText; ComboBox12: TComboBox; Timer3: TTimer; Button6: TButton; CheckBox2: TCheckBox; Timer4: TTimer; procedure Button1Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure Button4Click(Sender: TObject); procedure CheckBox4Click(Sender: TObject); procedure ComboBox7Change(Sender: TObject); procedure ComboBox1Change(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Button5Click(Sender: TObject); procedure ComboBox5Change(Sender: TObject); procedure ComboBox4Change(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure ComboBox3Change(Sender: TObject); procedure ComboBox2Change(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Timer2Timer(Sender: TObject); procedure Button3Click(Sender: TObject); procedure FormResize(Sender: TObject); procedure ComDataPacket1Packet(Sender: TObject; const Str: String); Function Hex2Char(HexIn : Byte):Str2; Function Char2hex(CharIn : Str2):Byte; procedure Ukur(Sender: TObject); procedure KirimV(Voltage: String); procedure Timer3Timer(Sender: TObject); procedure Button6Click(Sender: TObject); procedure CheckBox2Click(Sender: TObject); procedure Timer4Timer(Sender: TObject); private { Private declarations } public { Public declarations } end;

74

const k617 = 26; Cf = 1.1E-10; //Cf = 110 pF Tnol = 0.1; Tsatu =0.05; Vstep =0.02; Tdelay =1.5; var Form1: TForm1; StatusConnect : Boolean; DataX1, DataY1 : Array [1..1000] of Real; Statusnya, CountY1: Integer; fa, g : variant; Delta1: Real; Proses : byte; pos_1 : integer; Panjang : word; pos1 : byte; DataBil, Bias : Real; DataString, RealData : String; StopMeasure, Wait4Ack, VoNegatif : Boolean; NextCommand : String; DataADC, DataDAC : longint; DataVADC, DataVDAC : Real; CountADC:byte; DataADC123 : Array [1..3] of Real; DataC:Integer; SumbuX, Cx, QperT :Real; implementation {$R *.dfm} //uses IEEEDel; procedure TForm1.Button1Click(Sender: TObject); //var Counteri : Integer; begin { With Chart1 do Case ComboBox7.ItemIndex of 0: For Counteri := 1 to 10 do Series1.AddXY(DataX1[Counteri],DataY1[Counteri]); 1: For Counteri := 1 to 10 do Series2.AddXY(DataX2[Counteri],DataY2[Counteri]); 2: For Counteri := 1 to 10 do Series3.AddXY(DataX3[Counteri],DataY3[Counteri]); 3: For Counteri := 1 to 10 do Series4.AddXY(DataX4[Counteri],DataY4[Counteri]); 4: For Counteri := 1 to 10 do Series5.AddXY(DataX5[Counteri],DataY5[Counteri]); end; } end; procedure TForm1.FormCreate(Sender: TObject); var //Counteri : Integer; Pesan : String; begin ComDataPacket1.StopString := #13+#10; Panel7.Left := Panel3.Width - 170; { For Counteri := 1 to 1000 do begin DataX1[Counteri] := Counteri; DataX2[Counteri] := Counteri; DataX3[Counteri] := Counteri; DataX4[Counteri] := Counteri; DataX5[Counteri] := Counteri; DataY1[Counteri] := Counteri*2+3;

75

DataY2[Counteri] := Counteri*3-5; DataY3[Counteri] := Counteri*2+5; DataY4[Counteri] := Counteri/2-5; DataY5[Counteri] := Counteri*2+8; end; } Panel8.Caption := DateToStr(Now); StaticText2.Caption := TimetoStr(Now); Statusnya := 08; Pesan := ''; if (Statusnya and $0ff) = 0 then begin Pesan := 'Keithley 617 connected'; StatusConnect := True; end else begin Pesan := ''; if (Statusnya and $001) = 1 then Pesan := Pesan+' Command not allowed'; if (Statusnya and $002) = 2 then Pesan := Pesan+' Your device is not a talker '; if (Statusnya and $004) = 4 then Pesan := Pesan+' There is an end in data'; if (Statusnya and $008) = 8 then Pesan := Pesan+' Time Out / No listener '; if (Statusnya and $010) = 16 then Pesan := Pesan+' Command unknown'; StatusConnect := False; end; end; procedure TForm1.Button4Click(Sender: TObject); var CountR:integer; begin Chart1.Series[0].Clear; For CountR := 1 to 1000 do begin DataX1[CountR] := 0; DataY1[CountR] := 0; end; CountY1:=1; end; procedure TForm1.CheckBox4Click(Sender: TObject); begin with chart1 do if CheckBox4.Checked then begin series1.LinePen.Visible := True; series1.Pointer.Visible := True; series2.LinePen.Visible := True; series2.Pointer.Visible := True; series3.LinePen.Visible := True; series3.Pointer.Visible := True; series4.LinePen.Visible := True; series4.Pointer.Visible := True; series5.LinePen.Visible := True; series5.Pointer.Visible := True; end else begin series1.LinePen.Visible := False; series1.Pointer.Visible := False; series2.LinePen.Visible := False; series2.Pointer.Visible := False; series3.LinePen.Visible := False; series3.Pointer.Visible := False; series4.LinePen.Visible := False;

76

series4.Pointer.Visible := False; series5.LinePen.Visible := False; series5.Pointer.Visible := False; end; end; procedure TForm1.ComboBox7Change(Sender: TObject); begin With Chart1 do Edit10.Text := Series[ComboBox7.ItemIndex].Title; end; procedure TForm1.Timer1Timer(Sender: TObject); begin Panel7.Caption := TimetoStr(Now); end; procedure TForm1.Button5Click(Sender: TObject); begin if Comport1.Connected then begin if Button5.Caption <> 'Mulai' then begin StopMeasure:= True; Button5.Caption := 'Mulai'; CountADC := 1; Sumbux := 0; end else begin CountY1 := 1; With Chart1 do begin BottomAxis.Automatic := False; BottomAxis.Maximum := 20; BottomAxis.Minimum := StrtoFloat(Edit2.Text); BottomAxis.Maximum := 1.5*StrtoFloat(Edit9.Text); BottomAxis.Increment := StrtoFloat(Edit3.Text); end; Ukur(Sender); Button5.Caption := 'Berhenti'; end; end else MessageDlg('Port belum dibuka!', mtInformation, [mbOk],0); end; procedure TForm1.ComboBox5Change(Sender: TObject); begin Chart1.LeftAxis.Title.Caption := Label4.Caption +' ( '+ ComboBox5.Text +' )'; end; procedure TForm1.ComboBox4Change(Sender: TObject); begin Chart1.BottomAxis.Title.Caption := Label5.Caption +' ( '+ ComboBox4.Text +' )'; end; procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin Comport1.Connected := False;

77

end; procedure TForm1.ComboBox3Change(Sender: TObject); begin if ComboBox3.ItemIndex = 1 then Chart1.LeftAxis.Logarithmic := True else Chart1.LeftAxis.Logarithmic := False; end; procedure TForm1.ComboBox2Change(Sender: TObject); begin if ComboBox2.ItemIndex = 1 then Chart1.BottomAxis.Logarithmic := True else Chart1.BottomAxis.Logarithmic := False; end; procedure TForm1.Button2Click(Sender: TObject); var i : integer; begin fa := createoleobject('Excel.application'); fa.visible:=true; fa.workbooks.add; fa.workbooks[1].worksheets[1].name:='DataIV'; g:=fa.workbooks[1].worksheets['DataIV']; g.cells[1,1]:= Edit10.Text; g.cells[3,1]:='Tegangan'; g.cells[3,2]:='Arus'; For i := 1 to CountY1-1 do begin g.cells[3+i, 1] := DataX1[i]; g.cells[3+i, 2] := DataY1[i]; end; end; procedure TForm1.Timer2Timer(Sender: TObject); var temp : Real; begin pos_1:=pos('DCA',RealData); if Pos_1 <> 0 then begin DataString := copy(RealData,pos_1+3,12); temp := Bias; if temp < 2 then DataX1[CountY1] := Bias*1.0055+0.0278 else DataX1[CountY1] := Bias*1.0051+0.0284; temp := StrtoFloat(DataString); if temp < 2e-9 then DataY1[CountY1] := temp*1.0027-6E-11 else if temp < 2e-8 then DataY1[CountY1] := temp*1.0065-7E-11 else if temp < 2e-7 then DataY1[CountY1] := temp*1.0039-2E-10 else if temp < 2e-6 then DataY1[CountY1] := temp*0.9962-2E-9 else if temp < 1e-5 then DataY1[CountY1] := temp*0.9972-3E-10 else if temp < 2e-5 then DataY1[CountY1] := temp*1.0009-9E-9 else if temp < 2e-4 then DataY1[CountY1] := temp*1.0011-3E-9 else if temp < 2e-3 then DataY1[CountY1] := temp*1.0003-1E-5 else if temp < 2e-2 then DataY1[CountY1] := temp*1.0006-1E-5; Edit1.Text := DataString; Bias:=Bias+ StrtoFloat(Edit3.Text);

78

With Chart1 do Series1.AddXY(DataX1[CountY1], DataY1[CountY1]); inc(CountY1); end; Edit2.Text := FloattoStr(Bias); if StrtoFloat(Edit3.Text) > 0 then begin if Bias > StrtoFloat(Edit9.Text) then begin Proses := 0; Timer2.Enabled := False; Button5.Caption := 'Mulai'; end; end else begin if Bias < StrtoFloat(Edit9.Text) then begin Proses := 0; Timer2.Enabled := False; Button5.Caption := 'Mulai'; end; end; end; procedure TForm1.FormResize(Sender: TObject); begin Panel7.Left := Panel3.Width - 170; end; procedure TForm1.ComDataPacket1Packet(Sender: TObject; const Str: String); var StrHex: ShortString; Char2 : Str2; OrdTemp, iLoop, pos0: byte; begin StatusBar1.Panels[0].Text := str; // Memo2.Lines.Add(str); if Wait4Ack then if (str = 'OK') then begin Wait4Ack := False; end; if Str[1] = 'A' then begin StrHex:= ''; For iLoop := 1 to Length(Str) do begin OrdTemp := Ord(Str[iLoop]); StrHex := StrHex + Hex2Char(OrdTemp) + ' '; end; pos0 := pos('=', Str); Char2 := copy(str,pos0+2,2); DataADC := Char2Hex(Char2)*256; Char2 := copy(str,pos0+5,2); DataADC := DataADC+Char2Hex(Char2); DataADC := DataADC SHR 4; { if VoNegatif then begin if DataADC < 10100 then DataVADC := DataADC*0.19878 - 0.35361

79

else DataVADC := DataADC*0.201171 - 37.380121; DataVADC:=-DataVADC; end else begin if DataADC < 250 then DataVADC := DataADC*0.19808 - 0.24662 else if DataADC < 500 then DataVADC := DataADC*0.19768 - 0.08554 else if DataADC < 1000 then DataVADC := DataADC*0.197784 - 0.190675 else if DataADC < 2000 then DataVADC := DataADC*0.197809 - 0.308820 else DataVADC := DataADC*0.196999 - 0.957792; end; } DataVADC := DataADC*0.00025*2000/(4095); if str[2] = '1' then DataADC123[1] := DataVADC; if str[2] = '2' then DataADC123[2] := DataVADC; if str[2] = '3' then begin CountADC :=1; DataADC123[3] := DataVADC; DataADC123[1] := DataADC123[1] * Cf; //Q1 DataADC123[2] := DataADC123[2] * Cf; //Q2 DataADC123[3] := DataADC123[3] * Cf; //Q3 //Perhitungan Nilai C //=================== QperT := (DataADC123[3]-DataADC123[2])/Tnol; Cx := (DataADC123[3] - DataADC123[1])/Vstep; DataC := Abs(Round(1E12*(Cx-(QperT*(tdelay+Tsatu)/Vstep)))); with Chart1 do begin if DataC > LeftAxis.Maximum then LeftAxis.Maximum := 1.05* DataC; Series1.AddXY(SumbuX, DataC); DataX1[CountY1]:= SumbuX; DataY1[CountY1]:= DataC; Inc(CountY1); end; SumbuX := SumbuX + StrtoFloat(Edit3.Text); //=================== Edit1.Text := InttoStr(DataC); // Memo2.Lines.Add(Edit3.Text); // Edit4.Text := FloattoStr(DataVADC); { if CheckBox4.Checked then begin Comport1.WriteStr('LAD'+#13); sleep(1); end; } end; end; end; Function TForm1.Hex2Char(HexIn : Byte):Str2; const HexChar : Array [0..15] of char = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); var Nyble : byte; Char2 : Str2;

80

begin Nyble := HexIn div 16; Char2 := HexChar[Nyble]; Nyble := HexIn mod 16; Char2 := Char2 + HexChar[Nyble]; Hex2Char := Char2; end; Function TForm1.Char2hex(CharIn : Str2):Byte; var Nyble, Temp1 : byte; begin Temp1 := Ord(CharIn[1]); if Temp1 < $3A then Temp1 := Temp1 - $30 else // Angka Temp1 := Temp1 - 55; // Huruf Nyble := Temp1 * 16; Temp1 := Ord(CharIn[2]); if Temp1 < $3A then Temp1 := Temp1 - $30 else // Angka Temp1 := Temp1 - 55; // Huruf Nyble := Nyble + Temp1; Char2Hex := Nyble; end; procedure TForm1.Ukur(Sender: TObject); begin if Comport1.Connected then begin KirimV(Edit2.Text); sleep(5); // CheckBox3.Checked := false; Comport1.WriteStr('LCC=0'+#13+#10); //SW Open sleep(50); Comport1.WriteStr('LCT=1'+#13+#10); //Range 110pF sleep(5); // CheckBox3.Checked := True; Comport1.WriteStr('LCC=1'+#13+#10); //SW Close sleep(700); // CheckBox6.Checked := True; Comport1.WriteStr('LVO=1'+#13+#10); //Vout = on sleep(5); // CheckBox3.Checked := False; //buka SW1 Comport1.WriteStr('LCC=0'+#13+#10); // SW1 Open sleep(50); // Button4Click(Sender); //Q1 CountADC :=1; Comport1.WriteStr('LAD=1'+#13); sleep(50); //delay(t1) Comport1.WriteStr('LVS='+inttostr(ComboBox12.ItemIndex)+#13+#10); sleep(5); Timer3.Interval := Round(1000*StrtoFloat(Edit8.Text)); //delay Timer3.Enabled := True; end else MessageDlg('Port belum dibuka!', mtInformation, [mbOk],0); end; procedure TForm1.KirimV(Voltage: String); var VDAC0, VDAC1 : integer; VDAC : Real;

81

begin VDAC := 1000*StrtoFloat(Voltage)-200; // VDAC := StrtoFloat(Voltage); ///Tambahan *** if VDAC < 2 then begin Comport1.WriteStr('LD0=000'+#13+#10); // Memo1.Lines.Add('LD0=000'); Wait4Ack := True; VDAC1 := Round(VDAC* -0.1011 + 6.0308); sleep(5); Comport1.WriteStr('LD1='+ Format('%3.3d',[VDAC1])+ #13+#10); NextCommand := 'LD1='+ Format('%3.3d',[VDAC1]); end else begin Comport1.WriteStr('LD1=006'+#13+#10); // Memo1.Lines.Add('LD1=006'); Wait4Ack := True; if VDAC < 250 then VDAC0 := Round(VDAC*0.0975 - 0.1234) else if VDAC < 1000 then VDAC0 := Round(VDAC*0.0972 + 0.0561) else VDAC0 := Round(VDAC*0.099 - 2.8373); sleep(5); Comport1.WriteStr('LD0='+ Format('%3.3d',[VDAC0])+ #13+#10); NextCommand := 'LD0='+ Format('%3.3d',[VDAC0]); end; end; procedure TForm1.Timer3Timer(Sender: TObject); begin Timer3.Enabled := False; // Button4Click(sender); //Q2 CountADC :=2; Comport1.WriteStr('LAD=2'+#13); sleep(5); sleep(100); //delay(t0) // Button4click(Sender); //Q3 CountADC :=3; Comport1.WriteStr('LAD=3'+#13); sleep(50); //delay(t1) ComboBox12.ItemIndex := 7; // Button3Click(sender); //Q3 Comport1.WriteStr('LVS='+inttostr(ComboBox12.ItemIndex)+#13+#10); sleep(5); // CheckBox3.Checked :=True; Comport1.WriteStr('LCC=1'+#13+#10); Timer4.Enabled := True; end; procedure TForm1.Button6Click(Sender: TObject); begin Comport1.ShowSetupDialog; end; procedure TForm1.CheckBox2Click(Sender: TObject); begin if CheckBox2.Checked then Comport1.Connected := True

82

else Comport1.Connected := False; end; procedure TForm1.Timer4Timer(Sender: TObject); begin Timer4.Enabled := False; if (Button5.Caption = 'Berhenti') and (StrtoFloat(Edit2.Text)<StrtoFloat(Edit9.Text)) then begin Edit2.Text := FloattoStr(StrtoFloat(Edit3.Text)+StrtoFloat(Edit2.Text)); Ukur(Sender); end else Button5Click(Sender); end; end.