sip proteus

43
tutorial simulasi menggunakan proteus A. CARA PENGOPERASIAN PROTEUS 1. Klik Start Menu è Program è Proteus 7 profesional èIsis 7 profesional. 2. Klik component mode untuk mencari komponen yang dibutuhkan dan kemudian klik button P di sebelah kiri. 3. Apabila langkah dua benar, maka muncul jendela Pick devices seperti dibawah ini : 4. Pilih komponen yang anda butuhkan misalnya resistor 0,6 Watt metal film 100K. maka caranya seperti gambar dibawah ini :

description

tutorial

Transcript of sip proteus

Page 1: sip proteus

tutorial simulasi menggunakan proteus A. CARA PENGOPERASIAN PROTEUS

1. Klik Start Menu è Program è Proteus 7 profesional èIsis 7 profesional.

2. Klik component mode untuk mencari komponen yang dibutuhkan dan kemudian klik button P di sebelah kiri.

3. Apabila langkah dua benar, maka muncul jendela Pick devices seperti dibawah ini :

4. Pilih komponen yang anda butuhkan misalnya resistor 0,6 Watt metal film 100K. maka caranya seperti gambar dibawah ini :

Page 2: sip proteus

Keterangan :

Klik tulisan resistor pada bagian kiri atas è kemudian pilih “0,6 watt metal film” è dan pilih nilai 100K.

5. Pada bagian kiri atas akan muncul daftar komponen baru yang telah dipilih.

6. Klik pada Minres100k lalu place pada form yang tersedia :

Page 3: sip proteus

7. Klik kiri untuk meletekkan komponen :

8. Pilih lagi komponen yang anda butuhkan dan rangkailah sesuai keinginan anda.

9. Apabila anda menggunakan komponen mikrokontroler atau komponen yang memerlukan software untuk menjalankannya maka cara mendownload softwarenya adalah sebagai berikut :

a. Doblle klik komponen mikrokontroller dan akan muncul jendela baru seperti dibawah ini :

Page 4: sip proteus

b. Klik file search pada bagian program file dan kemudian muncul lagi jendela baru seperti dibawah ini :

Page 5: sip proteus

Pilih file.exe yang diinginkan lalu klik open.

c. Komponen sudah selesai di download.

10. Apabila anda ingin membuat PCB dari skema yang ada maka klik toolbar pada bagian kanan atas yang bertuliskan ares.

11. Secara otomatis ares akan terbuka.

12. Letakkan komponen sesuai keinginan anda.

13. Klik autorouter untuk membuat jalur secara otomatis.

Page 7: sip proteus

16. Ulangi lagi sampai hasil routing sesuai dengan yang anda inginkan.

17. Selamat mencoba.

B. FITUR-FITUR DALAM PROTEUS 7 PROFESIONAL

1. Dapat digunakan di windows 2k,windows XP dan windows seven.

2. Routing jalur PCB otomatis dan dot placement / removal.

3. Powerful tool untuk memilih objek dan mengatur propertinya.

4. Total support untuk bus termasuk pin komponen, inter sheet terminal, modul port dan kabel.

5. Bill of Material dan pemeriksa laporan electrical ruler.

Page 8: sip proteus

6. Netlist outputs yang sesuai dengan semua PCB layout tools.

7. Desain hirarkis dengan parameter yang support dengan nilai komponen pada sub circuit.

8. Desain · Global Anotasi memungkinkan beberapa contoh dari rangkaian sub-komponen untuk memiliki referensi yang berbeda.

9. Automatic Anotasi - kemampuan untuk penomoran komponen secara otomatis.

C. TUTORIAL AVR

1. Buka program AVR melalui start menuèall programècodeVisionAvrèCodeVisionAVR – C compiler evaluation.

2. Code vision AVR terbuka

Page 10: sip proteus

6. Klik OK. Settingan Port dapat anda atur pada jendela baru seperti gambar dibawah ini :

7. Apabila anda telah selesai dalam pengaturan PORT,LCD,dsb. Maka klik fileè Generate, save and exit.

Page 11: sip proteus

8. Muncul jendela baru untuk menentukan penamaan dan dimana anda menyimpan file tersebut.

9. Setelah anda menyimpannya, maka tampil script program sesuai dengan yang anda atur pada langkah sebelumnya. Anda tinggal menambah program utama.

Page 12: sip proteus

10. Apabila program utama telah selesai maka anda harus mem-build all untuk mengubahnya menjadi file.exe. caranya tekan ctrl+F9 atau klik projectèbuild all.

11. Tampil notifikasi pada jendela baru.

Page 13: sip proteus

12. Apabila sudah tidak ada error maka anda bisa mendownload program melalui Kazama bila untuk rangkaian yang sebenarnya dan dengan doblle klik pada gambar mikrokontroller apabila anda memakai simulasi menggunakan proteus.

13. Rangkaian siap di uji coba.

D. MEMBUAT RANGKAIAN ADC DENGAN INPUT POTENSIOMETER DENGANAN OUTPUT LCD DAN LED

Page 14: sip proteus

ADC menggunakan fitur pada mikrokontroller ATmega 8535.

Daftar komponen :

Mikrokontroller Atmega 8535 1x

LCD 16x2 1x

Resistor 1K 9x

Capacitor 20pf 2x

Condensator electrolit 100uf 1x

Potensiometer 1K 1x

Potensiometer 100K 1x

Crystal 2MHz 1x

LED 9X

Script program :

/*****************************************************

This program was produced by the

Page 15: sip proteus

CodeWizardAVR V2.04.6 Evaluation

Automatic Program Generator

© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.

http://www.hpinfotech.com

Project :

Version :

Date : 18/06/2011

Author : Freeware, for evaluation and non-commercial use only

Company :

Comments:

Chip type : ATmega8535

Program type : Application

AVR Core Clock frequency: 4,000000 MHz

Memory model : Small

External RAM size : 0

Data Stack size : 128

*****************************************************/

#include <mega8535.h>

#include <delay.h>

// Alphanumeric LCD Module functions

#asm

.equ __lcd_port=0x18 ;PORTB

#endasm

Page 16: sip proteus

#include <lcd.h>

#define ADC_VREF_TYPE 0x60

// Read the 8 most significant bits

// of the AD conversion result

unsigned char read_adc(unsigned char adc_input)

{

ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);

// Delay needed for the stabilization of the ADC input voltage

delay_us(10);

// Start the AD conversion

ADCSRA|=0x40;

// Wait for the AD conversion to complete

while ((ADCSRA & 0x10)==0);

ADCSRA|=0x10;

return ADCH;

}

// Declare your global variables here

void main(void)

{

// Declare your local variables here

unsigned char adcdt;

// LCD module initialization

lcd_init(16);

Page 17: sip proteus

// Input/Output Ports initialization

// Port A initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTA=0x00;

DDRA=0x00;

// Port B initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTB=0x00;

DDRB=0x00;

// Port C initialization

// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out

// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0

PORTC=0x00;

DDRC=0xFF;

// Port D initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTD=0x00;

DDRD=0x00;

// Timer/Counter 0 initialization

// Clock source: System Clock

Page 18: sip proteus

// Clock value: Timer 0 Stopped

// Mode: Normal top=FFh

// OC0 output: Disconnected

TCCR0=0x00;

TCNT0=0x00;

OCR0=0x00;

// Timer/Counter 1 initialization

// Clock source: System Clock

// Clock value: Timer1 Stopped

// Mode: Normal top=FFFFh

// OC1A output: Discon.

// OC1B output: Discon.

// Noise Canceler: Off

// Input Capture on Falling Edge

// Timer1 Overflow Interrupt: Off

// Input Capture Interrupt: Off

// Compare A Match Interrupt: Off

// Compare B Match Interrupt: Off

TCCR1A=0x00;

TCCR1B=0x00;

TCNT1H=0x00;

TCNT1L=0x00;

ICR1H=0x00;

Page 19: sip proteus

ICR1L=0x00;

OCR1AH=0x00;

OCR1AL=0x00;

OCR1BH=0x00;

OCR1BL=0x00;

// Timer/Counter 2 initialization

// Clock source: System Clock

// Clock value: Timer2 Stopped

// Mode: Normal top=FFh

// OC2 output: Disconnected

ASSR=0x00;

TCCR2=0x00;

TCNT2=0x00;

OCR2=0x00;

// External Interrupt(s) initialization

// INT0: Off

// INT1: Off

// INT2: Off

MCUCR=0x00;

MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization

TIMSK=0x00;

// Analog Comparator initialization

Page 20: sip proteus

// Analog Comparator: Off

// Analog Comparator Input Capture by Timer/Counter 1: Off

ACSR=0x80;

SFIOR=0x00;

// ADC initialization

// ADC Clock frequency: 31,250 kHz

// ADC Voltage Reference: AVCC pin

// ADC High Speed Mode: Off

// ADC Auto Trigger Source: Free Running

// Only the 8 most significant bits of

// the AD conversion result are used

ADMUX=ADC_VREF_TYPE & 0xff;

ADCSRA=0xA7;

SFIOR&=0x0F;

// LCD module initialization

lcd_init(16);

while (1)

{

// Place your code here

adcdt=read_adc(0); //mengambil hasil konversi

PORTC=adcdt; //ditampilkan ke LED

lcd_gotoxy(0,0); //menempatkan kursor di baris 0 kolom 0

lcd_putsf("ADC read"); //menampilkan string “ADC read”

Page 21: sip proteus

lcd_gotoxy(0,1); //menempatkan kursor di baris 1 kolom 0

lcd_putsf("Voltage"); //menampilkan string “Voltage”

}

}

E. MEMBUAT RANGKAIAN LCD

Daftar komponen :

Mikrokontroller Atmega 8535 1x

LCD 16x2 1x

Resistor 1K 9x

Capacitor 20pf 2x

Page 22: sip proteus

Condensator electrolit 100uf 1x

Potensiometer 100K 1x

Crystal 2MHz 1x

Script program :

/*****************************************************

This program was produced by the

CodeWizardAVR V2.04.6 Evaluation

Automatic Program Generator

© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.

http://www.hpinfotech.com

Project :

Version :

Date : 19/06/2011

Author : Freeware, for evaluation and non-commercial use only

Company :

Comments:

Chip type : ATmega8535

Program type : Application

AVR Core Clock frequency: 4,000000 MHz

Memory model : Small

External RAM size : 0

Data Stack size : 128

*****************************************************/

Page 23: sip proteus

#include <mega8535.h>

// Alphanumeric LCD Module functions

#asm

.equ __lcd_port=0x18 ;PORTB

#endasm

#include <lcd.h>

// Declare your global variables here

void main(void)

{

// Declare your local variables here

// LCD module initialization

lcd_init(16);

// Input/Output Ports initialization

// Port A initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTA=0x00;

DDRA=0x00;

// Port B initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTB=0x00;

DDRB=0x00;

Page 24: sip proteus

// Port C initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTC=0x00;

DDRC=0x00;

// Port D initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTD=0x00;

DDRD=0x00;

// Timer/Counter 0 initialization

// Clock source: System Clock

// Clock value: Timer 0 Stopped

// Mode: Normal top=FFh

// OC0 output: Disconnected

TCCR0=0x00;

TCNT0=0x00;

OCR0=0x00;

// Timer/Counter 1 initialization

// Clock source: System Clock

// Clock value: Timer1 Stopped

// Mode: Normal top=FFFFh

// OC1A output: Discon.

Page 25: sip proteus

// OC1B output: Discon.

// Noise Canceler: Off

// Input Capture on Falling Edge

// Timer1 Overflow Interrupt: Off

// Input Capture Interrupt: Off

// Compare A Match Interrupt: Off

// Compare B Match Interrupt: Off

TCCR1A=0x00;

TCCR1B=0x00;

TCNT1H=0x00;

TCNT1L=0x00;

ICR1H=0x00;

ICR1L=0x00;

OCR1AH=0x00;

OCR1AL=0x00;

OCR1BH=0x00;

OCR1BL=0x00;

// Timer/Counter 2 initialization

// Clock source: System Clock

// Clock value: Timer2 Stopped

// Mode: Normal top=FFh

// OC2 output: Disconnected

ASSR=0x00;

Page 26: sip proteus

TCCR2=0x00;

TCNT2=0x00;

OCR2=0x00;

// External Interrupt(s) initialization

// INT0: Off

// INT1: Off

// INT2: Off

MCUCR=0x00;

MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization

TIMSK=0x00;

// Analog Comparator initialization

// Analog Comparator: Off

// Analog Comparator Input Capture by Timer/Counter 1: Off

ACSR=0x80;

SFIOR=0x00;

// LCD module initialization

lcd_init(16);

while (1)

{

// Place your code here

lcd_gotoxy(0,0); //menempatkan kursor di baris 0 kolom 0

lcd_putsf("Tugas LCD"); //menampilkan string “tugas LCD”

Page 27: sip proteus

lcd_gotoxy(0,1); //menempatkan kursor di baris 1 kolom 0

lcd_putsf("Bahasa assembler"); //menampilkan string “Bahasa assembler”

}

}

F. MEMBUAT RANGKAIAN LED

Daftar komponen :

Mikrokontroller Atmega 8535 1x

Resistor 1K 9x

Capacitor 20pf 2x

Condensator electrolit 100uf 1x

Potensiometer 100K 1x

Crystal 2MHz 1x

Page 28: sip proteus

Script program :

/*****************************************************

This program was produced by the

CodeWizardAVR V2.04.6 Evaluation

Automatic Program Generator

© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.

http://www.hpinfotech.com

Project :

Version :

Date : 17/06/2011

Author : Freeware, for evaluation and non-commercial use only

Company :

Comments:

Chip type : ATmega8535

Program type : Application

AVR Core Clock frequency: 4,000000 MHz

Memory model : Small

External RAM size : 0

Data Stack size : 128

*****************************************************/

#include <mega8535.h>

#include <delay.h>

// Declare your global variables here

Page 29: sip proteus

void main(void)

{

// Declare your local variables here

// Input/Output Ports initialization

// Port A initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTA=0x00;

DDRA=0x00;

// Port B initialization

// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out

// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0

PORTB=0x00;

DDRB=0xFF;

// Port C initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTC=0x00;

DDRC=0x00;

// Port D initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTD=0x00;

Page 30: sip proteus

DDRD=0x00;

// Timer/Counter 0 initialization

// Clock source: System Clock

// Clock value: Timer 0 Stopped

// Mode: Normal top=FFh

// OC0 output: Disconnected

TCCR0=0x00;

TCNT0=0x00;

OCR0=0x00;

// Timer/Counter 1 initialization

// Clock source: System Clock

// Clock value: Timer1 Stopped

// Mode: Normal top=FFFFh

// OC1A output: Discon.

// OC1B output: Discon.

// Noise Canceler: Off

// Input Capture on Falling Edge

// Timer1 Overflow Interrupt: Off

// Input Capture Interrupt: Off

// Compare A Match Interrupt: Off

// Compare B Match Interrupt: Off

TCCR1A=0x00;

TCCR1B=0x00;

Page 31: sip proteus

TCNT1H=0x00;

TCNT1L=0x00;

ICR1H=0x00;

ICR1L=0x00;

OCR1AH=0x00;

OCR1AL=0x00;

OCR1BH=0x00;

OCR1BL=0x00;

// Timer/Counter 2 initialization

// Clock source: System Clock

// Clock value: Timer2 Stopped

// Mode: Normal top=FFh

// OC2 output: Disconnected

ASSR=0x00;

TCCR2=0x00;

TCNT2=0x00;

OCR2=0x00;

// External Interrupt(s) initialization

// INT0: Off

// INT1: Off

// INT2: Off

MCUCR=0x00;

MCUCSR=0x00;

Page 32: sip proteus

// Timer(s)/Counter(s) Interrupt(s) initialization

TIMSK=0x00;

// Analog Comparator initialization

// Analog Comparator: Off

// Analog Comparator Input Capture by Timer/Counter 1: Off

ACSR=0x80;

SFIOR=0x00;

while (1)

{

// Place your code here

PORTB=0x0f;

delay_ms(500);

PORTB=0xf0;

delay_ms(500);

PORTB=0b10000000;

delay_ms(500);

PORTB=0b01000000;

delay_ms(500);

PORTB=0b00100000;

delay_ms(500);

PORTB=0b00010000;

delay_ms(500);

PORTB=0b00001000;

Page 33: sip proteus

delay_ms(500);

PORTB=0b00000100;

delay_ms(500);

PORTB=0b00000010;

delay_ms(500);

PORTB=0b00000001;

delay_ms(500);

PORTB=0b00000001;

delay_ms(500);

PORTB=0b00000010;

delay_ms(500);

PORTB=0b00000100;

delay_ms(500);

PORTB=0b00001000;

delay_ms(500);

PORTB=0b00010000;

delay_ms(500);

PORTB=0b00100000;

delay_ms(500);

PORTB=0b01000000;

delay_ms(500);

PORTB=0b10000000;

delay_ms(500);

Page 34: sip proteus

}

}

G. MEMBUAT RANGKAIAN SEVEN SEGMENT

Daftar komponen :

Mikrokontroller Atmega 8535 1x

Resistor 1K 1x

Capacitor 20pf 2x

Condensator electrolit 100uf 1x

Potensiometer 100K 1x

Crystal 2MHz 1x

Seven segment common cathode 1x

Script program :

/*****************************************************

This program was produced by the

Page 35: sip proteus

CodeWizardAVR V2.04.6 Evaluation

Automatic Program Generator

© Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.

http://www.hpinfotech.com

Project :

Version :

Date : 04/07/2011

Author : Freeware, for evaluation and non-commercial use only

Company :

Comments:

Chip type : ATmega8535

Program type : Application

AVR Core Clock frequency: 4,000000 MHz

Memory model : Small

External RAM size : 0

Data Stack size : 128

*****************************************************/

#include <mega8535.h>

#include <delay.h>

// Declare your global variables here

void main(void)

{

// Declare your local variables here

Page 36: sip proteus

// Input/Output Ports initialization

// Port A initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTA=0x00;

DDRA=0x00;

// Port B initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTB=0x00;

DDRB=0x00;

// Port C initialization

// Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out

// State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0

PORTC=0x00;

DDRC=0xFF;

// Port D initialization

// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In

// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T

PORTD=0x00;

DDRD=0x00;

// Timer/Counter 0 initialization

// Clock source: System Clock

Page 37: sip proteus

// Clock value: Timer 0 Stopped

// Mode: Normal top=FFh

// OC0 output: Disconnected

TCCR0=0x00;

TCNT0=0x00;

OCR0=0x00;

// Timer/Counter 1 initialization

// Clock source: System Clock

// Clock value: Timer1 Stopped

// Mode: Normal top=FFFFh

// OC1A output: Discon.

// OC1B output: Discon.

// Noise Canceler: Off

// Input Capture on Falling Edge

// Timer1 Overflow Interrupt: Off

// Input Capture Interrupt: Off

// Compare A Match Interrupt: Off

// Compare B Match Interrupt: Off

TCCR1A=0x00;

TCCR1B=0x00;

TCNT1H=0x00;

TCNT1L=0x00;

ICR1H=0x00;

Page 38: sip proteus

ICR1L=0x00;

OCR1AH=0x00;

OCR1AL=0x00;

OCR1BH=0x00;

OCR1BL=0x00;

// Timer/Counter 2 initialization

// Clock source: System Clock

// Clock value: Timer2 Stopped

// Mode: Normal top=FFh

// OC2 output: Disconnected

ASSR=0x00;

TCCR2=0x00;

TCNT2=0x00;

OCR2=0x00;

// External Interrupt(s) initialization

// INT0: Off

// INT1: Off

// INT2: Off

MCUCR=0x00;

MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization

TIMSK=0x00;

// Analog Comparator initialization

Page 39: sip proteus

// Analog Comparator: Off

// Analog Comparator Input Capture by Timer/Counter 1: Off

ACSR=0x80;

SFIOR=0x00;

while (1)

{

// Place your code here

PORTC=0x3F;

delay_ms(500);

PORTC=0x06;

delay_ms(500);

PORTC=0xDB;

delay_ms(500);

PORTC=0xCF;

delay_ms(500);

PORTC=0xE6;

delay_ms(500);

PORTC=0xED;

delay_ms(500);

PORTC=0xFD;

delay_ms(500);

PORTC=0x07;

delay_ms(500);

Page 40: sip proteus

PORTC=0xFF;

delay_ms(500);

PORTC=0xEF;

delay_ms(500);

}

}