Bài giảng Vi xử lý - Chương 5: Thiết kế hệ vi xử lý (Phần 2)

LCD Pin Descriptions
14-pin LCD module is discussed here, table 12-1 lists pin’s function,
Fig 12-1 shows the pin positions for various LCDs
– Vcc, Vss provide +5V and ground
– Vee is used for contrast controlling
– RS (register select) is used to select the instruction command code
register (RS = 0) or data register (RS = 1)
– LCD command codes is listed at table 12-2
– R/W (read/write) allows user to write to (R/W = 0) or read from
(R/W = 1) information
– E (enable) latch information at data pins; when data is supplied to
data pins, a high-to-low pulse must be applied to this pin
– D0-D7 are the 8-bit data pins; send information to LCD (R/W = 0)
and read contents of LCD internal registers (R/W = 1)
– to display letters and numbers, ASCII codes are sent while RS = 1
pdf 84 trang thamphan 27/12/2022 3220
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Vi xử lý - Chương 5: Thiết kế hệ vi xử lý (Phần 2)", để tải tài liệu gốc về máy hãy click vào nút Download ở trên.

File đính kèm:

  • pdfbai_giang_vi_xu_ly_chuong_5_thiet_ke_he_vi_xu_ly_phan_2.pdf

Nội dung text: Bài giảng Vi xử lý - Chương 5: Thiết kế hệ vi xử lý (Phần 2)

  1. Chương 5 Thiếtkế hệ vi xử lý 1
  2. LCD controller 3
  3. LCD Pin Descriptions 14-pin LCD module is discussed here, table 12-1 lists pin’s function, Fig 12-1 shows the pin positions for various LCDs – Vcc, Vss provide +5V and ground – Vee is used for contrast controlling – RS (register select) is used to select the instruction command code register (RS = 0) or data register (RS = 1) – LCD command codes is listed at table 12-2 – R/W (read/write) allows user to write to (R/W = 0) or read from (R/W = 1) information – E (enable) latch information at data pins; when data is supplied to data pins, a high-to-low pulse must be applied to this pin – D0-D7 are the 8-bit data pins; send information to LCD (R/W = 0) and read contents of LCD internal registers (R/W = 1) – to display letters and numbers, ASCII codes are sent while RS = 1 5
  4. LCD Interfacing • Liquid Crystal Displays (LCDs) have become a cheap and easy way to display text for an embedded system – Various configurations (1 line by 20 characters upto 8 lines by 80 characters). • LCD needs a driving circuit to work. • Driving circuit and LCD are often integrated into a single chip Hitachi LM015 can display one line of 16 characters • The display has one register into which commands are sent and one register into which data to be displayed are sent • Two registers are differentiated by the RS input • Data lines (DB7-DB0) are used to transfer both commands (clearing, cursor positioning, etc) and data (character to be displayed) 9
  5. LCD Commands • The LCD’s internal controller can accept several commands and modify the display accordingly. These commands would be things like: – Clear screen – Return home – Decrement/Increment cursor • After writing to the LCD, it takes some time for it to complete its internal operations. During this time, it will not accept any new commands or data. – We need to insert time delay between any two 11 commands or data sent to LCD
  6. Interfacing LCD with 8051 In main program: Command and Data Write Routines . . . DATA: MOV P1, A ; A is ascii data MOV A, COMMAND SETB P3.3 ; RS=1 data CALL CMD CLR P3.4 ; RW=0 for write CALL DELAY SETB P3.5 ; H->L pulse on E MOV A, ANOTHER_CMD CLR P3.5 CALL CMD RET CALL DELAY MOV A, #’A’ CMD: MOV P1, A ; A has the cmd word CALL DATA CLR P3.3 ; RS=0 for cmd CALL DELAY CLR P3.4 ; RW=0 for write MOV A, #’B’ SETB P3.5 ; H->L pulse on E CALL DATA CLR P3.5 CALL DELAY . RET 13
  7. LCD Timing 19
  8. Stepper Motor Diagram 23
  9. Terminology • Steps per second, RPM – SPS = (RPM * SPR) /60 • Number of teeth • 4-step, wave drive 4-step, 8-step • Motor speed (SPS) • Holding torque 25
  10. Variable Reluctance Motors 27
  11. Variable Reluctance Motors • To rotate we excite the 3 windings in sequence ‒ W1 - 1001001001001001001001001 ‒ W2 - 0100100100100100100100100 ‒ W3 - 0010010010010010010010010 • This gives two full revolutions 29
  12. Unipolar Motors • To rotate we excite the 2 windings in sequence ‒ W1a - 1000100010001000100010001 ‒ W1b - 0010001000100010001000100 ‒ W2a - 0100010001000100010001000 ‒ W2b - 0001000100010001000100010 • This gives two full revolutions 31
  13. Unipolar Motors • To rotate we excite the 2 windings in sequence ‒ W1a - 1100110011001100110011001 ‒ W1b - 0011001100110011001100110 ‒ W2a - 0110011001100110011001100 ‒ W2b - 1001100110011001100110011 • This gives two full revolutions at 1.4 times greater torque but twice the power 33
  14. Unipolar Motors • The two sequences are not the same, so by combining the two you can produce half stepping ‒ W1a - 11000001110000011100000111 ‒ W1b - 00011100000111000001110000 ‒ W2a - 01110000011100000111000001 ‒ W2b - 00000111000001110000011100 35
  15. Interfacing to Stepper Motors 37
  16. Giao tiếp với DAC 39
  17. Example – Step Ramp 49
  18. Vin Range 63
  19. CLK IN and CLK R 65
  20. Assembly for ADC0804 67
  21. Example (với 80x86) 69
  22. Temperature Sensor 71
  23. Pin interface on ADC0808/0809 73
  24. Schematic for 8051 connected to ADC0809 up to 8 inputs selects input 75
  25. Single-ended vs Differential Pair input 77
  26. Assembly for ADC0809 79
  27. Printer Connection 81
  28. Printer’s Ports 83