TAILIEUCHUNG - Interfacing PIC Microcontrollers 5

Interfacing PIC Microcontrollers 5. Explore in detail microcontroller interfacing techniques using the popular PIC 16F877 Work through step-by-step examples interactively using circuit simulation software, supplied as assembly source code Gain the knowledge of a wide range of peripheral devices such as keyboards, displays, sensors and drives and serial communication with other processors, memory and more Use interactive simulation software to design and test circuits. | Interfacing PIC Microcontrollers Flag after Operation Zero Z Carry C Result Comment ADD 0 0 A B 256 8-bit sum no carry A B 1 1 A B 256 100h Exactly carry out 0 1 A B 256 9-bit sum carry out SUB 0 1 A-B 256 8-bit difference no borrow A-B 1 1 A-B 0 Numbers equal no borrow 0 0 A-B 0 Borrow taken result negative Set carry flag before subtracting. Table Arithmetic results Again remember that the carry flag must be set before a subtraction operation so that a borrow can be detected as C 0. DIGIT CARRY DC A file register can be seen as containing 8 individual bits or 1 byte. It can also be used as 2 X 4-bit nibbles a small byte . Each nibble can be represented as 1 hex digit 0-F . The digit carry records a carry from the most significant bit of the low nibble bit 3 . Hence the digit carry allows 4-bit hexadecimal arithmetic to be carried out in the same way as 8-bit binary arithmetic uses the carry flag C. REGISTER BANK SELECT RP1 RP0 The PIC 16F877 file register RAM is divided into four banks of 128 locations banks 0-3 Figure 2-3 in data sheet . At power on reset bank 0 is selected by default. To access the others these register bank select bits must be changed as shown in Table . It can be seen that some registers repeat in more than one bank making it easier and quicker to access them when switched to that bank. For example the status register repeats in all banks. In addition a block of GPRs at the end of each bank repeat so that their data contents are available without changing banks. The register banks are selected by setting and clearing the bits RP0 and RP1 in the status register. More conveniently the pseudo-operation BANKSEL can be used instead. The operand for BANKSEL is any register in that bank or its label. In effect BANKSEL detects the bank bits in the register address and copies them to the status register bank select bits. 26 PIC Hardware RP1 RP0 Bank Address Total Function 0 0 0 00 - 20 32 Special function registers 20 - 7F 96 General purpose .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.