1 8255A function
- Three 8-bit parallel input/output ports, which can be determined by programming
- Can adapt to the requirements of multiple data transmission methods between CPU and I/O interface
2 8255A internal structure and pin diagram
8255A has 3 ports, 40 pins, 3 working modes
This is from the teacher’s courseware, I
think the reference book is better
1) Data bus buffer
It is a two-way tri-state 8-bit buffer connected to the CPU system data bus, which is the only way to transfer data between the 8255A and the CPU. Input data, output data, and control command words are all transmitted through the data bus buffer.
2) Read and write control logic The
read/write control logic receives signals and control signals from the CPU address bus, and issues commands to two control groups (group A and group B). It controls the control commands issued by the CPU or the output data to the corresponding port; or the status of the peripheral or the input data is sent to the CPU from the corresponding port.
3)
The working mode of group A and group B controlling the three ports of A, B and C is set by the CPU by writing group A and group B mode control words to the control register. The upper 4 bits of port A and port C (PC 7 -PC 4 .) form group A, which is controlled by group A control components; the lower 4 bits of port B and port C (PC 3 -PC 0 ) form group B Group, it is controlled by group B control components.
- Port A: PA0~PA7
Group A, support working mode 0, 1, 2 - Port B: PB0~PB7
Group B, support working mode 0, 1 - Port C: PC0~PC7
only support working mode 0
Group A controls the high 4 bits PC4~PC7
Group B controls the low 4 bits PC0~PC3
3 8255A control word
There are two control words, and write to the same control port.
- Mode control word
- Set/reset control word
4 8255A working method
-
Mode 0: Basic input/output mode
(1) Two 8-bit ports (A, B) and two 4-bit ports (C up and down) can work in this mode;
(2) Any port can be input/output ;
(3) Output data is latched, and input data is not latched;
(4) There are 16 combinations of input/output for each port.
Suitable for unconditional transmission and query mode interface circuits. -
Mode 1: Strobe input/output mode
(1) In mode 1, there are two groups of ports, each group contains an 8-bit data port and 3 control lines;
(2) Each group of ports provides interrupt request logic and interrupt enable trigger ; a
(3) two sets of ports to simultaneously embodiment 1;
(4) input / output data are latched.
It is suitable for the interface circuit of query and interrupt mode.
-
Mode 2: Two-way strobe transmission mode
(1) This mode can only be used in Group A;
(2) There is an 8-bit bidirectional data port and 5 control lines in this mode;
(3) Input/output data are latched.
Suitable for peripherals that transfer data in both directions.
5 8255A and printer interface (mode 0)
work process:
- The host sends data to pins DATA 0 ~ 7 ;
- Send out the data strobe signal STROBE at the same time;
- The printer sends a busy signal on the BUSY signal line;
- The printer cancels the busy signal after processing the data.
6 LED digital tube
- Composition The
main part is a 7-segment luminous tube, which are called a, b, c, d, e, f, g clockwise, and some products also have a decimal point h. - Function It
can display 0-9, A-F, and some special characters, such as -, P, etc. - Two structures