TAILIEUCHUNG - NIGEL PIC Tutorial Hardware phần 3

Dẫn bao gồm một dây mặt đất, RB1 để RB2, RB2 để RB1, và một dây tùy chọn 5V. RB1 và RB2 trên thập giá vì vậy chúng tôi có thể thử nghiệm được xây dựng trong phần cứng USART cũng như phần mềm truyền thông nối tiếp. Tôi đã thêm một hội đồng quản trị bộ vi xử lý thứ hai, dựa trên PIC16F876, điều này cho biết thêm một cổng thứ ba, và bao gồm 5 kênh là 10 bit tương tự | movlw movwf bcf clrf b 00000000 LEDTRIS STATUS LEDPORT RP0 set PortB all outputs select bank 0 set all outputs low Loop movlw b 10000000 movwf LEDPORT call Delay this waits for a while movlw b 01000000 movwf LEDPORT call Delay this waits for a while movlw b 00100000 movwf LEDPORT call Delay this waits for a while movlw b 00010000 movwf LEDPORT call Delay this waits for a while movlw b 00001000 movwf LEDPORT call Delay this waits for a while movlw b 00000100 movwf LEDPORT call Delay this waits for a while movlw b 00000010 movwf LEDPORT call Delay this waits for a while movlw b 00000001 movwf LEDPORT call Delay this waits for a while movlw b 00000010 movwf LEDPORT call Delay this waits for a while movlw b 00000100 movwf LEDPORT call Delay this waits for a while movlw b 00001000 movwf LEDPORT call Delay this waits for a while movlw b 00010000 movwf LEDPORT call Delay this waits for a while movlw b 00100000 movwf LEDPORT call Delay this waits for a while movlw b 01000000 movwf LEDPORT call Delay this waits for a while goto Loop go back and do it again Delay movlw d 250 delay 250 ms 4 MHz clock movwf count1 dl movlw 0xC7 movwf counta movlw 0x01 movwf countb Delay_0 decfsz counta f goto 2 decfsz countb f goto Delay_0 decfsz countl f goto dl retlw 0x00 end Tutorial Now while the previous two routines work perfectly well and if this was all you wanted to do would be quite satisfactory they are rather lengthy crude and inelegant . Tutorial uses 24 lines within the loop by introducing another PIC command we can make this smaller and much more elegant. Tutorial - LIST include confi Nigel Goodwin p 16F628 g 0x3D18 2002 tell assembler what chip we are using include the defaults for the chip sets the configuration settings oscillator type etc. cblock 0x20 start of general purpose registers count1 used in delay routine counta used in delay routine countb used in delay routine endc LEDPORT Equ PORTB set constant LEDPORT PORTB LEDTRIS Equ TRISB set constant

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.