Download presentation
1
Electronics Lab. 4 Exp. 2 : Parallel input
Prof. 박인철 T.A.
2
실험 목적 Parallel input과 Parallel output의 사용법 이해 8255 PPI의 사용법 숙지
PPI programming방법에 대한 이해
3
실험 내용 Display switch history Logic checker 스위치가 눌려진 횟수를 LED의 점멸로 표시
debouncing 점등시간 : 0.1초, 소등시간 : 0.4초 Logic checker 스위치의 상태를 LED로 표시
4
Parallel Interface Block Diagram
data bus Inverter register Red LED PA0 IBM PC ISA BUS Inverter register Green LED PA1 control signals 8255 PPI +5V R address Logic (design) PB0 GND 8255 setting mode 0 port A : output port B : input
5
8255 External Description Microcomputer bus와 인터페이스하기 위한 general purpose I/O component address bus control bus data bus RD.WR D7…D0 A0.A1 8255A B C A 8 4 4 8 11/09/’98
6
Operation Word Format 11/09/’98
7
Operation Definition Format
mode set flag 1=active group B mode selection 0=mode 0 0=mode 1 group A mode selection 00=mode 0 01=mode 1 1x=mode2 port B 1=input 0=output port A 1=input 0=output port C (upper) 1=input 0=output port C (lower) 1=input 0=output 11/09/’98
8
MODE 0 11/09/’98
9
MODE 1 11/09/’98
10
MODE 2 11/09/’98
11
Intel 8255 PPI control I/O port address Control Byte
0x318 : 8255 PPI port A 0x319 : 8255 PPI port B 0x31A : 8255 PPI port C 0x31B : 8255 PPI Control Byte Control Byte 0x31B address에 입력되는 data에 의해 결정
12
Debouncing 스위치의 상태가 변화할 때 생기는 노이즈를 제거하는 방법
상태를 샘플링하는 주기가 충분히 빠를 때, 약간의 delay를 주고 여러 번 샘플링하여 상태값의 변화 과정을 보고 판단한다. Ex) ® 0에서 1로 천이 switch signal Debounced signal
13
Delay 설정 방법 Interrupt : 15H Service routine : 86H Registers on entry :
AH : 86H CX : high-order value of delay time in microseconds DX : low-order value of delay time in microseconds Syntax : MOV AH,86h ; delay service MOV CX, ; high 16bit value MOV DX, ; wait 1/100 second INT 15h ; BIOS extension interrupt
14
문제 1 순서도 Y N N Y N Y START counter ==0? Initialize 8255 PPI
Turn on LED N done? Delay 0.1s Read the switch Y Display N blink debouncing Turn off LED N END Delay 0.4s Transition? Y Decrease counter Increase counter
15
문제 2 순서도 Y N 1 N Y Y N Red ON Green ON START set counter Initialize
8255 PPI Y counter==0? Read the switch N Logic State Decrease counter debouncing 1 Red ON Green OFF Red OFF Green ON Read the switch N Transition? Y debouncing Y N Transition?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.