{"id":5762,"date":"2023-12-08T10:30:19","date_gmt":"2023-12-08T09:30:19","guid":{"rendered":"https:\/\/msxitalia.org\/?p=5762"},"modified":"2023-12-08T15:28:41","modified_gmt":"2023-12-08T14:28:41","slug":"pinout-della-cpu-z80","status":"publish","type":"post","link":"https:\/\/msxitalia.org\/en\/pinout-della-cpu-z80\/","title":{"rendered":"Z80 CPU PinOut \u2013 handout 3"},"content":{"rendered":"<p>What you are about to read is a handout and certainly not a book and therefore does not claim to be exhaustive and self-sufficient. This can be accompanied by documentation that can be easily found both in paper and digital form. For the drafting of this handout, in addition to the obvious information that can be found online, I took extensive inspiration from the Z80 Programming in Assembly language manuals and the New Z80 manual. As with all my other articles I apologize for any inaccuracies. Enjoy the reading.<\/p>\n<p>THE CPU AND ITS CONNECTIONS<\/p>\n<p>In this article we will describe the various signals that the Z80 CPU presents on its pins. When we talk about input\/output we mean it relative to the CPU. What we see below is the functional arrangement of the signals and not their real position in the package.<\/p>\n<p><strong><img decoding=\"async\" data-src=\"https:\/\/msxitalia.org\/wp-content\/uploads\/2023\/12\/Z80-300x208.jpg\" class=\"alignnone size-medium wp-image-5766 lazyload\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"\" width=\"300\" height=\"208\" \/><noscript><img decoding=\"async\" class=\"alignnone size-medium wp-image-5766\" src=\"https:\/\/msxitalia.org\/wp-content\/uploads\/2023\/12\/Z80-300x208.jpg\" alt=\"\" width=\"300\" height=\"208\" srcset=\"https:\/\/msxitalia.org\/wp-content\/uploads\/2023\/12\/Z80-300x208.jpg 300w, https:\/\/msxitalia.org\/wp-content\/uploads\/2023\/12\/Z80-18x12.jpg 18w, https:\/\/msxitalia.org\/wp-content\/uploads\/2023\/12\/Z80.jpg 467w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/noscript><br \/>\n<\/strong><strong>\u00a0<\/strong><\/p>\n<p><strong>BUS<\/strong><br \/>\nIn the CPU there are two types of BUS, one called ADDRESS BUS and the other called DATA BUS, let&#039;s see what it is.<\/p>\n<p><strong>ADDRESS BUS<\/strong><br \/>\nThis type of bus is called tri-state because it has the ability to virtually disconnect the CPU from the external address bus by placing these output signals in a high impedance state. The outputs are active high and unidirectional (so it is the CPU that generates the addresses). Signals A0-A15 make up the address bus where A0 is the least significant bit. The bus provides addresses for exchanging data with memory and I\/O devices. I\/O device addressing is done using the least significant 8 bits of the address bus, A0 through A7.<\/p>\n<p><strong>DATA BUS<br \/>\n<\/strong>This type of bus is called tri-state because it has the ability to virtually disconnect the CPU from the external address bus by placing these output signals in a high impedance state. The outputs are active high and bidirectional. Signals D0-D7 constitute the data bus where D0 is the least significant bit. The bus is used to exchange data with memory and I\/O devices.<\/p>\n<p><strong>CONTROL SIGNALS<\/strong><\/p>\n<p>Some texts report in addition to the DATA BUS and ADDRESS BUS also the SYSTEM CONTROL BUS, the latter collects those signals that allow the reading and writing operations to be managed. Having clarified that it is possible to find a different grouping of CPU signals, let&#039;s describe the signals that the Z80 makes available to us.<\/p>\n<p><strong>M1 (Machine cycle)<\/strong> \u2013 Output active low, indicates that the code of the next instruction is loaded in the current machine cycle (instruction fetch). There are some instructions, having the opcode consisting of two bytes which therefore require two consecutive M1 cycles.<\/p>\n<p><strong>MREQ (Memory Request)<\/strong> \u2013 Active low tri-state output, indicates that there is a valid address on the address bus for a read\/write operation.<\/p>\n<p><strong>IORQ (Input Output Request) <\/strong>\u2013 Active low tri-state output, indicates that there is a valid address for I\/O operations on the 8 least significant bits of the address bus. The IORQ signal is also generated together with the M1 signal during the interrupt recognition cycle.<\/p>\n<p><strong>RD (Read) <\/strong>\u2013 Tri-state output active low, indicates that the CPU wants to read from memory or an I\/O device.<\/p>\n<p><strong>WR (Write) <\/strong>\u2013 Tri-state output active low, indicates that the BUS contains valid data to be written to memory or an I\/O device.<\/p>\n<p><strong>RFSH (Refresh)<\/strong> \u2013 Low active output, used for dynamic memories. Indicates that there is a valid address for refresh on the least significant bits of the address bus.<\/p>\n<p><strong>HALT<\/strong> \u2013 Output, active low. Indicates that the CPU has executed a HALT instruction and is waiting for a non-maskable or maskable interrupt signal (if the latter has been previously enabled) to be able to resume program execution. As long as the halt state persists, the CPU continuously executes NOP (No Operation) instructions to maintain the refresh activity as the continuation of this state could lead to the loss of the data contained in the dynamic memories.<\/p>\n<p><strong>WAIT<\/strong> \u2013 Input, active low. WAIT tells the CPU that the memory or I\/O device is not ready for a data transfer. As long as this signal is active the CPU remains in a waiting state. This signal allows I\/O or memory devices of any speed to synchronize with the CPU speed and remains active as long as the unavailability situation persists.<\/p>\n<p><strong>INT <\/strong>(Abort Request) \u2013 Input, active low. The interrupt request signal is generated by the I\/O devices. The request is satisfied at the end of the instruction in progress, when the executing program foresees it, under the two conditions: \u2013 the internal interrupt enabling flip-flop (IFF) controlled by the software is enabled: \u2013 The BUSRQ signal is not is active. When the CPU accepts the interrupt, an interrupt acknowledge signal (IORQ at the same time as M1) is sent at the beginning of the next interrupt read cycle. The CPU can respond to the interrupt in three different ways: mode 0, 1, 2.<\/p>\n<p><strong>NMI (Non-Maskable Interruption) <\/strong>\u2013 Input, active on the falling edge. The non-maskable interrupt request line has higher priority than the INT line and is active at the end of the current instruction, regardless of the state of the interrupt enable flip flop.<\/p>\n<p><strong>RESET <\/strong>- Entrance. Initializes the CPU: resets the PC, I and R registers. Arranges interrupt management in 0 mode.<\/p>\n<p><strong>BUSRQ (Bus Request) <\/strong>\u2013 Input, active low. The signal is used to request the CPU to place the address bus, data bus, and output control signals in the high impedance state, so that these lines can be controlled by the requesting device. When BUSRQ is activated, the CPU places the bus in the high impedance state at the end of the current machine cycle.<\/p>\n<p><strong>BUSAK (Bus Awareness)<\/strong> \u2013 Output, active low. This signal is used to indicate to the requesting device that the address bus, data bus, and tri-state control signals of the CPU buses have been placed in the high impedance state and that the external device can control these lines.<\/p>\n<p><strong>CLOCK<\/strong> \u2013 Single phase input.<\/p>\n<p>If you are interested you can find it here <a href=\"https:\/\/msxitalia.org\/en\/temporizzazioni-della-cpu-z80\/\">fourth dispensation<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Questa che vi apprestate a leggere \u00e8 una dispensa e non certamente un libro e quindi non ha la pretesa di essere esaustiva e autosufficiente. Questa pu\u00f2 essere affiancata alla documentazione che \u00e8 possibile reperire facilmente sia in forma cartacea sia in forma digitale. Per la stesura di questa dispensa oltre alle ovvie informazioni che [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":5737,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[6,26],"tags":[],"dipi_cpt_category":[],"class_list":["post-5762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hardware","category-z80"],"_links":{"self":[{"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/posts\/5762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/comments?post=5762"}],"version-history":[{"count":7,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/posts\/5762\/revisions"}],"predecessor-version":[{"id":5881,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/posts\/5762\/revisions\/5881"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/media\/5737"}],"wp:attachment":[{"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/media?parent=5762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/categories?post=5762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/tags?post=5762"},{"taxonomy":"dipi_cpt_category","embeddable":true,"href":"https:\/\/msxitalia.org\/en\/wp-json\/wp\/v2\/dipi_cpt_category?post=5762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}