tailieunhanh - Interfacing PIC Microcontrollers 23

Interfacing PIC Microcontrollers 23. 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 MPB 10-9-05 Test RS232 communications using the USART Asynchronous Transmit and Receive The Proteus Virtual Terminal allows ASCII characters to be generated from the keyboard and displayed. The program outputs a fixed message to the display from a table and then displays numbers input from the terminal on a BCD 7-segment LED display. I iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii PROCESSOR 16F877 define MPU __CONFIG 0x3731 XT clock 4MHz I LABEL EQUATES INCLUDE Point EQU 020 Inchar EQU 021 Standard labels ORG NOP 0 Place machine code Required for ICD mode BANKSEL TRISD Select bank 1 CLRF TRISD Display outputs BCF TXSTA TX9 Select 8-bit tx BCF TXSTA TXEN Disable transmission BCF TXSTA SYNC Asynchronous mode BSF TXSTA BRGH High baud rate MOVLW D 25 Baud rate value . MOVWF SPBRG . 9600 baud 4MHz BSF TXSTA TXEN Enable transmission BANKSEL RCSTA Select bank 0 BSF RCSTA SPEN Enable serial port MAIN LOOP readin CALL CALL GOTO write read readin Message on terminal Get input from terminal Keep reading until reset SUBROUTINES Write message to terminal. write CLRF Point Table pointer 0 next MOVF Point W Load table pointer CALL mestab Get character CALL sencom Output to terminal INCF Point Point to next MOVLW D 14 Number of chars 1 SUBWF Point W Check pointer BTFSS STATUS Z Last character done GOTO RETURN next No - next All done Program USART serial communication 206 Serial Communication Re ad input numbers from terminal read waitin BSF BTFSS GOTO RCSTA CREN PIR1 RCIF waitin Character Enable reception received no - wait MOVF MOVWF MOVLW SUBWF MOVWF RETURN RCREG W Inchar 030 Inchar W PORTD Calculate get input character store input character ASCII number offset number display it done Transmit a character sencom waitot MOVWF BTFSS GOTO RETURN TXREG PIR1 TXIF waitot sent load transmit register no yes Table of message ADDWF RETLW RETLW RETLW RETLW RETLW RETLW RETLW RETLW RETLW RETLW RETLW RETLW RETLW .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.