Pengantar Organisasi Komputer - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Pengantar Organisasi Komputer

Description:

1. IKI10230. Pengantar Organisasi Komputer. Kuliah no. A6: Bahasa Rakitan AVR. I/O Instructions ... 09 ($29) UBRR UART Baud Rate Register ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 15
Provided by: bobbyn4
Category:

less

Transcript and Presenter's Notes

Title: Pengantar Organisasi Komputer


1
IKI10230Pengantar Organisasi KomputerKuliah no.
A6 Bahasa Rakitan AVRI/O Instructions
Sumber1. AVR AT90S8515 Data Sheet.2. Materi
kuliah CS152, th. 1997, UCB.
4 April 2003 Bobby Nazief (nazief_at_cs.ui.ac.id)Qon
ita Shahab (niet_at_cs.ui.ac.id) bahan kuliah
http//www.cs.ui.ac.id/iki10230/
2
  • Instruksi I/O

3
Organisasi I/O dari µC AVR
Interupsi Eksternal
Built-in I/O, Interupsi Internal
4
Peta Memori Data
Akses menggunakan instruksi IN OUT
Akses menggunakan instruksi LD ST
5
Alamat-alamat I/O (1)
Address Hex Name Function 3F (5F) SREG
Status Register 3E (5E) SPH Stack Pointer
High 3D (5D) SPL Stack Pointer Low 3B (5B)
GIMSK General Interrupt MaSK Register 3A
(5A) GIFR General Interrupt Flag Register 39
(59) TIMSK Timer/Counter Interrupt MaSK
Register 38 (58) TIFR Timer/Counter
Interrupt Flag Register 35 (55) MCUCR MCU
general Control Register 33 (53) TCCR0
Timer/Counter 0 Control Register 32 (52)
TCNT0 Timer/Counter 0 (8-bit) 2F (4F)
TCCR1A Timer/Counter 1 Control Register A 2E
(4E) TCCR1B Timer/Counter 1 Control Register
B 2D (4D) TCNT1H Timer/Counter 1 High
Byte 2C (4C) TCNT1L Timer/Counter 1 Low
Byte 2B (4B) OCR1AH Output Compare Register
A High Byte 2A (4A) OCR1AL Output Compare
Register A Low Byte 29 (49) OCR1AH Output
Compare Register B High Byte 28 (48) OCR1AL
Output Compare Register B Low Byte 25 (45)
ICR1H T/C 1 Input Capture Register High
Byte 24 (44) ICR1L T/C 1 Input Capture
Register Low Byte 21 (41) WDTCR Watchdog
Timer Control Register
6
Alamat-alamat I/O (2)
Address Hex Name Function 1B (38) PORTA
Data Register, Port A 1A (3A) DDRA Data
Direction Register, Port A 19 (39) PINA Input
Pins, Port A 18 (38) PORTB Data Register,
Port B 17 (37) DDRB Data Direction Register,
Port B 16 (36) PINB Input Pins, Port B 15
(35) PORTC Data Register, Port C 14 (34)
DDRC Data Direction Register, Port C 13 (33)
PINC Input Pins, Port C 12 (32) PORTD Data
Register, Port D 11 (31) DDRD Data Direction
Register, Port D 10 (30) PIND Input Pins,
Port D 0F (2F) SPDR SPI I/O Data Register 0E
(2E) SPSR SPI I/O Status Register 0D (2D)
SPCR SPI I/O Control Register 0C (2C) UDR
UART I/O Data Register 0B (2B) USR UART
Status Register 0A (2A) UCR UART Control
Register 09 (29) UBRR UART Baud Rate
Register 08 (28) ACSR Analog Comparator
Control and Status Register
7
Instruksi-instruksi I/O
  • P I/O Register
  • Data Transfer
  • IN Rd,P Rd ? P
  • OUT P,Rs P ? Rs
  • Bit Operation
  • SBI P,b P(b) ? 1
  • CBI P,b P(b) ? 0
  • Branch
  • SBIC P,b Skip if P(b) 0
  • SBIS P,b Skip if P(b) 1
  • RETI
  • Special
  • SEI Global Interrupt Enable
  • CLI Global Interrupt Disable
  • WDR Watchdog Reset

8
Simulasi Program I/O di AVR Studio
9
Penggunaan Port I/O 8 bit (A,B,C,D)
  • Penamaan
  • PORTA,PORTB,PORTC,PORTD
  • DDRA,DDRB,DDRC,DDRD (data direction)
  • PINA,PINB,PINC,PIND
  • Mengeset sebuah port untuk menjadi sebuah Input
    Port
  • out DDRD,0x00
  • Mengeset sebuah port untuk menjadi sebuah Output
    Port
  • out DDRB,0xff
  • Memasukkan data (input) dari sebuah port
  • in R16,PIND
  • Mengeluarkan data (output) ke sebuah port
  • out PORTB,R16

10
Contoh masuk/keluar data
  • out PORTB,0b00110101
  • in R18,PIND
  • isi R18 0b00100000

11
Contoh Program io-bd.asm
  • ldi temp,ff
  • out PORTB,temp Set all pins at port B high
  • out DDRB,temp Set port B as output
  • ldi temp,00
  • out PIND,temp Set all pins at port D low
  • out DDRD,temp Set port D as input
  • ldi count,5
  • rjmp show_inputs
  • show_inputs
  • nop only in simulator
  • in temp,PIND get input
  • out PORTB,temp output the data
  • dec count
  • cpi count,0
  • brne show_inputs

12
STK200 board untuk percobaan I/O
  • Port B LED
  • Port D tombol-tombol

13
Penggunaan STK200
  • Prosesor AVR ditancapkan di STK200 board
  • Kabel ke parallel port di PC

14
Referensi
  • AVR Assembler User Guide
  • http//www.avr-asm-tutorial.net
  • ltAVR installation dirgt\appnotes\.asm
  • AVR AT90S8515 Data Sheets
Write a Comment
User Comments (0)
About PowerShow.com