Đang chuẩn bị liên kết để tải về tài liệu:
Thiết kế hệ thống nhứng -TS. Trương Quang Vinh-c7a

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

8/9/2016ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH.TRƯỜNG ĐẠI HỌC BÁCH KHOA.KHOA ĐIỆN-ĐIỆN TỬ.BỘ MÔN KỸ THUẬT ĐIỆN TỬEmbedded System Design.Chapter 7: Peripherals for embedded.systems.7.1 Digital parallel input / output.7.2 LCD interfacing.7.3 Analog input /output.7.4 Serial communication.Bộ Môn Kỹ Thuật Điện Tử - ĐHBK11. Digital parallel input / output.• Commonly used input peripherals.– DIP switches, push‐button keys, keyboards, and A/D converters• DIP switch.– One side of the switch is tied high.• To a power supply through a resistor called a pull‐up resistor– The other side is grounded.– The logic level changes when the position is switched• Push‐button key .– Same as the DIP switch except that contact is momentaryBộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p121.8/9/2016SWITCH ON I/O PORTSvery small.current neededBộ môn Kỹ Thuật Điện Tử - ĐHBKthe circuit waste a.large currentChapter 7 - p1when the switch is open,.the input floats to a noisesensitive3Switch InputBộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p142.8/9/2016Digital input for PICActive Low-Button.InputActive High-Button.InputBộ môn Kỹ Thuật Điện Tử - ĐHBKTransistor InputChapter 7 - p15Switch hardware debouncingSwitch hardware debounce.(a) without debounce capacitor .(b) with debounce capacitor .Ex: With a 10k pull‐up resistor, a 10 nF.capacitor would give a time constant of 100 ms, .which should be more than adequate.Bộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p1663.8/9/2016Software Debouncing.• Debouncing the key.– Software technique.• Wait for 20 ms• Read the port pin again• If the reading is still 0 (for eg) , it .indicates that a key is pressed.Bouncing in mechanical switches. When the switch opens.or closes, the mechanical pieces vibrate generating fast.contacts before settling. This transient normally lasts less.than 20 msBộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p17Interfacing Dip SwitchesBộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p184.8/9/2016Test Circuit with Input SwitchBộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p19Tests an input with IF Statement.// IFIN.C Tests an input.#include " 16F877A.h ".void main().{.int x; // Declare variable.output_D(0); // Clear all outputs.while(1) // Loop always.{.x = input(PIN_C0); // Get input state.if(x = = 1)output_high(PIN_D0); // Change output.}.}Bộ môn Kỹ Thuật Điện Tử - ĐHBKChapter 7 - p1105. | 8 9 2016 ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIệN-ĐIỆN Tử BỘ MÔN KỸ Thuật điện tử Embedded System Design Chapter 7 Peripherals for embedded systems 7.1 Digital parallel input output 7.2 LCD interfacing 7.3 Analog input output 7.4 Serial communication Bộ Môn Kỹ Thuật ĐiệnTử - ĐHBK 1. Digital parallel input output Commonly used input peripherals DIP switches push-button keys keyboards and A D converters DIP switch One side of the switch is tied high To a power supply through a resistor called a pull-up resistor The other side is grounded The logic level changes when the position is switched Push-button key Same as the DIP switch except that contact is momentary Bộ môn Kỹ Thuật ĐiệnTử - ĐHBK Chapter 7 -pl 2 1 8 9 2016 SWITCH ON I O PORTS very small current needed the circuit waste a large current when the switch is open the input floats to a noisesensitive Bộ môn Kỹ Thuật ĐiệnTử - ĐHBK Chapter 7 - p1 3 Switch Input Bộ môn Kỹ Thuật ĐiệnTử - ĐHBK Chapter 7 - p1 External pulllip When switch is pressed RB3 reads as O else reads as r. If pullup not present then input would float when switch is not pressed and input value may read as 0 or 1 because of system noise. 4 2 8 9 2016 Switch hardware debouncing Debounce Capacitor Pull-up Resistor Rp Switch PIC Vo 5.Ri Rp Ri Switch hardware debounce a without debounce capacitor b with debounce capacitor Ex With a 10k pull-up resistor a 10 nF w capacitor would give a time constant of 100 ms which should be more than adequate Bộ môn Kỹ T J- t Chapter 7 - pl

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.