® MOTOROLA Advance Information SYNCHRONOUS ADDRESS MULTIPLEXER The SN74LS783/MC6883 brings together the MC6809E (MPU), the MC6847 (Color Video Display Generator} and dy- namic RAM to form a highly effective, compact and cost ef- fective computer and display system. • MC6809E, MC6800, MC6801E, MC68000 and MC6847 (VDG) Compatible • Transparent MPU/VDG/Refresh • RAM size — 4K, 8K, 16K, 32K or 64K Bytes (Dynamic or Static) • Addressing Range — 96K Bytes • Single Crystal Provides All Timing • Register Programmable: VDG Addressing Modes VDG Offset (0 to 64K) RAM Size Page Switch MPU Rate (Crystal ■*■ 16 or + 8) MPU Rate (Address Dependent or Independent) • System "Device Selects" Decoded 'On Chip' • Timing is Optimized for Standard Dynamic RAMs • +5.0 V Only Operation • Easy Synchronization of Multiple SAM Systems • DMA Mode SYSTEM BLOCK DIAGRAM j£ Device Selects <^ <= R/W E To Q ROMs and MC6809E I/O MPU XEZ TV Display Section is Optional SN74LS783/ MC6883 SAM Z0-Z7 CAS "7"? > iSJI= »|cik -jDAO -]hs ' - 14 MHz Data R"AS" WE DYNAMIC RAM 4K, 8K. 16K 32K or 64K BYTES L 3z:: J SN74LS273J] [" MC 1372 ~! j or RGB Ckt. j I * 1 Data) COLOR (OR B/W) TV O o I SN74LS783 MC6883 SYNCHRONOUS ADDRESS MULTIPLEXER LOW POWER SCHOTTKY 1 W ' N SUFFIX 1 PLASTIC PACKAGE CASE 711 Iff 1 J SUFFIX CERAMIC PACKAGE CASE 734 PIN ASSIGNMENT 1 LZ A11 vcc ZD 40 2 LZ A10 A12 Z2 39 3CZ A9 A13 Z3 38 4CZ A8 A14 Z3 37 5C 6C OsC| n Oscout A15 Z7 Zl 36 ZD 35T Oscillator-ln JT to Oscillator-Out^- (Cl = 195 pF) AO thru A15 to ZO, Z1, Z2 thru Z7 (Cl = 30 pF) AO thru A15, R/W to SO, S1, S3 (Cl = 95 pF) Oscillator-Out "X. to RASO _rf~ (Cl = 95 pF) Oscillator-Out "Xto RASO "X (Cl = 95 pF) Oscillator-Out X.to RAS1 JT (Cl = 95 pF) Oscillator-Out ~^to RAS1 "X. (Cl = 195 pF) Oscillator-Out "X. to CAS JT (Cl = 195 pF) Oscillator-Out "V to CAS "X (Cl = 195 pF) Oscillator-Out"^ to WE JT (Cl = 195 pF) Oscillator-Out ~*L to WE "X (Cl = 100 pF) Oscillator-Out "Xto E JT (Cl = 100 pF) Oscillator-Out ~^to E X. (Cl = 100 pF) Oscillator-Out X. to Q-f (C|_« = 100 pF) Oscillator-Out "Xto Q "X (Cl = 30 pF) Oscillator-Out JT to VCIk jT (Cl = 30 pF) Oscillator-Out jT to VCIk "X (Cl = 195 pF) Oscillator-Out ~<_ to Row Address (Cl = 195 pF) Oscillator-Out "Xto Column Address (Cl = 15 pF) Oscillator-Out "Xto DAO _*" Earliest 0) (Cl = 15 pF) Oscillator-Out "X to DAO _rf~ Latest! 1) (Cl = 95 pF on RAS, C|_ = 195 pFon CAS) CAS "Xto RAS JT td(OL-OH) td(OH-OL) - 3.0 20 - ns td(A-Z) td(A-S) — 28 18 — td(OL-ROH) td(OL-ROL) 20 18 td(OL-R1H) td(OL-R1L). 22 20 td (OL-CH) td(OL-CL) 20 20 td(OL-WH) td(OL-WL) 22 40 — td(OL-EH) td(OL-EL) 55 * 25 — td(OL-QH) td(OL-QL) — 55 25 — td(OH-VH) td(OH-VL) 50 65 — td(OL-AR) td(OL-AC) 36 33 — td(OL-DH) td(OL-DH) — -15 + 15 td(CL-RH) — 208 — Setup Time for A0 thru A15, R/W Rate = ■+• 16 Rate = h- 8 tsu(A) — 28 28 — ns Hold Time for A0 thru A15, R/W Rate = -16 Rate = + 8 l h(A) — 30 30 ns Width of HS Low 2 *wL(HS) 2.0 5.0 6.0 u.s Notes: 1. When using the SAM with an MC6847, the rising edge of DAO is confined within the range shown in the timing diagrams (unless the synchronizing process is incomplete.) The synchronization process requires a maximum of 32 cycles of Oscrjut for completion. 2- tWL(HS) wider than 6.0 fis may yield more than 8 sequential refresh addresses. FIGURE 1 — PROPAGATION DELAY TIMES VERSUS LOAD CAPACITANCE 40 1 30 td(OL-RIL) 2 iJ-H £ 20 2 _^ ^ fr s'd(0L -CL) | 10 < &- \ (OL-ROL) 2 2 o a. , 50 100 200 300 400 Cl, LOAD CAPACITANCE (pF) 4-632 SN74LS783-MC6883 PIN DESCRIPTION TABLE Name No. Function 9 * a. vcc 40 Apply + 5 volts ± 5%. SAM draws less than 230 mA. Gnd 20 I Return Ground for +5 volts. A15 36 Most Significant Bit. A14 37 A13 38 MPU address bits A0-A15. These 16 signals come directly from the MPU and are used to o A12 39 directly address up to 64K memory locations or to indirectly address up to 96K memory A11 1 locations. (See pages 17 and 18 for memory maps). Each input is approximately equivalent o u A10 2. to one low power Schottky load. A9 3 e A8 4 «» A7 24 • A6 23 m c ■5 A5 22 £ < A4 21 3 D A3 19 a c a. 2 A2 A1 18 17 AO 16 Least Significant Bit. R/W 15 MPU READ or WRITE. This signal comes directly from the MPU and is used to enable writing to the SAM control register, dynamic RAM (via WE), and to enable device select #0. Osc| n 5 Apply 14.31818* MHz crystal and 2.5-30 pF trimmer to ground. See page 12. DAO 8 Display Address DAO. The primary function of this pin is to input the least significant bit of a 16-bit video display address. The more significant 15-bits are outputs from an internal 15-bit counter which is clocked by DAO. The secondary function of this pin is to indirectly input the 9 c logic level of the VDG "FS" (field synchronization pulse) for vertical video address updating. HS 9 Horizontal Synchronization. The primary function of this pin is to detect the falling edge of > o u VDG "HS" pulse in order to initiate eight dynamic RAM refresh cycles. The secondary function is to reset up to 4 least significant bits of the internal video address counter. VCIk 7 VDG Clock. The primary function of this pin is to output a 3.579545 MHz square wave** to the VDG "Clk" pin. The secondary function resets the SAM when this VCIk pin is pulled to logic "0" level, acting as an input. OscQut 6 Apply 1.5 kfi resistor to 14.31818* MHz crystal and 33 pF capacitor to ground. See page 12. S2 25 Most Significant Bit (Device Select Bits). The binary value of S2, S1, SO selects one of eight ° o S1 26 "chunks" of MPU address space (numbers through 7). Varying in length, these "chunks" provide efficient memory mapping for ROMs, RAMs, Input/Output devices, and MPU Vectors. j* (Pi Q (0 (Requires 74LS 138-type demultiplexer). SO 27 Least Significant Bit. — 2 E 14 E (Enable Clock) "E" and "Q" are 90° out of phase and are both used as MPU clocks for the 3 * * 2 MC6809E. For the MC6800 and MC6801E, only "E" is used. "E" is also used for many MC6800 40 5-2 o peripheral chips. c 3 Q 13 Q (Quadrature Clock). Z7t 35 Most Significant Bit a Z6t 34 First, the least significant address bits from the MPU or "VDG" are presented to Z0-Z5 (4K 3 O *i _ •» < -is, Z5t 33 x 1 RAMs) or Z0-Z6 (16K x 1 RAMs) or Z0-Z7 (64K x 1 RAMs). Next, the most significant Z4t 32 address bits from the MPU or "VDG" are presented to Z0-Z5 (4K x 1 RAMs) or Z0-Z6 s si Z3t 31 (16K x 1 RAMs) or Z0 -Z7 (64K x 1 RAMs). Note that for 4K x 1 and 16K x 1 RAMs, Z7 (Pin <, Z2t 30 35) is not needed for address information. Therefore, Pin 35 is used for a second row Z1t 29 address select which is labeled (RAS1). ZOt 28 Least Significant Bit. RASIt 35 Row Address Strobe One. This pulse strobes the least significant 6,7 or 8 address bits into _ dynamic RAMs in Bank #1. ss RASOt 12 Row Address Strobe Zero. This pulse strobes the least significant 6,7 or 8 address bits into < c c o u dynamic RAMs in Bank #0. CASt 11 Column Address Strobe. This pulse strobes the most significant 6,7 or 8 address bits into dynamic RAMs. WEt 10 Write Enable. When low, this pulse enables the MPU to write into dynamic RAM. *14.31818 MHz is 4 times 3.579545 MHz television color subcarrier. Other frequencies may be used. (See page 12.) ••When VDG and SAM are not yet synchronized the "square wave" will stretch (see page 10.) t Due to fast transitions, ferrite beads in series with these outputs may be necessary to avoid high frequency (» 60 MHz) resonances. 4-633 SN74LS783*MC6883 o -I CO II 3 2 <0 2 > < 2 3 4-634 SN74LS783»MC6883 3 5 oc o u. > < a z c a ! f f ft TT TT TT ft T T S>| OUTPUT BE VALID WILL BE VALID GE FROM H TO L WILL CHANGE FROM H TO L QE FROM L TO H WILL CHANGE FROM L TO H HANGE PERMITTED STATE UNKNOWN \ II 3fc* I d Q 5 X y i Q s >1 9 ' J d s ?3 i I 1 1 d 5 1 T s ■o « a j=i • d -?2 s = !M d - ° " ■- n *=.= ill .fis i i in I 4 i 8 2 z i 1 | ♦ | d O ! d c d ! UL i ,.., .... AVOH(C) 'Timing points marked with "*" are defined elsewhere (specifically, 8 cycles of "OscQut" to Notes 1 : In the "fast MPU rate" mode, the time slot otherwise used for a VDG address is use 2: The period of "VCIk" is four times that of "OscQut" unless the synchronization pro Also. VCIk may rise within l d(OH-VH) nanoseconds of tO, t1. t2 or tF. \ J| i : i i I Z X U 4 r i i ? I.' O o ! o a £ ; h- t 1 k c c j o J i, I •> 5 > o Ji , u ° 1 ■ 2 3 | > i ! d t i 4 ) "Tl 1" ♦ -if o < i 5 O o o i J i > i ! 1 ! L > I'ki'i ° I " ♦ i l\ 111 BS 4-635 SN74LS783*MC6883 FIGURE 4 - SAM BLOCK DIAGRAM S2 S1 SO n n n VP IR ,HR IER. LI Li LU LI LJ LI U LJ RA81/27 Z6 ZB Z4 Z3 Z2 Z1 ZO U U u RA80 CA8 WE 8m Taxt . , . Pag* 6. 4-636 SN74LS783*MC6883 SAM BLOCK DIAGRAM DESCRIPTION MPU Addresses (AO - A15): These 16 signals come directly from the MPU and are used to directly address up to 64K memory locations (K = 1024) or to indirectly address up to 96K memory locations, by using a paging bit "P" (see pages 17 and 18 for memory maps.) Each input is approximately equivalent to one low power Schottky load. VDG Address Counter (BO - B15): These 16 signals are derived from one input (DAO) which is the least significant bit of the VDG address. Most of the counter is simply binary. However, to duplicate the various addressing modes of the MC6847 VDG, ADDRESS MODIFIER logic is used. Selected by three VDG mode bits (V2, V1, and VO) from the SAM CONTROL REGISTER, eight address modifications are obtained as shown in Figure 5. Also, notice that bits B9-B15 may be loaded from bits F0-F6 from the CONTROL REGISTER. This allows the starting address of the VDG display to be offset (in ViK increments) from $0000 to $FFFFt . B9-B15 are loaded when a VERTICAL PRE-LOAD(VP) pulse is generated. VP goes active (high) when HS from the VDG rises if DAO is high (or a high impedance.) This condition should occur only while the TV electron beam is in vertical blanking and is simply implemented by connecting FS and MS together on the MC6847. The VP pulse also clears bits B1 - B8. Finally, a HORIZONTAL RESET (HR) pulse may also affect the counter by clearing bits B1 - B3 or B1 - B4 when HS from the VDG is LOW (see Figure 5.) The HR pulse should occur only while the TV electron beam is in horizontal blanking. In summary, DAO clocks the VDG ADDRESS COUNTER; HR initializes the horizontal portion and VP initializes the vertical portion of the VDG ADDRESS COUNTER. REFresh Address Counter (CO - C6): A seven bit binary counter with outputs labeled CO - C6 supplies bursts of eight* sequential addresses triggered by a HS high to low transition. Thus, while the TV electron beam is in horizontal blanking, eight sequential addresses are accessed. Likewise, the next eight addresses are accessed during the next horizontal blanking period, etc. In this manner, all 128 addresses are refreshed in less than 1.1 milliseconds. Address Multiplexer: Occupying a large portion of the block diagram in Figure 4, is the address multiplexer which outputs bits Z0-Z7 (as addresses to dynamic RAM's.) Inputs to the address multiplexer include the VDG address (BO - B15) the REFresh address (CO- C6) and the MPU address (AO - A15) or (AO - A14 plus one paging bit "P".) The paging bit "P" is one bit in the SAM CONTROL REGISTER that is used in place of A15 when memory map TYpe #0 is selected (via the SAM CONTROL REGISTER "TY" bit.) Figure 6 shows which i nputs are routed to Z0 - Z7 and when the routing occurs relative to one SAM machine cycle. Notice that Z7 and RAS1 share the same pin. Z7 is selected if "M1" in the SAM CONTROL REGISTER IS HIGH (Memory size = 64K.) Address Decode: At the top left of Figure 4, is the Address Decode block. Outputs S2, S1, and SO form a three bit encoded binary word(S). Thus S may be one of eight values (0 through 7) with each value representing a different range of MPU addresses. (To enable peripheral ROM's or I/O, decode the S2, S1, and SO bits into eight seperate signals by using a 74LS138, 74LS155 or 74LS156. Notice that S2, S1, and SO are not gated with any timing signals such as E or Q.) Along with the A5 - A15 inputs is the MEMORY MAP TYpe bit (TY.) This bit is soft-programmable (as are all 16 bits in the SAM CONTROL REGISTER,) and selects one of two memory maps. Memory map #0 is intended to be used in systems that are primarily ROM based. Whereas, memory map #1 is intended for a primarily RAM based system with 64K contiguous RAM locations (minus 256 locations.) The various meanings of S2, S1, SO are tabulated in Figure 16 (page 19) and again on pages 17 and 18. _ In addition to S2, S1, and SO outputs is a decode of $FFCO through $FFDF which, when gated with E and R/W, results in the write strobe for the SAM CONTROL REGISTER. SAM Control Register As shown in Figure 4, the CONTROL REGISTER has 16 "outputs": VDG Addressing Modes: V2, V1, V0 MPU Rate: R1, R0 VDG Address Offset: F6, F5, F4, F3, F2, F1, F0 Memory Size (RAM): M1, M0 32K Page Switch: P Memory Map TYpe: TY When the SAM is reset (see page 10,) all 16 bits are cleared. To set any one of these 16 bits, the MPU simply writes to a unique** odd address (within $FFC1 through $FFDF.) To clear any one of these 16 bits, the MPU * If HS is held low longer than 8 p.s, then the number of sequential addresses in one refresh "BURST" is proportional to the time interval during which HS is low. ** See pages 17 or 18 for specific addresses. t In this document, the "$" symbol always proceeds hexidecimal characters. 8 4-637 SN74LS783»MC6883 simply writes to a unique** even address (within $FFCO through $FFDE.) Note that the data on the MPU data bus is irrevelant. Inputs to the control register include A4, A3, A2, A1 (which are. used to select which one of 16 bits is to be cleared or set), AO (which determines the polarity . . . clear or set,) and R/W, E and $FFCO - $FFDF (which restrict the method, timing and addresses for changing one of the 16 bits.) For more detailed descriptions of the purposes of the 16 control bits, refer to related sections in the BLOCK DIAGRAM DESCRIPTION (pages 8 through 12) and the PROGRAMMING GUIDE (pages 14 through 18). •* See pages 17 or 18 for specific addresses. FIGURE 5 — VDG ADDRESS MODIFIER Mode Division Variables Bits Cleared by HS (low) V2 V1 VO X Y B1-B4 B1-B3 1 1 12 3 1 1 1 1 1 3 2 1 B1-B4 B1-B3 1 1 1 1 2 1 1 B1-B4 B1-B3 1 1 1 1 1 1 1 1 1 B1-B4 None (DMA MODE) FIGURE 6 — SIGNAL ROUTING for ADDRESS MULTIPLEXER Memory Size Signal Source Row/Column Signals Routed to Z0-Z7 Timing (Figure 2) M1 MO Z7 Z6 Z5 Z4 Z3 Z2 Z1 ZO 4K MPU ROW * A6 A5 A4 A3 A2 A1 A0 T7-TA COL # * L A11 A10 A9 A8 A7 A6 TA-TF VDG ROW » B6 B5 B4 B3 B2 B1 B0 TF-T2 COL * L B11 B10 B9 B8 B7 B6 T2-T7 REF ROW * C6 C5 C4 C3 C2 C1 CO TF-T2 COL * L L L L L L L T2-T7 16K 1 MPU ROW * A6 A5 A4 A3 A2 A1 A0 T7-TA COL * A13 A12 A11 A10 A9 A8 A7 TA-TF VDG ROW * B6 B5 B4 B3 B2 B1 B0 TF-T2 COL » B13 B12 B11 B10 B9 B8 B7 T2-T7 REF ROW * C6 C5 C4 C3 C2 C1 CO TF-T2 COL # L L L L L L L T2-T7 64K (dynamic) 1 MPU ROW A7 A6 A5 A4 A3 A2 A1 A0 T7-TA COL P/A15*** A14 A13 A12 A11 A10 A9 A8 TA-TF VDG ROW B7 B6 B5 B4 B3 B2 B1 B0 TF-T2 COL B15 B14 B13 B12 B11 B10 B9 B8 T2-T7 REF ROW L C6 C5 C4 C3 C2 C1 CO TF-T2 COL L L L L L L L L T2-T7 64K (static) 1 1 MPU ROW A7 A6 A5 A4 A3 A2 A1 A0 T7-T9 COL P/A15»»* A14 A13 A12 A11 A10 A9 A8 T9-TF VDG ROW B7 B6 B5 B4 B3 B2 B1 B0 TF-T1 COL B15 B14 B13 B12 B11 B10 B9 B8 T1-T7 REF ROW L C6 C5 C4 C3 C2 C1 CO TF-T1 COL L L L L L L L L T1-T7 : 1" ImpHet logical LOW level. •27 functions at RA81 and Hs level is address dependent. For example, when using two banks of 16K x 1 RAMs, RA§6 is active for addresses $0000 to I3FFF and &A§1 is active for addresses $4000 to $7FFF. —If Map Type - 0. then page bit "P" is the output (otherwise A15). 4-638 SN74LS783«MC6883 Internal Reset By lowering Vqq below 0.6 volts for at least one millisecond, a complete SAM reset is initiated and is completed within 500 nanoseconds after Vcc rises above 4.25 volts. NOTE: In some applications, (for example, multiple "VDG-RAM" systems controlled by a single MPU) multiple SAM ICs can be synchronized as follows: • Drive all SAM's from one external oscillator. • Stop external oscillator. • Lower Vqq below 0.6 volts for at least 1.0 millisecond. • Raise Vcc to 5.0 volts. • Start external oscillator. • Wait at least 500 nanoseconds. Now, the "E" clocks from all SAM's should be in-phase. External Reset When the VCIk pin on SAM is forced below 0.8 volts for at least eight cycles of "oscillator-out", the SAM beco mes partially reset. That is, all bits in the SAM control register are cleared. However, signals such as RAS, CAS, WE, E or Q are not stopped (as they are with an internal reset), since the SAM must maintain dynamic RAM refresh even during this external reset period. Figure 7 shows how VCIk can be pulled low through diode D1 when node "A" is low.* When node "A" is high, only the backbiased capacitance of diode D1 loads the 3.58 MHz on VCIk. Diode D2 helps discharge C1 (Power-on-Reset capacitor) when power is turned off. Diode D3 allows the MPU reset time constant R2C2 to be greater than the SAM reset time constant. Thereby, ensuring release of the SAM reset prior to attempting to program the SAM control register. FIGURE 7 — EXTERNAL RESET CIRCUITRY 100 kn: Manual |6 System Reset Switch- ',i I 1 D3 " — ? 14 ° _L 0.1 ^F *T D1 rt T C1 M * h5.0 V Q > 100 kn l ? «•? - ZZZ cv 3sc| n ^> »-• 7T " Oscout 6 R1 -VW- ■T. i X1 CF ADJ. ^ Suggested Component Values Freq. MHz CV* CF« R1* ??2* «S* X1 14.31818 2.5-30 pF 33 PF 1.5 kn ~ 100K 10K * 16.0000 2.5-30 PF 33 PF 1.5 kn - 100K 10K * Recommended Crystal Parameters 14.31818 MHz** 16.0000 MHz** Rs 10 n ± 2.0 ft 10 ft ± 2.0 ft CO 5.0 pF ± 1.5 pF 6.0 pF ± 1.0 pF C1 0.0245 pF ± 15% 0.0319 pF ± 15% L1 5.05 mH 3.1 mH Q 50K ± 10K 40K ± 10K Calibration Tolerance: 0.002% at 26 C C Temperature Tolerance: 0.001% C C to 70°C s - A- FIGURE 10 — TTL CLOCK INPUT SAM MC6883 o2). Thus, when properly positioned, VDG and MPU RAM accesses interleave without contention as shown below: FIGURE 12 — MOTOROLA MPU WITH VDG TIMING VDG Address A (Approx E 'l C MSzil____J 1 I MPU Half I VDG Ha>f l ~ . y _- '^ , ^ MPU Address MPU Data MPU Address MPU Data Window Window This Interleaved Direct Memory Access (IDMA) is synchronized via the MC6883 by centering the VDG data window half-way between MPU data windows.** The result is a shared RAM system without MPU/VDG RAM access contention, with both MPU and VDG running uninterrupted at normal operating speed, each transparent to the other. RAM Refresh Dynamic RAM refresh is accomplished by accessing eight*** sequential addresses every 64*** microseconds until 128 consecutive addresses have been accessed. To avoid RAM access contention between REFRESH and MPU, each of the 128 refresh accesses occupies the "VDG half" of the interleaved DMA (IDMA). Furthermore, refresh accesses occur only during the television retrace period (at which time the VDG doesn't need to access RAM). In summary, the VDG, MPU and MC6883's Refresh Counter all transparently access the common dynamic RAM without contention or interruption. Why IDMA? Use of the interleaved direct memory access results in fast modification to variable portions of display RAM, by the MPU, without any distracting flashes on the screen (due to RAM access contention.) In addition, the MPU is not slowed down nor stopped by the MC6883; thereby, assuring accurate software timing loops without costly additional hardware timers. Furthermore, additional hardware and software to give "access permission" to the MPU is eliminated since the MPU may access RAM at any time. * Only 1 pin, (DAO) out of 40 pins is dedicated to the video display. ** See VDG synchronization (page 10) for more detail. *** When not using a MC6847, HS may be wired low for continuous transparent refresh. 4-642 SN74LS783*MC6883 "Systems On Silicon" Concept Total Timing For most applications, the SAM can supply complete system timing from its on-chip precision 14.31818 MHz oscillat or. T his includes buffered MP U clo cks (E and Q), VDG clock, color subcarrier (3.58 MHz), row address select (RAS), column address select (CAS) and write enable (WE). Total Address Decode For most applications, the SAM plus a "1 of 8 decoder" chip completely decodes I/O, ROM and RAM chip selects without wasting memory address space and without needlessly chopping-up contiguous address space. Chip selects are positioned in address space to allow three types of memory (RAM, local ROM and cartridge ROM) independent room for growth. For example, RAM may grow from address $0000-up, cartridge ROM may grow from address $FEFF-down and local ROM may grow from $FBFF-down. Alternately, if the application requires minimum ROM and maximum contiguous RAM, a second choice of two memory maps places RAM from $0000 to $FEFF. (See pages 17 and 18.) In both memory maps all I/O, MPU vectors, SAM control registers, and some reserved address spaces are efficiently contained between addresses $FF00 and $FFFF. How Much RAM? Using nine SAM pins (Z0 - Z7 and RASO) the following combinations require no additional address logic. FIGURE 13 — RAM CONFIGURATIONS Address: Chip Select: MSB LSB Z5Z4Z3Z2Z1Z0 fiASO Z5Z4Z3Z2Z1Z0 RAS1 ( = Z7) \ ~ ~ " - - One or two banks of 4K x 8 (like MCM4027's> Z6Z5Z4Z3Z2Z1Z0 RASO i Z6Z5Z4Z3Z2Z1Z0 RAS1 ( = Z7)C~ " " ~ ~ -One or two banks of 16K x 8 (like MCM4116's) Z7Z6Z5Z4Z3Z2Z1Z0 RASO One bank of 64K x 8 (like MCM6665's) PROGRAMMING GUIDE SAM — Programmability The SAM contains a 16-bit control register which allows the MC6809E to program the SAM for the following options: VDG Addressing Mode 3-bits ' VDG Address Offset 7-bits 32K Page Switch 1-bit MPU Rate 2-bits Memory Size 2-bits Map Type 1-bit Note that when the SAM is reset by first applying power or by manual hardware reset, t all control register bits are cleared (to a logic "0"). VDG Addressing Mode Three bits (V2, V1, V0) control the sequence of DISPLAY ADDRESSES generated by the SAM (which are used to scan dynamic RAM for video information). For example, if you wish to display Dynamic RAM data as INTERNAL ALPHANUMERICS VIDEO, you should program* the MC6847 for the INTERNAL ALPHANUMERICS MODE and CLEAR BITS V2, V1 and V0 in the SAM. The table on the following page summarizes the available modes: t See Figure 7 for manual reset circuit. t Typically, part of a PIA (MC6821) at location SFF22 is used to control MC6847 modes. (See MC6847 Data Sheet.) 4-643 SN74LS783«MC6883 Mode Type MC6847 Mode SAM Mode G/A GM2 GM1 GM« EXT/I CSS V2 VI vo Internal Alphanumerics X X X External Alphanumerics X X 1 X OSemigraphics — 4 X X X Semigraphics — 6 X X 1 X Semigraphics — 8* X X X 1 Semigraphics — 12* X X X 1 Semigraphics — 24* X X X 1 1 Full Graphics — 1C X 1 Full Graphics — 1R 1 X 1 Full Graphics — 2C 1 X , 1 Full Graphics — 2R 1 1 X 1 1 Full Graphics — 3C 1 X Full Graphics — 3R 1 1 X 1 Full Graphics — 6C 1 1 X 1 Full Graphics — 6R 1 1 1 X 1 Direct Memory Accesst X X X X X 1 1 *S8, S12, & S24 modes are not described in the MC6847 Data Sheet. See appendix "A" tDMA is identical to 6R except as shown in Figure 5 on page 9. VDG Address Offset Seven bits (F6 f F5, F4, F3, F2, F1 and FO) determine the Starting Address for the video display. The "Starting Address" is defined as "the address corresponding to data displayed in the Upper Left corner of the TV screen". The "Starting Address" is shown below in binary: F6 F5 F4 F3 F2 F1 FO o o | | I Most V. Significant Bit t Least / Significant -S Bit Note that the "Starting Address" may be placed anywhere within the 64K address space with a resolution of ViK (the size of one alphanumeric page). The F6-F0 bits take effect during the TV vertical synchronization pulse (i.e., when FS from MC6847 is low). Page Switch One bit (P1) is used "in place of" A15 from the MC6809E in order to refer access within $0000-$7FFF to one of two 32K byte pages of RAM. If the system does not use more than 32K bytes of RAM, P1 can be ignored.** **When using 4K x 1 RAMS, two banks of eight IC's are allowed. This accounts for Addresses $0000-1 FFF. Also, this same RAM can be addressed at $2000-$3FFF, $4000-$5FFF and $6000-$7FFF. 4-644 SN74LS783*MC6883 MPU Rate Two bits (R1, RO) control the clock rate to the MC6809E MPU. The options are: RATE (FREQUENCY OF "E" CLOCK) 0.9 MHz (Crystal Frequency + 16) Slow 0.9/1.8 MHz (Address Dependent Rate) 1.8 MHz (Crystal Frequency ■*• 8) Fast R1 (Typical Crystal Frequency = 14.31818 MHz) RO In the "address dependent rate" mode, accesses to $0000-$7FFF and $FF00-$FF1F are slowed to 0.9 MHz (crystal frequency ■*■ 16) and all other addresses are accessed at 1.8 MHz (crystal frequency -*• 8.) Memory Size Two bits (M1 and MO) determine RAM memory size. The options are: SIZE M1 MO One or two banks of 4K x 1 dynamic RAMs One or two banks of 16K x 1 dynamic RAMs One bank of 64K x 1 dynamic RAMs Up to 64K static RAM* 1 1 1 1 •Requires a latch for demultiplexing the RAM address. IMPORTANT! Note: Be sure to program the SAM for the correct memory size before using RAM (i.e., for a subroutine stack). Map Type One bit (TY) is used to select between two memory map configurations. Refer to pages 17, 18 and 19 for details. When using Map Type "TY = 1", only the "Slow" MPU rate may be used. Future versions of the SAM may allow use of all rates. Writing To The SAM Control Register Any bit in the control register (CR) may be set by writing to a specific unique address. Each bit has two unique addresses . . . writing to the even # address clears the bit and writing to the odd # address sets the bit. (Data on the data bus is irrelevant in this procedure.) The specific addresses are tabulated on pages 17 and 18. If desired, a short routine may be written to program the SAM CR "a word at a time". For example, the following routine copies "B" bits from "A" register to SAM CR addresses beginning with address "X". SAM1 46 ROR A 24 06 BCC SAM2 30 01 INX (LEAX1,X) A7 80 STA o,x+ 20 02 BRA SAM3 SAM2 A7 81 STA o,x + - SAM3 5A DEC B 26 F2 BNE SAM1 39 RTS c 7 6 5 4 3 2 1 th 4-645 SN74LS783*MC6883 FIGURE 14 — MEMORY MAP (TYPE #0) COUR8E FINE MC8809E «-_ 8 Address Bits f $$FFFF $FF00 RAM_ (S = if R/W = 1) (S = 7 if R/W = 0) --<$C000 -■<$A000 --($8000 --<$4000 16K -—/-■-<$ 1000 <$0000 Page 1 Page S2, 81, S0MC6809E Value Address t t Label Definitions FAST FAST , , |— A.D. ( Transparent [-SLOW ) Refresh MPU Addresses from $0000 to $7FFF Apply to page #1 if P1 = '1.' Address of "Upper-Left-Most Display Element = $0000 + (V4K» Offset) pG1C, G1R J H Al, AE, S4, S6 •Note: M.S. ■ Most Significant S > L.S. ■ Least Significant C '■ Set Bit Clear Bit Device Select value •May also be RAM (All bits are cleared whe 1 " 4xS2 + 2 n S1 ,AM is reset.) 1 xSO 4-646 SN74LS783*MC6883 FIGURE 15 — MEMORY MAP (TYPE #1) COUR8E FINE MC6809E Vectors, SAM Control, I/O, Boot ROM 7 MC6809E ^_ 8 Address Bits | 3-OSFFFF ^$FF00 (S = 3 If R/W =0) (S ■ If R/W =_1) (S=2*** If R/W = 0) (S = If R/W = 1) RAM 7SZ-,T.7-<$C000 \ ~™'IL — <$A000 if R/W = 0) (S = if L R/W =1) yd , onnn --<$8000 (S = Jf R/W = 1) (S = 7 Ji R/W = 0) <$0000 S2, S1, SO MC6809E Value Address t t Label Definitions ••Decode S2, S1, and SO with an open collector SN74LS156 and 'wire-or' state 7 with Btate 2. (See Appendix B for suggested decode circuit.) •••To avoid ROM enable during R/W - LOW^ the ROM at S - 2 must be gated with R/W. (See Appendix B for suggested decode circuit.) •Note: M.S. ■ Most Significant L.S. ■ Least Significant Bit ( ar Bit S 5 - Set Bit C ■ Clear 6 - Device Select value - 4 x S2 + 2 x S1 + 1 x SO (All bits are cleared when SAM is reset.) 18 4-647 SN74LS783*MC6883 FIGURE 16 — MEMORY ALLOCATION TABLE (Also, see the memory MAPs on pages 17 and 18.) Type # 0: (Primarily for ROM based systems) Address Range S = 4(S2) + 2 (SD + S0 S Value Intended Use $FFF2 to FFFF FFEO to FFF1 FFCO to FFDF FF60 to FFBF FF40 to FF5F FF20 to FF3F FFOOto FF1F COOO to FEFF AOOO to BFFF 8000 to 9FFF 0000 to 7FFF 2 2 7 7 6 5 4 3 2 1 if R/W = 1 7 if R/W =0 MC6809E Vectors: Reset , NMI, SWI, IRQ, FIRQ, SWI2, SWI3. Reserved for future MPU enhancements. SAM Control Register: V0, - V2, F0 - F6, P, R0, R1, M0, M1, TY. Reserved for future control register enhancements. I/O2: Input/Output (PIAs, ACIAs, etc.) To subdivide, use A0-A4. I/Oi : Input/Output (PIAs, ACIAs, etc.) To subdivide, use A0-A4. I/Oq: Input/Output (PIAs, ACIAs, etc.) To subdivide, use A0-A4. ROM2: 16K addresses. External cartridge ROM*. ROM1 : 8K addresses. Internal ROM*. Note that MC6809E vector addresses select this ROM*. ROM0: 8K addresses. Internal ROM*. RAM: 32K addresses. RAM shared by MPU and VDG. *Not restricted to ROM. For example, RAM or I/O may be used here. Type # 1: (Primarily for RAM based systems) S = 4(S2) + 2 (SD + S0 Address Range S Value Intended Use $FFF2 to FFFF 2 MC6809E Vectors: Reset, NMI, SWI, IRQ, FIRQ, SWI2, SWI3. FFEO to FFF1 2 Reserved for future MPU enhancements. FFCO to FFDF 7 SAM Control Register: V0 - V2, F0 - Fe, P, R0, R1 ( M0, M1, TY. FF60 to FFBF 7 Small ROM: Boot load program and initial MC6809 vectors. FF40 to FF5F 6 I/O2: Input/Output (PIAs> ACIAs, etc.) To subdivide, use A0-A4. FF20 to FF3F 5 I/Oi : Input/Output (PIAs, ACIAs, etc.) To subdivide, use A0- A4. FFOOto FF1F 4 l/0(j: Input/Output (PIAs, ACIAs, etc.) To subdivide, use A2- A4. 0000 to FEFF if R/W = 1 RAM: 64K(-256) addresses, shared by MPU and VDG. (If R/W = then S = 3 for $C000-$FEFF; S = 2 for $A000-$BFFF; S = = 1 for $8000-$9FFF and S = 7 for $0000-$7FFF.) 4-648 SN74LS783*MC6883 APPENDIX A VDG/SAM Video Display Paul There are three new modes created when the VDG and SAM are used together in a video display sys- tem. These modes offer alphanumeric compatibility with 8 color low-to-high resolution graphics, 64H*64V, 64H*96V, 64H*192V. The new modes S8, S12, and S24 are created by placing the VDG in the Alpha Internal mode and having the SAM in a 2K, 3K or 6K full color graphics mode. In all modes the VDG's S/A and Inv. pins are connected to data bits DD7 and DD6 to allow switching on the fly between Alpha and Semigraphics and between inverted and non-inverted alpha. This method is used in most VDG systems to obtain maximum flexibility. The three modes divide the standard 8*1 2 dot box used by the VDG for the standard alpha and semi- graphics modes into eight 4*3 dot boxes for the S8 mode, twelve 4*2 dot boxes for the S12 mode, and twenty-four 4*1 dot boxes for the S24 mode. Figure 17 shows the arrangement of these boxes. One byte is needed to control two horizontally consecutive boxes. It therefore takes four bytes for the S8, six bytes for the S1 2, and 1 2 bytes for the S24 mode to control the entire 8*12 dot box. These two horizon- tally consecutive boxes have four combinations of luminance controlled by bits BO - B3. For conven- System Offers 3 New Modes by Fletcher ience B2 should be made equal to BO and B3 should be made equal to B1. This eliminates a screen place- ment problem which would cause other codes to change patterns when moved vertically on the screen. The illuminated boxes can be one of eight colors which are controlled by B4 - B6 (see Figure 18). The bytes needed to control all the boxes in the 8*12 dot box must be spaced 32 address spaces apart in the display RAM because of the addressing scheme orginally used in the VDG and duplicated by the SAM. This means to place an alphanumeric character on the TV screen it requires 4, 6, or 12 bytes depending on the mode used. These bytes are placed 32 memory locations apart in the display RAM (see Figure 18). This multiple byte format al- lows the mixing of character rows of different char- acters in the same 8*12 dot box creating new char- acters and symbols. It also allows overlining and underlining in eight colors by switching to semi- graphics at the correct time. These new modes optimize the memory versus screen density tradeoffs for RF performance on color TVs. This could make them the most versatile of all the modes depending on the users creativity and the software sophistication. APPENDIX B Memory Decode for "MAP TYPE = 1" JT From SAM < S2>- S1> s >- 13 !b Eb A1 A V C C = 16 Gnd = 8 7 (0 3a ) 6(0 2a ) 5(0 1a ) 4 (6 0a ) SN74LS156 3 (0 3b ) 2(0 2b ) T(0 1b ) 0(O b) MPU Vectors and Boot Load ROM 128X8 (or 256X8) EN EN *" J— L + 5.0-VV\rn + 5.0-AA/V-I 5.0 -W\-i 12 NC ► NC + 5.0V x R/W ->i/o 2 ■^l/O-, ->i/o -VW-i RAM READ 4-649 SN74LS783*MC6883 FIGURE 17 - DISPLAY MODES S8, S12, S24 Bit/Visible Dot Correlation Scan Lines S8 3 ^ Left Right i < > „ i 1 i ' Scan Lines S12 -* 8 ► Dots i 1 \ i 2 ' Scan Lines S24 •< 8 ► i i i i 1 < i 2 r • _ • Address Byte SXXOO ($01) $XX20 ($01) l $XX40 ($01) | $XX60 ($01) $01 is the VDG "ASCII" code for 'A'. Alphanumeric Compatible Left Right * ## Red Red Blue Off Off Green Orange Orange Off Off Yellow Yellow $XX0O ($BF) $XX20 ($AA) $XX40 ($85) $XX60 ($FF) $XX80 ($80) $XXA0 ($9F) Options: One of 8 colors for L or R or both. Off = Black Blue Blue Black Black Black Black 1 •' • • • • • • J • • I • I • • J • • J • • Black Black Green Green $XX00 ($AF) $XX20 ($80) w ^ $XX40 ($80) VDG $XX60 ($14) --Code for T • Underline, Overline • Mix Character Dot Rows * Characters will always remain in standard VDG positions. 4-650 SN74LS783*MC6883 £ £ fc ° s ° o__ S * -2 5 O o o 5 o E 0) 2 o m o *- o *- m m o o o m r*i CM r*i CM r#i r# CM CM CO <* un CO CM CO ** m CO CO ^r CO CM CO ^» in CO CO CO CO CO CO CO n JO JO A jo A u o u o u o "D T3 TO "D ■o 13 » u CO <*> CO CO x x x X (0 _k w to CO * © * CD « CO * 0) Z x H- X '*- X «_ X « o o O O o o o o - si * ^ ♦- si " *t * o o o o o o o o i- -o *" TJ »- TJ »- "O « ? o P £ *~ CM J CM CO ^ o "■ .* oc X •> O O o u CO CD c CO J) (3 o 5 00 cc 15 CD c CO > CO c CO CD CO 5 CO CD c JO 6 . o o X o - o - o - p - o X o o - - o o - - CM o X o o o o - - - - X o 2 < x < 2 cc O >■ < UJ cc 3 o 00 o X Zi X CM -J X CO X o o X o X CM O > c 00 X CO o C/> < (0 *■— C> u 4 — t * o -1 o _J O -J o -J 1" Ij Ij IJ Ij 00 22 4-651 SN74LS783*MC6883 FIGURE 19 — EXAMPLE of MO CONNECTOR BS > BUSY CS1 CSO RS1 RSO CS2 7 6 5 4 3 2 1 76543210 2 1 2 1 17T16T15M4 13 12 11 lOJ 9 \8\ 7\ 6| 5| 4| 3| 2| 19|18| 39T40J : i o 64 KEY KEYBOARD CONNECTS HERE CS1 CSO RS1 RSO CS2 2 o o s s o s S o *2 7 6 5 4 3 2 1 7 6 5 4 3 2 10 2 12 17| 16| 15| 14| 13| 12| 11| 10| 9j 8| 7J 6J 5| 4| 3| 2| 19 1 18| 39 1 ■ MC6847 Mode Control & Misc I/O connects here. ^ 4-652 23 SN74LS783*MC6883 3 and MC6847 COMPUTER VIDEO ENCODER MODULATOR CONNECTS HERE 1 S:i 5;! = i = A15 A14 A13 A12 FIRQ IRQ HALT NMI RESET vcc Gnd A14 A13 A12 All A10 OscQut HS DAO VCIk Zl Z6 Z5 24 Z3 Z2 Z1 ZO CAS_ RASO V\ 3& 34 33 32 31 30 29 28 12 11 10 A2 W A0 S Vcc-16 Gnd -8 i-IO ? 12 ROM 2 E[ ROM i \ c l, p 14 [ Sc,CCtS -*ROM0J 15^MRD DpF