Difference between revisions of "Bus Phases"

From Intellivision Wiki
Jump to: navigation, search
(add transaction tables)
Line 3: Line 3:
 
* Whether the value's an address or data
 
* Whether the value's an address or data
 
* Whether the current access is a read or a write
 
* Whether the current access is a read or a write
 +
 +
==Bus Phases==
  
 
The following table describes the CP1610's various bus phases.
 
The following table describes the CP1610's various bus phases.
Line 72: Line 74:
 
<br/>
 
<br/>
 
<P>The CP-1600's bus transactions typically last between 4 and 7 CPU cycles.  Half of these cycles are <TT>NACT</TT> cycles, inserted as spacing cycles between the activity cycles.  As a general rule, there is a <TT>NACT</TT> cycle inserted after every cycle EXCEPT in two specific cases.  The first is between <TT>DW</TT> and <TT>DWS,</TT> which always occur back-to-back.  The second is during an indirect access after an <TT>SDBD</TT> instruction, where the CPU omits <TT>NACT</TT> states after both <TT>DTB</TT>s.</P>
 
<P>The CP-1600's bus transactions typically last between 4 and 7 CPU cycles.  Half of these cycles are <TT>NACT</TT> cycles, inserted as spacing cycles between the activity cycles.  As a general rule, there is a <TT>NACT</TT> cycle inserted after every cycle EXCEPT in two specific cases.  The first is between <TT>DW</TT> and <TT>DWS,</TT> which always occur back-to-back.  The second is during an indirect access after an <TT>SDBD</TT> instruction, where the CPU omits <TT>NACT</TT> states after both <TT>DTB</TT>s.</P>
 +
 +
==Transaction Types==
 
<P>The tables below illustrate the various bus transations, complete with a cycle-by-cycle description of the transaction.</P>
 
<P>The tables below illustrate the various bus transations, complete with a cycle-by-cycle description of the transaction.</P>
 +
 +
 +
===Instruction Fetch or Indirect/Immediate-Mode Data Read===
 
<TABLE BORDER=1 WIDTH=100%>
 
<TABLE BORDER=1 WIDTH=100%>
<TR>
 
<TH COLSPAN=3 BGCOLOR=#EEEEEE>Instruction Fetch or Indirect/Immediate-Mode Data Read
 
</TH>
 
</TR>
 
 
<TR>
 
<TR>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
Line 108: Line 111:
 
</TR>
 
</TR>
 
</TABLE>
 
</TABLE>
<br/><br/>
+
 
 +
 
 +
===Indirect/Immediate Addressing Mode Read with SDBD===
 
<TABLE BORDER=1 WIDTH=100%>
 
<TABLE BORDER=1 WIDTH=100%>
 
<TR>
 
<TR>
<TH COLSPAN=3 BGCOLOR=#EEEEEE>Indirect/Immediate-Mode Data Write
+
<TH BGCOLOR=#CCDDEE>Cycle</TH>
</TH>
+
<TH BGCOLOR=#CCDDEE>Phase</TH>
 +
<TH BGCOLOR=#CCDDEE>Description</TH>
 +
</TR>
 +
<TR>
 +
<TH BGCOLOR=#EEEEEE>1</TH>
 +
<TH BGCOLOR=#EEEEEE><TT>BAR</TT></TH>
 +
<TD BGCOLOR=#EEEEEE>CPU asserts address of the lower byte of Data to read.  Devices should latch the address at this time and perform address decoding.  </TD>
 +
</TR>
 +
<TR>
 +
<TH BGCOLOR=#CCDDEE>2</TH>
 +
<TH BGCOLOR=#CCDDEE><TT>NACT</TT></TH>
 +
<TD BGCOLOR=#CCDDEE>The CPU deasserts the bus, and no other bus activity occurs during this cycle.  </TD>  
 
</TR>
 
</TR>
 +
<TR>
 +
<TH BGCOLOR=#EEEEEE>3</TH>
 +
<TH BGCOLOR=#EEEEEE><TT>DTB</TT></TH>
 +
<TD BGCOLOR=#EEEEEE>The addressed device asserts its data on the bus.  The CPU then reads this data. </TD>
 +
</TR>
 +
<TR>
 +
<TH BGCOLOR=#EEEEEE>4</TH>
 +
<TH BGCOLOR=#EEEEEE><TT>BAR</TT></TH>
 +
<TD BGCOLOR=#EEEEEE>The device deasserts the bus during the first quarter of this cycle, and the CPU asserts a new address for the upper byte of Data during the latter half of this cycle.  Notice that there is no <TT>NACT</TT> spacing cycle before this <TT>BAR</TT>!</TD>
 +
</TR>
 +
<TR>
 +
<TH BGCOLOR=#CCDDEE>5</TH>
 +
<TH BGCOLOR=#CCDDEE><TT>NACT</TT></TH>
 +
<TD BGCOLOR=#CCDDEE>The CPU deasserts the bus, and no other bus activity occurs during this cycle. </TD>
 +
</TR>
 +
<TR>
 +
<TH BGCOLOR=#EEEEEE>6</TH>
 +
<TH BGCOLOR=#EEEEEE><TT>DTB</TT></TH>
 +
<TD BGCOLOR=#EEEEEE>The addressed device asserts its data on the bus.  The CPU then reads this data.  As with cycle 3, there is <strong>no <TT>NACT</TT> spacing cycle</strong> after this cycle!</TD>
 +
</TR>
 +
</TABLE>
 +
 +
 +
===Indirect/Immediate-Mode Data Write===
 +
<TABLE BORDER=1 WIDTH=100%>
 
<TR>
 
<TR>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
Line 150: Line 191:
 
</TR>
 
</TR>
 
</TABLE>
 
</TABLE>
<br/><br/>
+
 
 +
 
 +
===Direct Addressing Mode Read===
 
<TABLE BORDER=1 WIDTH=100%>
 
<TABLE BORDER=1 WIDTH=100%>
<TR>
 
<TH COLSPAN=3 BGCOLOR=#EEEEEE>Direct Addressing Mode Read </TH>
 
</TR>
 
<TR>
 
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
 
<TH BGCOLOR=#CCDDEE>Phase</TH>
 
<TH BGCOLOR=#CCDDEE>Phase</TH>
Line 191: Line 230:
 
</TR>
 
</TR>
 
</TABLE>
 
</TABLE>
<br/><br/>
+
 
 +
 
 +
===Direct Addressing Mode Write===
 
<TABLE BORDER=1 WIDTH=100%>
 
<TABLE BORDER=1 WIDTH=100%>
<TR>
 
<TH COLSPAN=3 BGCOLOR=#EEEEEE>Direct Addressing Mode Write</TH>
 
</TR>
 
 
<TR>
 
<TR>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
Line 237: Line 275:
 
</TR>
 
</TR>
 
</TABLE>
 
</TABLE>
<br/><br/>
+
 
<TABLE BORDER=1 WIDTH=100%>
+
 
<TR>
+
===Interrupt Processing===
<TH COLSPAN=3 BGCOLOR=#EEEEEE>Indirect/Immediate Addressing Mode Read with <TT>SDBD</TT></TH>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#CCDDEE>Cycle</TH>
 
<TH BGCOLOR=#CCDDEE>Phase</TH>
 
<TH BGCOLOR=#CCDDEE>Description</TH>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#EEEEEE>1</TH>
 
<TH BGCOLOR=#EEEEEE><TT>BAR</TT></TH>
 
<TD BGCOLOR=#EEEEEE>CPU asserts address of the lower byte of Data to read.  Devices should latch the address at this time and perform address decoding.  </TD>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#CCDDEE>2</TH>
 
<TH BGCOLOR=#CCDDEE><TT>NACT</TT></TH>
 
<TD BGCOLOR=#CCDDEE>The CPU deasserts the bus, and no other bus activity occurs during this cycle.  </TD>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#EEEEEE>3</TH>
 
<TH BGCOLOR=#EEEEEE><TT>DTB</TT></TH>
 
<TD BGCOLOR=#EEEEEE>The addressed device asserts its data on the bus.  The CPU then reads this data. </TD>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#EEEEEE>4</TH>
 
<TH BGCOLOR=#EEEEEE><TT>BAR</TT></TH>
 
<TD BGCOLOR=#EEEEEE>The device deasserts the bus during the first quarter of this cycle, and the CPU asserts a new address for the upper byte of Data during the latter half of this cycle.  Notice that there is no <TT>NACT</TT> spacing cycle before this <TT>BAR</TT>!</TD>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#CCDDEE>5</TH>
 
<TH BGCOLOR=#CCDDEE><TT>NACT</TT></TH>
 
<TD BGCOLOR=#CCDDEE>The CPU deasserts the bus, and no other bus activity occurs during this cycle. </TD>
 
</TR>
 
<TR>
 
<TH BGCOLOR=#EEEEEE>6</TH>
 
<TH BGCOLOR=#EEEEEE><TT>DTB</TT></TH>
 
<TD BGCOLOR=#EEEEEE>The addressed device asserts its data on the bus.  The CPU then reads this data.  As with cycle 3, there is no <TT>NACT</TT> spacing cycle after this cycle!</TD>
 
</TR>
 
</TABLE>
 
<br/><br/>
 
 
<TABLE BORDER=1 WIDTH=100%>
 
<TABLE BORDER=1 WIDTH=100%>
 
<TR>
 
<TR>
Line 316: Line 315:
 
<TH BGCOLOR=#EEEEEE>6</TH>
 
<TH BGCOLOR=#EEEEEE>6</TH>
 
<TH BGCOLOR=#EEEEEE><TT>IAB</TT></TH>
 
<TH BGCOLOR=#EEEEEE><TT>IAB</TT></TH>
<TD BGCOLOR=#EEEEEE>An external device asserts the new program counter address (the address of the interrupt service routine) on the bus.  The CPU latches this address and transfers it to the program counter.  On the Intellivision, one of the EXEC ROMs handles the program counter address assertion.</TD>
+
<TD BGCOLOR=#EEEEEE>An external device asserts the new program counter address (the address of the interrupt service routine) on the bus.  The CPU latches this address and transfers it to the program counter.  On the Intellivision, one of the EXEC's ROM chips asserts the reset and interrupt addresses for the CPU.</TD>
 
</TR>
 
</TR>
 
<TR>
 
<TR>

Revision as of 20:03, 14 January 2005

The CP1610 defines several "bus phases." These are the transaction types indicated on the BC1, BC2 and BDIR pins of the CPU. Peripherals decode the bus phase to determine the following, among other things:

  • Whether there's a valid value on the bus
  • Whether the value's an address or data
  • Whether the current access is a read or a write

Bus Phases

The following table describes the CP1610's various bus phases.

General Instruments Bus Protocol
BDIR BC2 BC1 Mnemonic Name Description
000NACT No ACTion During this stage, no device is active on the bus. DB0 through DB15 are allowed to float, with their previous driven value fading away during this phase.
001ADAR Address Data to Address Register This bus phase is issued by the CPU during a Direct Addressing Mode instruction. Prior to this phase, an address will have been latched in a device by a prior BAR or ADAR bus phase. Then, during this phase, the currently selected device responds with its data on the bus, and at the end of this phase, all devices should latch this address as the address for the next memory access (DTB, DW, or DWS phases). The CPU asserts nothing during this phase -- rather, it expects the currently addressed device to inform the rest of the machine of the address for the next access.
010IAB Interrupt Address to Bus This bus phase is entered during interrupt processing, after the current program counter has been written to the stack. It's also entered into on the first cycle after coming out of RESET. During this phase, an external device should assert the address of the Interrupt or RESET vector as appropriate. The CPU then moves this address into the program counter and resumes execution.
011DTB Data To Bus This phase is entered during a read cycle. During this phase, the currently addressed device should assert its data on the bus. The CPU then reads this data.
100BAR Bus to Address Register During this phase, the CPU asserts the address for the current memory access. All devices on the bus are expected to latch this address and perform address decoding at this time.
101DW Data Write The DW and DWS bus phases initiate a write cycle. They always occur together on adjacent cycles, with data remaining stable on the bus across the transition from DW to DWS. During these phases, the data being written is available for external memories to latch. The CP-1600 allows two full CPU cycles for external RAM to latch the data.
110DWS Data Write Strobe
111INTAK INTerrupt AcKnowledge The CPU enters this bus phase on the first cycle of interrupt processing. During the phase, the CPU places the current stack pointer value on the bus as it prepares to "push" the current program counter on the stack. Devices are expected to treat INTAK similarly to a BAR bus phase. Indeed, on the Intellivision Master Component, only the 16-bit System RAM sees the INTAK bus phase. It uses this bus phase to trigger a special bus-copy mode as well as for latching the current address. For all other devices in the system, INTAK is remapped to BAR by some discrete logic, and so is processed as a normal addressing cycle elsewhere.


The CP-1600's bus transactions typically last between 4 and 7 CPU cycles. Half of these cycles are NACT cycles, inserted as spacing cycles between the activity cycles. As a general rule, there is a NACT cycle inserted after every cycle EXCEPT in two specific cases. The first is between DW and DWS, which always occur back-to-back. The second is during an indirect access after an SDBD instruction, where the CPU omits NACT states after both DTBs.

Transaction Types

The tables below illustrate the various bus transations, complete with a cycle-by-cycle description of the transaction.


Instruction Fetch or Indirect/Immediate-Mode Data Read

Cycle Phase Description
1 BAR CPU asserts address of the Instruction or Data to read. Devices should latch the address at this time and perform address decoding.
2 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
3 DTB The addressed device asserts its data on the bus. The CPU then reads this data.
4 NACT The device deasserts the bus, and no other bus activity occurs during this cycle.


Indirect/Immediate Addressing Mode Read with SDBD

Cycle Phase Description
1 BAR CPU asserts address of the lower byte of Data to read. Devices should latch the address at this time and perform address decoding.
2 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
3 DTB The addressed device asserts its data on the bus. The CPU then reads this data.
4 BAR The device deasserts the bus during the first quarter of this cycle, and the CPU asserts a new address for the upper byte of Data during the latter half of this cycle. Notice that there is no NACT spacing cycle before this BAR!
5 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
6 DTB The addressed device asserts its data on the bus. The CPU then reads this data. As with cycle 3, there is no NACT spacing cycle after this cycle!


Indirect/Immediate-Mode Data Write

Cycle Phase Description
1 BAR CPU asserts address of the Data to write. Devices should latch the address at this time and perform address decoding.
2 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
3 DW The CPU asserts the data to be written. The addressed device can latch the data at this time, although it is not necessary yet, as the data is stable through the next phase.
4 DWS The CPU continues to assert the data to be written. The addressed device can latch the data at this time if it hasn't already.
5 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.


Direct Addressing Mode Read

</TR>

Cycle Phase Description
1 BAR CPU asserts address of the Instruction or Data to read. Devices should latch the address at this time and perform address decoding.
2 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
3 ADAR The addressed device asserts the data that is at the location addressed during BAR. This data is then latched as an address by all devices for a subsequent DTB bus phase. The CPU remains off the bus during this cycle.
4 NACT The device deasserts the bus, and no other bus activity occurs during this cycle.
5 DTB The newly-addressed device (the one whose address was given during ADAR) asserts its data on the bus. The CPU then reads this data.
6 NACT The device deasserts the bus, and no other bus activity occurs during this cycle.


Direct Addressing Mode Write

Cycle Phase Description
1 BAR CPU asserts address of the Data to write. Devices should latch the address at this time and perform address decoding.
2 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
3 ADAR The addressed device asserts the data that is at the location addressed during BAR. This data is then latched as an address by all devices for subsequent DW and DWS bus phase. The CPU remains off the bus during this cycle.
4 NACT The device deasserts the bus, and no other bus activity occurs during this cycle.
5 DW The CPU asserts the data to be written. The newly-addressed device (the one whose address was given during ADAR) can latch the data at this time, although it is not necessary yet, as the data is stable through the next phase.
6 DWS The CPU continues to assert the data to be written. The addressed device can latch the data at this time if it hasn't already.
7 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.


Interrupt Processing

Interrupt Processing
Cycle Phase Description
1 INTAK The CPU asserts the current Stack Pointer address (the value in R6), and increments the stack pointer internally. Devices are expected to latch this address and decode it internally. Also, devices are expected to take any special interrupt-acknowledgement steps at this time. (On the Intellivision, this bus phase is remapped to BAR for most devices. The only device that sees INTAK is the 16-bit System RAM.)
2 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
3 DW The CPU outputs the current program counter address. The device addressed during INTAK should latch the data either now or during the next cycle (DWS).
4 DWS The CPU continues to assert the current program counter address. If the addressed device hasn't done so already, it should latch the data now.
5 NACT The CPU deasserts the bus, and no other bus activity occurs during this cycle.
6 IAB An external device asserts the new program counter address (the address of the interrupt service routine) on the bus. The CPU latches this address and transfers it to the program counter. On the Intellivision, one of the EXEC's ROM chips asserts the reset and interrupt addresses for the CPU.
7 NACT The device deasserts the bus, and no other bus activity occurs during this cycle.