Đang chuẩn bị liên kết để tải về tài liệu:
Interfacing PIC Microcontrollers 7

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Interfacing PIC Microcontrollers 7. 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 a b Figure 2.3 BIN4 flowcharts a main routine b delay subroutine Flowcharts are useful for providing a graphical representation of the program for example for a presentation but they are time consuming to create. Nevertheless the flowcharts shown here were drawn just using the drawing tools in Word so the creation of flowcharts to a reasonable standard is not difficult for the occasional user. Specialist drawing packages are also available which make the process quicker and easier for the professional software engineer. Pseudocode Pseudocode shows the program as a text outline using higher-level language constructs to represent the basic processes of sequential processing selection and repetition. BIN4 is represented in Table 2.6. 46 PIC Software Operation Symbol Implementation Start End I BIN4 Process Sequence Input or Output Branch Selection __ Initialise Port B all outputs Subroutine Procedure or Function DELAY using Count Source code file project name in start box. End not needed if program loops endlessly BANKSEL TRISB MOVLW B 00000000 MOVWF PORTB CLRF PORTB BTFSS PORTD Inres GOTO reset MOVLW CALL 0FF delay Table 2.5 Flowchart implementation The program outline uses high level key words such as IF and DO. .WHILE to control the sequence. It is not an ideal method for a very simple program like this but is useful for more complex programs. In particular it translates directly into C if the high-level language is preferred. Note that in this case the program outline does not make any assumptions about the hardware implementation. Structure Charts Structure charts are also more suited to more complex programs but the concept can be illustrated as in Figure 2.4. Each program component is included under standard headings inputs processes and outputs and can be broken down further in more complex programs so that components can be created independently and then integrated. C Programming The C programming language