21.07.2013 Views

THỰC HÀNH VI XỬ LÝ - Khoa Khoa học và Kỹ thuật Máy tính

THỰC HÀNH VI XỬ LÝ - Khoa Khoa học và Kỹ thuật Máy tính

THỰC HÀNH VI XỬ LÝ - Khoa Khoa học và Kỹ thuật Máy tính

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Trường ĐH. Bách <strong>Khoa</strong> TP.HCM <strong>Khoa</strong> KH & KTMT<br />

return<br />

movf RCREG,W ; Get input data<br />

movwf LATB ; Display on LEDs<br />

movwf TXREG ; Echo character back<br />

goto ISREnd ; go to end of ISR, restore context,<br />

RcvError<br />

bcf RCSTA,CREN ; Clear receiver status<br />

bsf RCSTA,CREN<br />

movlw 0FFh ; Light all LEDs<br />

movwf PORTB<br />

goto ISREnd ; go to end of ISR, restore context,<br />

return<br />

ISREnd<br />

retfie<br />

7.2 Chương trình mẫu<br />

;=====================================;<br />

; Name: uart.asm<br />

; Project: Viết chương trình giao tiếp giữa máy <strong>tính</strong> <strong>và</strong> vi điều khiển PIC.<br />

; Author: BKIT HARDWARE CLUB<br />

; Homepage: http://www.bkit4u.com/forum<br />

; Creation Date: 8 - 8 - 2009<br />

;======================================;<br />

list p=18F4520 ; set processor type<br />

include <br />

;************************************************************<br />

; Reset and Interrupt Vectors<br />

org 00000h ; Reset Vector<br />

goto Start<br />

org 00008h ; Interrupt vector<br />

goto IntVector<br />

;************************************************************<br />

; Program begins here<br />

Bộ môn <strong>Kỹ</strong> Thuật <strong>Máy</strong> Tính 68 Thực hành Vi xử lý

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!