Changes

8255

1,187 bytes added, 4 July
/* Group Modes */
All of these are almost identical in their operation. It is possible to detect each version by writing and then reading from the ppi control i/o port. Each can give a different pattern of values that are read back.
 
<br>
== The 8255 in the CPC ==
|-
|}
 
Group Mode 1 (Strobed Input/Output) and Group Mode 2 (Bi-Directional Bus), as far as I know, are not used by any program. Group Mode 0 (Basic Input/Output) is always used.
In the CPC+, the 8255 is integrated into the ASIC. The "emulation" is not complete and some functionality is not available. Please see the [https://cpctech.cpcwiki.de/docs/cpcplus.html Extra CPC+ documentation] for more information.
* Mode 1 (Strobed Input/Output) and Mode 2 (Bi-Directional Bus), as far as I know, are not used by any program, Mode 0 (Basic Input/Output) is always used.<br>
== Port Usage ==
* NOTE - If you are using the firmware, always return the operating modes and I/O state of the ports used to their settings below. The firmware expects the settings to be the same as given below and may operate incorrectly if they are not.
 
<br>
== PPI Port A ==
|-
|}
 
<br>
== PPI Port B ==
* If port B is programmed as an output, you can make a fake vsync visible to the Gate-Array by writing 1 to bit 0. You can then turn it off by writing 0 to bit 0. It is fake in the sense that it is not generated by the CRTC as it normally is. This fake vsync doesn't work on all CPCs. It is not known if it is dependent on CRTC or 8255 or both.
 
* For more info on LK1-LK4 (and further LKs) see [[LK Links]]
 
<br>
== PPI Port C ==
|-
|}
 
<br>
== PPI Control ==
This register has two different functions depending on bit7 of the data written to this register.
 
<br>
=== PPI Control with Bit7=0 ===
Bit 7 SF Must be "0" in this case
[[File:Intel 8255A - BSR control word format8255 Control0.jpgpng]] <br>
=== PPI Control with Bit7=1 ===
* In the CPC only Bit 4 is of interest, all other bits are always having the same value. In order to write to the PSG sound registers, a value of 82h must be written to this register. In order to read from the keyboard (through PSG register 0Eh), a value of 92h must be written to this register.
[[File:Intel 8255A - IO modes control word format8255 Control1.jpgpng]] <br>
== Group Modes ==
=== Mode 0 – Simple Input/output mode ===In this mode the 8 bit some of these modes, port A (PA0-PA7) of 8255 IC can be configured C is used as input or output a control/status port. In the similar fashion for port A or B (PB0-PB7) can also configured as input or output operation. However there is flexibility for the port C. It can be divided into two 4 bit portsused to confirm when data transfer may take place, the port CLower (PC0-PC3) and port CUpper (PC4-PC7)reflect any other flags. Each of them can set independently The 8255 PPI is therefore supplied with the added option for input or output operation. In this way we can say there are four ports (port-A, port-B, port CLower and port CUpper) and each of them can the user to set either as an input port or an output reset any individual bits in portC.
Here these ports are simple input or <br> === Mode 0 – Simple Input/output ports. That means these mode ===In this mode, the ports can work be used for simple I/O operations without handshakingsignals. In this mode Port A, port B provide simple I/O operation. The two halves of port C can be either used together as an additional 8-bit port, or they can be used as individual 4-bit ports. Since the outputs two halves of port C are latched whereas independent, they may be used such that one-half is initialized as an input port while the inputs are not latchedother half is initialized as an output port.
[[File:8255 - mode-0.png]]
 
<br>
=== Mode 1 – Strobed Input/output or Handshake mode ===
Mode 1 is a second mode of 8255 I/O mode. In this mode of operation handshaking can used When we wish to use port A or port B for the handshake (strobed) input or output data transfer. Another important think operation, we have to remember initialise that there are two groups port in 8255 PPI, Group mode 1 (port A and Group port Bcan be initialised to operate in different modes, i. Both these groups have one 8-bit port and one 4-bit porte.Group A consist Port-, for e.g., port A can operate in mode 0 and Port CUpper. And group port B consist Port-B and Port CLowerin mode 1). The 8-bit Some of the pins of port C function as handshake lines. For port B in this mode (irrespective of each group can be programmed for whether is acting as an input port or output operation with latched port), PC0, PC1 and PC2 pins function as handshake lines. If port A is initialised as mode 1 input port, then, PC3, PC4 and latched output facilitiesPC5 function as handshake signals. The bits of Port C used Pins PC6 and PC7 are available for handshakinguse as input/output lines.
[[File:8255 - mode-1.png]]
 
<br>
=== Mode 2 – Bidirectional Mode ===
So the final mode of 8255 is Mode 2. In Only port A can be initialized in this mode . Port A can be programmed to operate as a used for bidirectional porthandshake data transfer. When Port This means that data can be input or output on the same eight lines (PA0 - PA7). Pins PC3 - PC7 are used as handshake lines for port A programmed in this mode . The remaining pins of operation, Port B port C (PC0 - PC2) can be used either as input/output lines if group B is initialized in Mode mode 0 or Mode as handshaking for port B if group B is initialized in mode 1. For mode 2 operation PC3 to PC7 bits used for handshaking. In this mode too both inputs , the 8255 may be used to extend the system bus to a slave microprocessor or to transfer data bytes to and outputs from a floppy disk controller. Acknowledgement and handshaking signals are latchedprovided to maintain proper data flow and synchronisation between the data transmitter and receiver.
[[File:8255 - mode-2.png]]
 
<br>
 
=== Port pins summary ===
 
[[File:8255 - Port pins.gif]]
 
<br>
== Programming Examples ==
</pre>
= Diagram =<br>
[[File:== Block-diagram-of-8255-l.jpg]]Diagram ==
= Resources =[[File:8255 Block Diagram.png]]
<br> == Amstrad ASIC PPI == *The 8255 PPI is not emulated by the Pre-ASIC. These CPCs have a real PPI chip and therefore behave like the first generation of CPCs.*The ASIC PPI does not support Group Modes other than Groupe Mode 0.*On the ASIC PPI, Port B is always defined as input and Port C is always defined as output.*On a real PPI chip, when the PPI control register is used (with bit7=1) to configure the ports, the output latches of all ports are reset to 0. The ASIC poorly emulates the PPI and does not reset these ports. <br> == Resources == * [[Media:Intel_8255A_DatasheetIntel8255A_datasheet.pdf]] PPI Datasheet (Intel)
* [[Media:PPI M5L8255AP-5.pdf]] PPI Datasheet (Mitsubishi)
* [[VHDL https://github.com/jotego/jt8255 JT8255] Verilog implementation of the 8255 PIO]]PPI
<br> == Links ==
*[http://en.wikipedia.org/wiki/Intel_8255 Wikipedia about the 8255ppi]
*[http://quasar.cpcscene.net/doku.php?id=assem:ppi Quasar PPI documentation (in french)]
 
[[Category:Electronic Component]][[Category:CPC Internal Components]][[Category:Programming]]
6,109
edits