Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

TUTORIAL MEMBUAT 7SEGMENT pada Program ISIS 7 Professioanl dan CodeVision AVR

LEB. TEKHNIK 1
Disusun Oleh :

Nama Kelas NIM

: Muhammad Imam Syahidullah : 13.3F.25 A : 13120575

Tahapan Pembuatan Rangkaian 7segment pada ISIS 7 Professional

Komponen yg digunakan : 1. 2. 3. 4. 5. 6. 7. 8. 9. Atmega 16 Power Ground 7segment Button Resistor 0.6 watt 1k Capasitor ceramic 22p Crystall Capacitor polypropylene 100n

Pada code vision avr: 1. Pilih new, project, atmega, ubah atmega16,

2. Pilih port, port A, di out semua.

3. Pilih program, generate save and exit

4. Tentukan folder (partisi) untuk save programnya

5. Lalu masukkan listing yg telah dibuat sebelumnya

Listing program: #include <mega16.h> #include <delay.h> void bin7seg(unsigned char data1) { switch (data1) { case 0: PORTA=0xc0; break; case 1: PORTA=0xf9; break; case 2: PORTA=0xa4; break; case 3: PORTA=0xb0; break; case 4: PORTA=0x99; break; case 5: PORTA=0x92; break; case 6: PORTA=0x82; break; case 7: PORTA=0xf8; break; case 8: PORTA=0x80; break; case 9: PORTA=0x90; break; } } void main(void) { DDRA=0xff; while (1) { bin7seg(0); delay_ms(500); bin7seg(1); delay_ms(500); bin7seg(2); delay_ms(500); bin7seg(3); delay_ms(500); bin7seg(4); delay_ms(500); bin7seg(5); delay_ms(500);

bin7seg(6); delay_ms(500); bin7seg(7); delay_ms(500); bin7seg(8); delay_ms(500); bin7seg(9); delay_ms(500); }; }

You might also like