|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
1 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog p reliminary p roduct s pecification z80185/z80195 s mart p eripheral c ontrollers features n enhanced z8s180 mpu n four z80 ctc channels n one channel escc ? controller n two 8-bit parallel i/o ports n bidirectional centronics interface (ieee 1284) n low-emi option rom uart speed part (kb) baud rate (mhz) z80185 32 x 8 512 kbps 20, 33 z80195 0 512 kbps 20, 33 n 100-pin qfp package n 5.0-volt operating range n low-power consumption n 0 c to +70 c temperature range general description the z80185 and z80195 are smart peripheral controller devices designed for general data communications appli- cations, and architected specifically to accommodate all input and output (i/o) requirements for serial and parallel connectivity. combining a high-performance cpu core with a variety of system and i/o resources, the z80185/195 are useful in a broad range of applications. the z80195 is the romless version of the device. the z80185 and z80195 feature an enhanced z8s180 microprocessor linked with one enhanced channel of the z85230 escc ? serial communications controller, and 25 bits of parallel i/o, allowing software code compatibility with existing software code. seventeen lines can be configured as bidirectional centronics (ieee 1284) controllers. when configured as a 1284 controller, an i/o line can operate in either the host or peripheral role in compatible, nibble, byte or ecp mode. in addition, the z80185 includes 32 kbytes of on-chip rom. these devices are well-suited for external modems using a parallel interface, protocol translators, and cost-effective wan adapters. the z80185/195 is ideal for handling all laser printer i/o, as well as the main processor in cost- effective printer applications. notes: all signals with a preceding front slash, "/", are active low. power connections follow conventional descriptions below: connection circuit device power v cc v dd ground gnd v ss
2 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog processor power controller parallel ports (2) including ieee bidirectional centronics controller 16-bit programmable reload timers (2) uarts (2) rom 32k x 8 (z80185 only) dmacs (2) emscc decode ctcs (4) 16-bit address bus 8-bit data bus /romcs /ramcs mmu a19-0 txd, rxd tout clk/trg zc/to txa1-0, rxa1-0 timing diagrams (continued) figure 1. z80185/195 functional block diagram 3 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog /busreq /busack nstrobe nack nautofd tout//dreq busy ninit rxa1 /int0 /nmi /reset /wait extal vss a17 phi /rd /wr /m1 nfault /mreq /iorq xtal /rfsh vdd /halt z80185/z80195 100-pin qfp /int1 /int2 st a0 a1 a2 a3 a15 a4 a5 a6 a7 a8 a9 a11 a12 vss a13 a14 a16 d0 d1 d2 d3 d4 d5 d7 /ramcs /iocs txa1 cka0/cks rxa0 txa0 /dcd0/cka1 /cts0/rxs /rts0/txs a18 a19 vss iei /romcs ieo vss /dcd /cts /rts /dtr txd /trxc rxd perror 100 1 95 5 10 15 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 d6 a10 pia10/clktrg0 pia11/clktrg1 pia12/clktrg2 pia13/clktrg3 pia14/zcto0 pia15/zcto1 pia16/zcto2 select vss pia21 pia22 pia23 pia24 pia25 pia26 pia27 /rtxc nselectin pia20 vdd pin description figure 2. 100-pin qfp pin assignments 4 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog 1.4 v i oh 100 pf ol i = 2 ma = 250 m a absolute maximum ratings symbol description min max units v cc supply voltage C0.3 +7.0 v v in input voltage C0.3 v cc +0.3 v t opr operating temp. 0 70 c t stg storage temp. C55 +150 c notes: voltage on all pins with respect to gnd. permanent lsi damage may occur if maximum ratings are exceeded. normal operation should be recommended operating conditions. if these conditions are exceeded, it could affect reliability of lsi. stresses greater than those listed under absolute maxi- mum ratings may cause permanent damage to the de- vice. this is a stress rating only; operation of the device at any condition above those indicated in the operational sections of these specifications is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. standard test conditions the dc characteristics and capacitance sections below apply for the following standard test conditions, unless otherwise noted. all voltages are referenced to gnd (0v). positive current flows into the referenced pin (test load). operating temperature range: s = 0 c to 70 c voltage supply range: +4.5v v cc +5.5v all ac parameters assume a load capacitance of 100 pf. add 10 ns delay for each 50 pf increase in load up to a maximum of 150 pf for the data bus and 100 pf for address and control lines. ac timing measurements are referenced to 1.5 volts (except for clock, which is refer- enced to the 10% and 90% points). maximum capacitive load for phi is 125 pf. figure 3. test load diagram 5 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog dc characteristics v dd = 5.0v 10%, v ss = 0v over specified temperature range, unless otherwise noted. symbol item condition min. typ. max. unit v ih input h voltage ? v v il input l voltage ? v v oh output h voltage ? v v ol1 output l voltage ? v i il input leakage v in =0.5 to current all inputs v dd C0.5 1.0 except xtal,extal m a i tl tri-state leakage v in =0.5 to current v dd C0.5 1.0 m a v dd supply current* normal operation for 5.0v: f = 20 mhz 60 120 ma for 5.0v: f = 33 mhz 68 132 ma i cc * power dissipation* system stop mode for 5.0v: f = 20 mhz 5 10 ma for 5.0v: f = 33 mhz 7 13 ma notes: ? see class reference table * v ih min = v dd C1.0v, v il max = 0.8v (all output terminals are at no load.) 6 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog timing diagrams z8s180 mpu timing figure 4. cpu timing (opcode fetch cycle, memory read/write cycle i/o read/write cycle) ? address opcode fetch cycle t1 t2 tw t3 t1 t2 tw t3 t1 i/o write cycle ? i/o read cycle ? /wait /mreq 6 1 3 2 4 5 19 20 19 20 7 8 12 11 7 11 29 /iorq 13 11 13 9 /rd /wr 22 26 and 26a 25 11 10 14 18 /m1 17 st data in data out /reset 15 16 15 16 27 21 23 24 48 49 54 53 48 49 54 53 28a 28b 9a 9b 7 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ? 32 31 33 30 15 16 39 40 41 42 34 35 35 34 37 36 38 38 43 [3] /inti /nmi /m1 [1] /iorq [1] /data in [1] /mreq [2] /rfsh [2] /busreq /busack address data /mreq, /rd, /wr, /iorq /halt 44 notes: [1] during /int0 acknowledge cycle [2] during refresh cycle [3] output buffer is off at this point [4] refer to table c, parameter 7 figure 5. cpu timing (/int0 acknowledge cycle, refresh cycle, bus release mode halt mode, sleep mode, system stop mode) timing diagrams (continued) 8 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog 0 address /iroq t1 t2 tw t3 t1 13 25 9 /rd /wr t2 tw t3 i/o read cycle i/o write cycle 28 29 28 29 22 ? 45 46 45 45 17 18 cpu or dma read/write cycle t1 t2 tw t3 t1 [3] [4] [2] [1] tout//dreq (at level sense) tout//dreq (at edge sence) st dma control signals [1] tdrqs and tdrqh are specified for the rising edge of clock followed by t3. [2] tdrqs and tdrqh are specified for the rising edge of clock. [3] dma cycle starts. [4] cpu cycle starts. figure 6. cpu timing figure 7. dma control signals 9 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ? 47 tout/dreq timer data reg = 0000h ? t3 t1 t2 ts ts t1 t2 32 31 33 43 44 /inti /nmi a18-a0 /mreq, /m1 /rd /halt slp instruction fetch next opcode fetch timing diagrams (continued) figure 9. sleep execution cycle figure 8. timer output timing 10 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog csi/o clock 58 58 60 59 60 59 62 61 61 62 11.5 tcyc 11 tcyc 11 tcyc 11.5 tcyc 16.5 tcyc 16.5 tcyc 57 57 transmit data (internal clock) transmit data (external clock) receive data (internal clock) receive data (external clock) figure 10. csi/o receive/transmit timing 11 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog /mreq 63 64 /ramcs /romcs /iorq /iocs 56 55 extal vil1 51 52 vih1 vil1 vih1 timing diagrams (continued) figure 11. /romcs and /ramcs timing figure 12. external clock rise time and fall time figure 13. input rise and fall time (except extal, /reset) 12 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog ac characteristics v dd = 5v 10%, v ss = 0v, cl = 50 pf for outputs over specified temperature range, unless otherwise noted. z80185 / z80195 z80185 / z80195 (20 mhz) (33 mhz) no. symbol parameter min max min max units 1 tcy clock cycle time 50 (dc) 33 (dc) ns 2 tchw clock h pulse width 15 10 ns 3 tclw clock l pulse width 15 10 ns 4 tcf clock fall time 10 5 ns 5 tcr clock rise time 10 5 ns 6 tad phi rising to address valid 30 15 ns 7 tas address valid to (mreq falling or iorq falling) 5 5 ns 8 tmed1 phi falling to mreq falling delay 25 15 ns 9a trdd1 phi falling to rd falling delay (ioc=1) 25 15 ns 9b trdd1 phi rising to rd falling delay (ioc=0) 25 15 ns 10 tm1d1 phi rising to m1 falling delay 35 15 ns 11 tah address hold time from (mreq, ioreq, rd, wr) 5 5 ns 12 tmed2 phi falling to mreq rising delay 25 15 ns 13 trdd2 phi falling to rd rising delay 25 15 ns 14 tm1d2 phi rising to m1 rising delay 40 15 ns 15 tdrs data read setup time 10 5 ns 16 tdrh data read hold time 0 0 ns 17 tstd1 phi falling to st falling delay 30 15 ns 18 tstd2 phi falling to st rising delay 30 15 ns 19 tws wait setup time to phi falling 15 10 ns 20 twh wait hold time from phi falling 10 5 ns 21 twdz phi rising to data float display 35 20 ns 22 twrd1 phi rising to wr falling delay 25 15 ns 23 twdd phi rising to write data delay time 25 15 ns 24 twds write data setup time to wr falling 10 10 ns 25 twrd2 phi falling to wr rising delay 25 15 ns 26 twrp write pulse width (memory write cycle) 75 45 ns 26a twrp write pulse width (i/o write cycle) 130 70 ns 27 wdh write data hold time from (wr rising) 10 5 ns notes: specifications 1 through 5 refer to an external clock input on extal, and provisionally to phi clock output. when a quartz crystal is used with the on-chip oscillator, a lower maximum frequency than that implied by spec. #1 may apply. 13 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ac characteristics (continued) z80185 / z80195 z80185 / z80195 (20 mhz) (33 mhz) no. symbol parameter min max min max units 28a tiod phi falling to iorq falling delay ioc = 1) 25 15 ns 28b tiod phi rising to iorq fallin g delay (ioc =0) 25 15 ns 29 tiod2 phi falling to iorq rising delay 25 15 ns 30 tiod3 m1 falling to iorq falling delay 100 80 ns 31 tints int setup time to phi falling 20 15 ns 32 tinth int hold time from phi falling 10 10 ns 33 tnmiw nmi pulse width 35 25 ns 34 tbrs busreq setup time to phi falling 10 10 ns 35 tbrh busreq hold time from phi falling 10 10 ns 36 tbad1 phi rising to busack falling delay 25 15 ns 37 tbad2 phi falling to busack rising delay 25 15 ns 38 tbzd phi rising to bus floating delay time 40 30 ns 39 tmewh mreq pulse width (high) tcy C15 tcy C10 ns 40 tmewl mreq pulse width (low) 2tcy C15 2tcyC10 ns 41 trfd1 phi rising to rfsh falling delay 20 15 ns 42 trfd2 phi rising to rfsh rising delay 20 15 ns 43 thad1 phi rising to halt falling delay 15 15 ns 44 thad2 phi rising to halt rising delay 15 15 ns 45 tdrqs dreq setup time to phi rising 20 15 ns 46 tdrqh dreq hold time from phi rising 20 15 ns 47 ttod phi falling to timer output delay 75 50 ns 48 tres reset setup time to phi falling 40 25 ns 49 treh reset hold time from phi falling 25 15 ns 50 tosc oscillator stabilization time 20 20 ms 51 texr external clock rise time (extal) 10 5 ns 52 texf external clock fall time (extal) 10 5 ns 53 trr reset rise time 50 50 ms 54 trf reset fall time 50 50 ms 55 tir input rise time (except extal, reset) 50 50 ns 56 tif input fall time (except extal, reset) 50 50 ns 57 tstdi csio transmit data delay time 75 60 ns (internal clock operation) 58 tstde csio transmit data delay time 7.5 tcy +75 7.5 tcy +60 ns (external clock operation) 59 tsrsi csio receive data setup time 75 60 ns (internal clock operation) 60 tsrhi csio receive data hold time 75 60 ns (internal clock operation) 61 tsrse csio receive data setup time 75 60 ns (external clock operation) 62 tsrhe csio receive data hold time 75 60 ns (external clock operation) 63 tdcs mreq valid to ramcs and romcs valid delay 15 15 ns 64 tdiocs rising iorq valid to rising iocs valid delay 10 10 ns 14 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog address b5 b7 b3 data in data out a7-a0 /iorq /rd data /wr data b6 b2 b2 b4 b9 b1 b8 ac characteristics (continued) read/write external bus master timing figure 14. read/write external bus master timing 15 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ac characteristics (continued) general-purpose i/o timing port timing parameters referenced in figure 15 appear in the following tables. note: port 2 timing is different, even when bidirec- tional centronics feature is not in active use. figure 15. port timing t1 t2 tw t3 t1 t2 tw t3 t1 t2 tw t3 0 a0-a7 /iorq d0-d7 /wr port i/o port timing (output) port (output) port output data 1 (out) port output data 2 (in) port output data 1 (in) (in) 'oo'h (change port to output) port data dir. reg. addr. (input) port data reg. addr. (input) port data reg. addr. (input) b7 b7 b7 b2 b3 b2 b3 b2 b6 b6 b6 a1 a1 a2 a0-a7 /iorq d0-d7 /wr /rd port previous output port input data 1 (in) port input data 2 (in) port data 2 out port data 1 (out) (in) 'ff'h (change port to input) port data dir. reg. addr. (input) port data reg. addr. (input) port data reg. i/o port timing (input) b4 b2 b4 b2 16 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog i/o port timing z80185 / z80195 z80185 / z80195 (20 mhz) (33 mhz) no. symbol parameter min max min max units a1 tdwr (pia) data valid delay from wr rise 60 60 ns external bus master timing z80185 / z80195 z80185 / z80195 (20 mhz) (33 mhz) no. symbol parameter min max min max units b1 tsa(wf) address valid to wr or (rf) rd fall time 40 40 ns b2 tsio(wf) iorq fall to wr or (rf) rd fall time 20 20 ns b3 th data hold time (from wr rise) 5 5 ns b4 tdrd(do) rd fall to data out delay 35 35 ns b5 tdrir(doz) rd,iorq rise to data float time 5 5 ns b6 tsdi(wrf) data in to wr fall setup time 20 20 ns b7 tsa(iorqf) address to iorq fall setup time 20 20 ns b8 tsa(rdf) address to rd fall setup time 40 40 ns b9 tsa(wrf) address to wr fall setup time 40 40 ns 17 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ? 2 6 1 /wr /rd wait /int ac characteristics (continued) emscc timing figure 16. emscc ac parameters emscc timing parameters 20 mhz no. symbol parameter min max unit 1 tdwr(w) /wr fall to wait valid delay 50 ns 2 tdrd(w) /rd fall to wait valid delay 50 6 tdpc(int) clock to /int valid delay 160 18 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog pclk wait /rtxc, /trxc receive rxd /trxc, /rtxc transmit txd /trxc output /rtxc /trxc /cts, /dcd 2 3 4 5 6 7 10 11 12 13 14 15 16 17 18 19 20 21 21 emscc general timing diagram figure 17. emscc general timing diagram 19 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ac characteristics (continued) emscc general timing 20 mhz no. symbol parameter min max notes 2 tdpc(w) /pclk to wait inactive 170 3 tsrxc(pc) /rxc to /pclk setup time na [1,4] 4 tsrxd(rxcr) rxd to /rxc setup time 0 [1] 5 thrxd(rxcr) rxd to /rxc hold time 45 [1] 6 tsrxd(rxcf) rxd to /rxc setup time 0 [1,5] 7 thrxd(rxcf) rxd to /rxc hold time 45 [1,5] 10 tstxc(pc) /txc to /pclk setup time na [2,4] 11 tdtxcf(txd) /txc to txd delay 70 [2] 12 tdtxcr(txd) /txc to txd delay 70 [2,5] 13 tdtxd(trx) txd to trxc delay 80 70 14 twrtxh rtxc high width 70 [6] 15 twrtxi trxc low width 70 [6] 16a tcrtx rtxc cycle time 200 [6,7] 16b txrx(dpll) dpll cycle time min 50 [7,8] 17 tcrtxx crystal osc. period 61 1000 [3] 18 twtrxh trxc high width 70 [6] 19 twtrxl trxc low width 70 [6] 20 tctrx trxc cycle time 200 [6,7] 21 twext dcd or cts pulse width 60 notes: [1] rxc is /rtxc or /trxc, whichever is supplying the receive clock. [2] txc is /trxc or /rtxc, whichever is supplying the transmit clock. [3] both /rtxc and /sync have 30 pf capacitors to ground connected to them. [4] synchronization of rxc to pclk is eliminated in divide-by-four operation. [5] parameter applies only to fm encoding/decoding. [6] parameter applies only for transmitter and receiver; dpll and baud rate generator timing requirements are identical to case pclk requirements. [7] the maximum receive or transmit data rate is 1/4 pclk. [8] applies to dpll clock source only. maximum data rate of 1/4 pclk still applies. dpll clock should have a 50% duty cycle. these ac parameter values are preliminary and subject to change without notice. 20 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog 2 4 10 8 6 /rtxc, /trxc receive /w/req wait /int /rtxc, /trxc transmit wait /int /cts, /dcd /int emscc system timing diagram figure 18. emscc system timing 21 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog 1 valid escc addr * iorq /rd or /wr ac characteristics (continued) emscc system timing 20 mhz no. symbol parameter min max notes 2 tdrxc(w) /rxc to /wait inactive 13 18 [1,2] 4 tdrxc(int) /rxc to /int valid 15 22 [1,2] 6 tdtxc(w) /txc to /wait inactive 8 17 [1,3] 8 tdtxc(int) /txc to /int valid 9 17 [1,3] 10 tdext(int) /dcd or /cts to /int valid 3 9 [1] notes: [1] open-drain output, measured with open-drain test load. [2] /rxc is /rtxc or /trxc, whichever is supplying the receive clock. figure 19. emscc external bus master timing external bus master interface timing (scc related timing) z80185 / z80195 z80185 / z80195 (20 mhz) (33 mhz) no symbol parameter min max min max unit notes 1 trc valid access recovery time 4tcc 4tcc ns [1] notes: [1] applies only between transactions involving the emscc. these ac parameter values are preliminary and subject to change without notice. t cc = emscc clock period time [3] /txc is /trxc or /rtxc, whichever is supplying the transmit clock. [4] units equal to tcpc these ac parameter values are preliminary and subject to change without notice. 22 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog 1 f port 2 output 2 4 3 6 5 control output control input port 2 input ac characteristics (continued) figure 20. p1284 bidirectional centronics interface timing p1284 bidirectional centronics interface timing no. parameter min max units notes 1 clk high to port 2 output 12 ns 2 clk high to control output 12 ns [1] 3 setup time for control input to clk high for guaranteed recognition 10 ns [2] 4 hold time for control input from clk high for guaranteed recognition 5 ns [2] 5 setup time for port 2 inputs to clk high for guaranteed recognition 10 ns 6 hold time for port 2 inputs to clk high for guaranteed recognition 5 ns notes: [1] control outputs peripheral mode host mode busy/ptrbusy/periphack nstrobe/hostclk nack/ptrclk/periphclk nautofd/hostbusy/hostack perror/ackdatareq/nackreverse nselectin/p1284active nfault/ndataavail/nperiphrequest ninit/nreverserequest select/xflag [ 2] control inputs host mode peripheral mode busy/ptrbusy/periphack nstrobe/hostclk nack/ptrclk/periphclk nautofd/hostbusy/hostack perror/ackdatareq/nackreverse nselectin/p1284active nfault/ndataavail/nperiphrequest ninit/nreverserequest select/xflag 23 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog pin descriptions z80185 cpu signals a0-a19. address bus (input/output, active high, tri-state). a0-a19 is a 20-bit address bus that provides the address for memory data bus cycles up to 1 mbyte, and i/o data bus cycles up to 64 kbytes. the address bus enters a high impedance state during reset and external bus acknowl- edge cycles. this bus is an input when /busack is low. no address lines are multiplexed with any other signals. d0-d7. data bus (bidirectional, active high, tri-state). d0- d7 constitute an 8-bit bidirectional data bus, used to transfer information to and from i/o and memory devices. the data bus enters the high impedance state during reset and external bus acknowledge cycles, as well as during sleep and halt states. /rd. read (input/output, active low, tri-state). /rd indi- cates that the cpu is ready to read data from memory or an i/o device. the addressed i/o or memory device should use this signal to gate data onto the cpu data bus. this pin is tri-stated during bus acknowledge cycles. /wr. write (input/output, active low, tri-state). /wr indi- cates that the cpu data bus holds valid data to be stored at the addressed i/o or memory location. this pin is tri- stated during bus acknowledge cycles. /iorq. i/o request (input/output, active low, tri-state). /iorq indicates that the address bus contains a valid i/o address for an i/o read or i/o write operation. /iorq is also generated, along with /m1, during the acknowledgment of the /int0 input signal to indicate that an interrupt response vector can be placed onto the data bus. this pin is tri- stated during bus acknowledge cycles. /m1. machine cycle 1 (input/output, active low). together with /mreq, /m1 indicates that the current cycle is the opcode fetch cycle of an instruction execution. together with /iorq, /m1 indicates that the current cycle is for an interrupt acknowledge. it is also used with the /halt and st signal to indicate the status of the cpu machine cycle. the processor can be configured so that this signal is compatible with the /m1 signal of the z80, or with the /lir signal of the z64180. this pin is tri-stated during bus acknowledge cycles. /mreq. memory request (input/output, active low, tri- state). /mreq indicates that the address bus holds a valid address for a memory read or memory write operation. it is included in the /ramcs and /romcs signals, and be- cause of this may not be needed in some applications. this pin is tri-stated during bus acknowledge cycles. /wait. (input/open-drain output, active low.) /wait indi- cates to the mpu that the addressed memory or i/o devices are not ready for a data transfer. this input is used to induce additional clock cycles into the current machine cycle. external devices should also drive this pin in an open-drain fashion. this results in a wired or of the wait indications produced by external devices and those pro- duced by the two separate wait state generators in the z80185. if the wire-ored input is sampled low, then additional wait states are inserted until the /wait input is sampled high, at which time the cycle is completed. /halt. halt/sleep status (output, active low). this output is asserted after the cpu has executed either the halt or slp instruction, and is waiting for either non-maskable or maskable interrupt before operation can resume. it is also used with the /m1 and /st signals to indicate the status of the cpu machine cycle. on exit of halt/sleep, the first instruction fetch is delayed 16 clock cycles after the /halt pin goes high. /busack. bus acknowledge (output, active low). /busack indicates to the requesting device that the mpu address and data bus, as well as some control signals, have entered their high impedance state. /busreq. bus request (input, active low). this input is used by external devices (such as dma controllers) to request access to the system bus. this request has a higher priority than /nmi and is always recognized at the end of the current machine cycle. this signal stops the cpu from executing further instructions and places the address and data buses, and other control signals, into the high impedance state. /nmi. non-maskable interrupt (input, negative edge trig- gered). /nmi has a higher priority than /int and is always recognized at the end of an instruction, regardless of the state of the interrupt enable flip-flops. this signal forces cpu execution to continue at location 0066h. /int0. maskable interrupt request 0 (input/open-drain output, active low). this signal is generated by internal and external i/o devices. external devices should also drive this signal in an open-drain fashion. the cpu will honor this request at the end of the current instruction cycle as long as it is enabled, and the /nmi and /busreq signals are inactive. the cpu acknowledges this interrupt request with an interrupt acknowledge cycle. during this cycle, both the /m1 and /iorq signals will become active. 24 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog multiplexed signal tout//dreq. timer out or external dma request (input or output). this pin can be programmed to be either tout, the high-active pulse output from prt channel 1, or a low- active dma request input from an external peripheral. z80185 emscc signals txd. transmit data (output). this output transmits serial data at standard ttl levels. rxd. receive data (input). this input receives serial data at standard ttl levels. /trxc. transmit/receive clock (input or output). this pin functions under program control. /trxc may supply the receive clock or the transmit clock in the input mode or supply the output of the digital phase-locked loop, the crystal oscillator, the baud rate generator, or the transmit clock in the output mode. /rtxc. receive/transmit clock (input). this pin functions under program control. /rtxc may supply the receive clock, the transmit clock, the clock for the baud rate generator, or the clock for the digital phase-locked loop. the receive clock may be 1, 16, 32, or 64 times the data rate in asynchronous mode. /cts. clear to send (input, active low). if this pin is programmed as an auto enable, a low on it enables the emscc transmitter. if not programmed as an auto enable, it can be used as a general-purpose input. this pin is schmitt-trigger buffered to accommodate slow rise-times. the emscc detects transitions on this input and can interrupt the processor on either logic level transition. /dcd. data carrier detect (input, active low). this pin functions as an emscc receiver enable when programmed as an auto enable; otherwise it can be used as a general- purpose input pin. the pin is schmitt-trigger buffered to accommodate slow rise-times. the emscc detects tran- sitions on this pin and can interrupt the processor on either logic level transition. /int1, /int2. maskable interrupt requests 1 and 2 inputs, active low). these signals are generated by external i/o devices. the cpu will honor these requests at the end of the current instruction cycle as long as the /nmi, /busreq, and /int0 signals are inactive. the cpu will acknowledge these interrupt requests with an interrupt acknowledge cycle. unlike the acknowledgment for /int0 during this cycle, neither the /m1 nor the /iorq signals will become active. these pins may be programmed to provide active low level, rising or falling edge interrupts. the level of the external /int1 and /int2 pins may be read in the interrupt edge register. /rfsh. refresh (output, active low, tri-state). /rfsh and /mreq active indicate that the current cpu machine cycle and the contents of the address bus should be used for refresh of dynamic memories. the low order eight bits of the address bus (a7-a0) contain the refresh address. z80185 uart and csio signals cka0/cks. asynchronous clock 0 or serial clock (input/ output). an optional clock input or output for asci channel 0 or the clocked serial i/o port. /dcd0/cka1. data carrier detect 0 or asynchronous clock 1 (input/output). a low-active modem status input for asci channel 0, or a clock input or output for asci channel 1. /rts0/txs. request to send 0 or clocked serial transmit data (output). a programmable modem control output for asci channel 0, or the serial output from the csio channel. /cts0/rxs. clear to send 0 or clocked serial receive data (input). a low-active modem control input for asci channel 0, or the serial data input to the csio channel. txa0. transmit data 0 (output). this output transmits data from asci channel 0. rxa0. receive data 0 (input). this input receives data for asci channel 0. rxa1. receive data 1 (input). this input receives data for asci channel 1. txa1. transmit data 1 (output). this output transmits data from asci channel 1. 25 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog pin descriptions (continued) emscc signals /rts. request to send (output, active low). when the request to send (rts) bit in write register 5 is set, the /rts signal goes low. when the rts bit is reset in the asynchronous mode and auto enables is on, the signal goes high after the transmitter is empty. in synchronous mode, or in asynchronous mode with auto enables off, the /rts pin strictly follows the state of the rts bit. thus the pin can be used as a general-purpose output. in a special appletalk mode on the z80185, the pin is under hard- ware control. /dtr. data terminal ready (outputs, active low). the /dtr//req functionality found in other scc family mem- bers has been reconfigured internal to the emscc megacell. the /dtr output is routed to this pin, while the /req signal is routed to the dma request multiplexing logic as described in a later section on the emscc. this pin follows the state of the dtr bit in wr5 of the emscc. note: the /w/req pin present on other scc family mem- bers has its two possible functions reconfigured internal to the emscc, and both functions are handled internally to the z80185. the wait output of the emscc drives the /wait signal in a wire-ored fashion with other internal and external peripherals. the /req component is routed to the dma request multiplexing logic as described in a later section on the emscc. z80185 parallel ports pia16-14. port 1, bits 6-4 or ctc zc/to2-0 (input/output). these lines can be configured as inputs or outputs, or as the zero count/timeout outputs of three of the four ctc channels, on a bit-by-bit basis. pia13-10. port 1, bits 3-0 or ctc clk/trg3-0 (input/ output). these lines can be configured as inputs or out- puts, or as the clock/trigger inputs of the four ctc channels, on a bit-by-bit basis. pia27-20. port 2, data, or bidirectional (input/output). these lines can be configured as inputs or outputs on a bit- by-bit basis when not used for bidirectional centronics operation. however, when used for bidirectional centronics operation, software and hardware controls the direction of all eight as a unit. bidirectional centronics pins nstrobe, nautofd, nselectin, ninit (input/outputs). these are inputs when using p27-20 for the peripheral side of a centronics controller, or outputs when using p27-20 for the host side of such an interface. in certain p1284 modes, these pins assume other names as described in the section on the centronics p1284 controller. when not using p27-20 for a centronics controller, these pins can be used as general-purpose inputs or outputs. busy, nack, perror, nfault, select (input/outputs). these are outputs when using p27-20 for the peripheral side of a centronics p1284 controller, or inputs when using p27-20 for the host side of such an interface. in certain p1284 modes, these pins have other names as described in the section on the centronics p1284 controller. when not using p27-20 for a centronics p1284 controller, these pins can be used as general-purpose outputs or inputs. these pins always function in the opposite direction of the pre- ceding group. 26 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog system control signals st. status (output, active high). this signal is used with the /m1 and /halt output to indicate the nature of each cpu machine cycle. /reset. reset signal (input, active low). /reset signal is used for initializing the z80185 and other devices in the system. it must be kept low for at least three system clock cycles. iei. interrupt enable signal (input, active high). iei is used with ieo to form a priority daisy-chain when there are external interrupt-driven z80-compatible peripherals. ieo. interrupt enable output signal (output, active high). in an interrupt daisy-chain, ieo controls the interrupt of external peripherals. ieo is active when iei is 1 and the cpu is not servicing an interrupt from the on-chip periph- erals. /iocs. /iocs decodes /iorq, /m1, and as many address lines as are necessary to ensure it is activated for an i/o space access to any register in any block of eight registers that does not contain any on-chip registers. also included in the decode is any programmed relocation of the 180 register set in the icr, and the decode high i/o bit in the system configuration register. if the 180 registers arent relocated, and decode high i/o is 0, /iocs is active from address xx40 though xxd7, xxf8 through xxff, and nn00 through nn3f, where nn are non-zero. if the 180 registers are not relocated and decode high i/o is 1, /iocs is active from 0040 through 00d7, and 00f8 through ffff. /iocs is active when an external master is in control of the bus, as well as when the z80185 processor has control. /ramcs. ram chip select (output, active low). this signal is driven low for memory accesses at addresses that fall between the values programmed into the ramlbr and ramubr registers. it is active when an external master has control of the bus, as well as when the z80185 processor is in control. /romcs. rom chip select (output, active low). this output is driven low for memory accesses between the top of on-chip rom (if on-chip rom is enabled) and the value programmed into the rombr register. it is active when an external master has control of the bus, as well as when the z80185 processor is in control. xtal. crystal (input, active high). this pin functions as the crystal oscillator connection and should be left open if an external clock is used instead of a crystal. the oscillator input is not a ttl level (reference dc characteristics section). extal. external clock/crystal (input, active high). this pin functions as a crystal oscillator connection. an exter- nal clock can be input to the z80185 on this pin when a crystal is not used. this input is schmitt-triggered. phi. system clock (output, active high). this output is the processors reference clock, and is provided for the use of external logic. the frequency of this output may be equal to, or one-half that of the crystal or input clock frequency, depending on an internal register bit. 27 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 mpu functional description the z80185 includes a zilog z8s180 mpu (static z80180 mpu). this allows software code compatibility with exist- ing z80/z180 software code. the following is an overview of the major functional units of the z80185. the mpu portion of the z80185 is the z8s180 core with added features and modifications. the single-channel emscc of the z80185 is compatible with the z85233 emscc and features additional enhancements for localtalk and the demultiplexing of the /dtr//req and /wt//req lines. architecture the z80185 combines a high performance cpu core with a variety of system and i/o resources useful in a broad range of applications. the cpu core consists of four functional blocks: n clock generator n bus state controller (dynamic memory refresh) n memory management unit (mmu) n central processing unit (cpu). the integrated i/o resources make up the remaining functional blocks: n direct memory access (dma controltwo channels) n asynchronous serial communications controller (asci, two channels) n programmable reload timers (prt, two channels) n clocked serial i/o n channel (csio) n enhanced z85c30 (emscc) n counter/timer channels (ctc) n parallel i/o n bidirectional centronics controller. clock generator. this logic generates the system clock from either an external crystal or clock input. the external clock is divided by two, or one if programmed, and is provided to both internal and external devices. bus state controller. this logic performs all of the status and bus control activity associated with both the cpu and some on-chip peripherals. this includes wait state timing, reset cycles, dram refresh, and dma bus exchanges. interrupt controller. this logic monitors and prioritizes the variety of internal and external interrupts and traps to provide the correct responses from the cpu. to maintain compatibility with the z80 cpu, three different interrupt modes are supported. memory management unit. the mmu allows the user to map the memory used by the cpu (logically only 64 kbytes) into the 1 mbyte addressing range supported by the z80185. the organization of the mmu object code maintains compatibility with the z80 cpu while offering access to an extended memory space. this is accom- plished by using an effective common area-banked area scheme. central processing unit. the cpu is microcoded to provide a core that is object-code compatible with the z80 cpu. it also provides a superset of the z80 instruction set, including 8-bit multiply. this core has been modified to allow many of the instructions to execute in fewer clock cycles. dma controller. the dma controller provides high-speed transfers between memory and i/o devices. transfer op- erations supported are memory-to-memory, memory to or from i/o, and i/o-to-i/o. transfer modes supported are request, burst, and cycle steal. dma transfers can access the full 1 mbyte addressing range with a block length up to 64 kbytes, and can cross over the 64 kbytes boundaries. 28 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog timing & clock generator bus state control cpu dmacs (2) 16-bit programmable reload timers (2) clocked serial i/o port asynchronous sci (channel 0) asynchronous sci (channel 1) mmu data bus (8-bit) address bus (16-bit) tout//dreq txa0 cka0/cks rxa0 /rts0 /cts0 /dcd0 txa1 dcd0/cka1 rxa1 ? tout/ /dreq /rts0/txs /cts0/rxs cka0/cks xtal extal /reset /rd /wr /m1 /mreq /iorq /halt /wait /busreq /busack /rfsh a19-a0 d7-d0 interrupt /nmi /int0 /int1 /int2 figure 21. z8s180 mpu block diagram 29 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 mpu functional description (continued) dma controller the two dma channels of the z80185 can transfer data to or from the emscc channel, the parallel interface, the async ports, or an external device. the i/o device encod- ing in sar18-16 and dar18-16 of the existing z80180 is modified as shown in table 1. dma request signals between the various cells are handled internally by the mechanisms described in this section, and are not pinned-out, nor are the tend termination count outputs of the dma channels. table 1. sar18-16 and dar18-16 i/o device encoding sm1-0 sar18-16 source 11 000 ext (tout/dreq) 11 001 asci0 rx 11 010 asci1 rx 11 011 emscc rx 11 10x reserved, do not program. 11 1x0 11 111 pia27-20 in dm1-0 dar18-16 destination 11 000 ext (tout/dreq) 11 001 asci0 tx 11 010 asci1 tx 11 011 emscc tx 11 10x reserved, do not program. 11 1x0 11 111 pia27-20 out asynchronous serial communications interface (asci) the asci logic provides two individual full-duplex uarts. each channel includes a programmable baud rate gen- erator and modem control signals. the asci channels can also support a multiprocessor communications format. for asci0, up to three modem control signals and one clock signal can be pinned out, while asci1 has a data-only interface. the receiver includes a 4-byte fifo, plus a shift register as shown in figure 22. during reset and in i/o stop state, and for asci0 if /dcd0 is auto-enabled and is high, an asci is forced to the following conditions: n fifo empty n all error bits cleared (including those in the fifo) n receive enable cleared (cntla bit 6 = 0) n transmit enable cleared (cntla bit 5 = 0). if dcd is not auto-enabled, the /dcd pin has no effect on the fifos or enable bits. error latches 4x4 bit error fifo p f o b e e r k mp bit 4-byte data fifo error shift register rxa overrun error notes: pe = parity error fe = framing error or = overrun bk = break mp = multiprocessor bit figure 22. asci receiver 30 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog fifo and receiver operation the 4-byte receive fifo is used to buffer incoming data to reduce the incidence of overrun errors. when the re bit is set in the cntla register, the rxa pin is monitored for a low transition. one-half bit time after the low transition of the rxa pin, the asci samples rxa again. if it has gone back to high, the asci ignores the previous low transition and resumes looking for a new one, but if rxa is still low, it considers this a start bit and proceeds to clock in the data based upon the internal baud rate generator or the exter- nal cka pin. the number of data bits, parity, multiproces- sor and stop bits are selected by the mod2, mod1, mod0 and mp bits in the cntla and cntlb registers. after the data has been received the appropriate mp, parity and one stop bit are checked. data and any errors are clocked into the fifos during the stop bit. interrupts, receive data register full flag, and dma requests will also go active during this time. error condition handling when the receiver places a data character in the receive fifo, it also places any associated error conditions in the error fifo. the outputs of the error fifo go to the set inputs of the software-accessible error latches. writing a 0 to cntla efr is the only way to clear these latches. in other words, when an error bit reaches the top of the fifo, it sets an error latch. if the fifo has more data and the software reads the next byte out of the fifo, the error latch remains set, until the software writes a 0 to the efr bit. the error bits are cumulative, so if additional errors are in the fifo, they will set any unset error latches as they reach the top. overrun error an overrun occurs if the receive fifo is full when the receiver has just assembled a byte in the shift register and is ready to transfer it to the fifo. if this occurs, the overrun error bit associated with the previous byte in the fifo is set. the latest data byte is not transferred from the shift register to the fifo in this case, and is lost. once an overrun occurs, the receiver does not place any further data in the fifo, until the last good byte received has come to the top of the fifo so that the overrun latch is set, and software then clears the overrun latch. assembly of bytes continues in the shift register, but this data is ignored until the byte with the overrun error reaches the top of the fifo and is cleared with a write of 0 to the efr bit. break detect a break is defined as a framing error with the data equal to all zeros. when a break occurs, the all-zero byte with its associated error bits are transferred to the fifo, if it is not full. if the fifo is full, an overrun is generated, but the break, framing error and data, are not transferred to the fifo. any time a break is detected, the receiver will not receive any more data until the rxa pin returns to a high state. if the channel is set in multiprocessor mode and the mpe bit of the cntla register is set to 1, then breaks, errors and data will be ignored unless the mp bit in the transmission is a 1. note: the two conditions listed above could cause a break condition to be missed if the fifo is full and the break occurs, or if the mp bit in the transmission is not a 1 with the conditions specified above. parity and framing errors parity and framing errors do not affect subsequent re- ceiver operation. 31 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 mpu functional description (continued) baud rate generator the baud rate generator (brg) has two modes. the first is the same as in the z80180. the second is a 16-bit down counter that divides the processor clock by the value in a 16-bit time constant register, and is identical to the emscc brg. this allows a common baud rate of up to 512 kbps to be selected. the brg can also be disabled in favor of an external clock on the cka pin. the receiver and transmitter will subsequently divide the output of the brg (or the signal from the cka pin) by 1, 16 or 64, under the control of the dr bit in the cntlb register, and the x1 bit in the asci extension control register. to compute baud rate, use the following formulas. if ss2,1,0 = 111, baud rate = f cka / clock mode else if brg mode baud rate = f phi / (2 * (tc+2) * clock mode) else baud rate = f phi / ((10 + 20*ps) * 2^ss * clock mode) where: brg mode is bit 3 of the asext register ps is bit 5 of the cntlb register tc is the 16-bit value in the asci time constant registers the tc value for a given baud rate is: tc = (f phi / (2 * baud rate * clock mode)) - 2 clock mode depends on bit 4 in asext and bit 3 in cntlb: x1 dr clock mode 00=16 01=64 10=1 1 1 = reserved, do not use. 2^ss depends on the three ls bits of the cntlb register: ss2 ss1 ss0 2^ss 000=1 001=2 010=4 011=8 100=16 101=32 110=64 1 1 1 = external clock from cka0 (see above). the ascis require a 50 percent duty cycle when cka is used as an input. minimum high and low times on cka0 are typical of most cmos devices. rdrf is set, and if enabled an rx interrupt or dma request is generated, when the receiver transfers a char- acter from the rx shift register to the rx fifo. the fifo merely provides margin against overruns. when theres more than one character in the fifo, and software or a dma channel reads a character, rdrf either remains set or is cleared and then immediately set again. for example, if a receive interrupt service routine doesnt read all the characters in the rxfifo, rdrf and the interrupt request remain asserted. the rx dma request is disabled when any of the error flags pe or fe or ovrn are set, so that software can identify with which character the problem is associated. if bit 7, rdrf interrupt inhibit, is set to 1 (see figures 32 and 33), the asci does not request a receive interrupt when its rdrf flag is 1. set this bit when programming a dma channel to handle the receive data from an asci. the other causes for an asci receive interrupt (pe, fe, ovrn, and for asci0, dcd) continue to request rx interrupt if the rie bit is 1. (the rx dma request is inhibited if pe or fe or ovrn is set, so that software can tell where an error occurred.) when this bit is 0, as it is after a reset, rdrf will cause an asci interrupt if rie is 1. programmable reload timer (prt) this logic consists of two separate channels, each con- taining a 16-bit counter (timer) and count reload register. the time base for the counters is derived from the system clock (divided by 20) before reaching the counter. prt channel 1 provides an optional output to allow for wave- form generation. the t out output of prt1 is available on a multiplexed pin. clocked serial i/o (csio) the pins for this function are multiplexed with the rts, cts, and clock pins for asci0. note: it is possible to use both asci0 and the csio at the same time. if bit 4 of the system configuration register is set to 1, the cks clock signal will internally drive the clock for asci0 instead of the system clock. 32 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog table 2. power down modes power-down cpu on-chip recovery recovery time modes core i/o osc. clkout source (minimum) sleep stop running running running reset, interrupts 1.5 clock i/o stop running stop running running by programming - system stop stop stop running running reset, interrupts 1.5 clock idle ? stop stop running stop reset, interrupts, busreq 8 +1.5 clock standby ? stop stop stop stop reset, interrupts, busreq 2 17 +1.5 clock (normal recovery) 2 6 +1.5 clock (quick recovery) /m1 the /m1 generation logic of the z80180 allows the use of logic analyzer disassemblers that rely on /m1 identifying the start of each instruction. if the mie bit is set to 1, the processor does not refetch an reti instruction. z80185 counter/timers these facilities include two 16-bit programmable reload timers (prts) like those provided in the z80180 and its successors, plus four ctc channels like those in the z84c30. the tout output of prt1 is output on a multi- plexed pin, and the zc/to outputs and clk/trg inputs of the ctcs are multiplexed with pia17-10 on an individual basis, rather than simultaneously as on the z80181. inter- nal cascading is provided between the ctcs, as de- scribed in ctc control section. z80185 i/o chip select this output is active when an external master has control of the bus, as well as when the z80185 processor has control. the /iocs output of the z80185 operates correctly if the "180 registers" are relocated to i/o address 40-7f or 80-bf, and takes into account the "decode high i/o" bit in the z80185 system configuration register. 32k x 8 on-chip read-only memory (rom) the z80185 processor features 32k x 8 of masked rom. this on-chip rom allows zero-wait-state generation at the maximum clock rate. the z80195 processor is romless. z80185 on-chip rom enable/disable if /wait is low at the rising edge of /reset, the on-chip program memory is disabled and all accesses to ad- dresses below the upper limit of /romcs go off-chip. this feature allows code development and emulation using external devices before the user is ready to use on-chip memory. if /wait is high at the rising edge of /reset, accesses to addresses below both the size of on-chip rom and the upper limit of /romcs, the user should select on-chip rom. accesses that are above the size of the on-chip rom, but below the upper limit of /romcs, go off-chip with /romcs asserted. 33 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z8s180 power-down modes the following is a detailed description of the enhance- ments to the z8s180 from the standard z80180 in the areas of standby, idle, and standby-quick recovery modes. add-on features there are five different power-down modes. sleep and system stop are inherited from the z80180. in sleep mode, the cpu is in a stopped state while the on-chip i/os are still operating. in i/o stop mode, the on-chip i/os are in a stopped state while leaving the cpu running. in system stop mode, both the cpu and the on-chip i/os are in the stopped state to reduce current consumption. the z8s180 has added two additional power-down modes, standby and idle, to reduce current consumption even further. the differences in these power-down modes are summarized in table 2. notes: ? idle and standby modes are only offered in the z8s180. note that the minimum recovery time can be achieved if interrupt is used as the recovery source. standby mode the z8s180 is designed to save power. two low-power programmable power-down modes have been added: standby mode and idle mode. the standby/idle mode is selected by multiplexing d6 and d3 of the cpu control register (ccr, i/o address = 1fh). to enter standby mode: 1. set d6 and d3 to 1 and 0, respectively. 2. set the i/o stop bit (d5 of icr, i/o address = 3fh) to 1. 3. execute the sleep instruction. when the device is in standby mode, it behaves similar to the system stop mode as it exists on the z80180, except that the standby mode stops the external oscilla- tor, internal clocks and reduces power consumption to 50 m a (typical). since the clock oscillator has been stopped, a restart of the oscillator requires a period of time for stabilization. an 18-bit counter has been added in the z8s180 to allow for oscillator stabilization. when the part receives an external irq or busreq during standby mode, the oscillator is restarted and the timer counts down 2 17 counts before acknowledgment is sent to the interrupt source. the recovery source needs to remain asserted for the duration of the 2 17 count, otherwise standby will be re- 34 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog standby mode exit with bus request optionally, if the brext bit (d5 of cpu control register) is set to 1, the z8s180 exits standby mode when the /busreq input is asserted; the crystal oscillator is then restarted. an internal counter automatically provides time for the oscillator to stabilize, before the internal clocking and the system clock output of the z8s180 are resumed. the z8s180 relinquishes the system bus after the clocking is resumed by: n tri-state the address outputs a19 through a0. n tri-state the bus control outputs /mreq, /iorq, /rd and /wr. n asserting /busack the z8s180 regains the system bus when /busreq is deactivated. the address outputs and the bus control outputs are then driven high; the standby mode is exited. if the brext bit of the cpu control register (ccr) is cleared, asserting the /busreq will not cause the z8s180 to exit standby mode. if standby mode is exited due to a reset or an external interrupt, the z8s180 remains relinquished from the sys- tem bus as long as /busreq is active. standby mode exit with external interrupts standby mode can be exited by asserting input /nmi. the standby mode may also exit by asserting /int0, /int1 or /int2, depending on the conditions specified in the following paragraphs. /int0 wake-up requires assertion throughout duration of clock stabilization time (2 17 clocks). if exit conditions are met, the internal counter provides time for the crystal oscillator to stabilize, before the internal clocking and the system clock output within the z8s180 are resumed. 1. exit with non-maskable interrupts if /nmi is asserted, the cpu begins a normal nmi interrupt acknowledge sequence after clocking resumes. 2. exit with external maskable interrupts if an external maskable interrupt input is asserted, the cpu responds according to the status of the global interrupt enable flag ief1 (determined by the ite1 bit) and the settings of the corresponding interrupt enable bit in the interrupt/trap control register (itc: i/o address = 34h): a. if an interrupt source is disabled in the itc, asserting the corresponding interrupt input will not cause the z8s180 to exit standby mode. this is true regardless of the state of the global interrupt enable flag ief1. b. if the global interrupt flag ief1 is set to 1, and if an interrupt source is enabled in the itc, asserting the corresponding interrupt input causes the z8s180 to exit standby mode. the cpu performs an interrupt acknowledge sequence appropriate to the input be- ing asserted when clocking is resumed if: n the interrupt input follows the normal interrupt daisy-chain protocol. n the interrupt source is active until the acknowledge cycle is completed. c. if the global interrupt flag ief1 is disabled, in other words, reset to 0, and if an interrupt source is enabled in the itc, asserting the corresponding interrupt input will still cause the z8s180 to exit standby mode. the cpu will proceed to fetch and execute instructions that follow the sleep instruction when clocking is resumed. if the external maskable interrupt input is not active until clocking resumes, the z8s180 will not exit standby mode. if the non-maskable interrupt (/nmi) is not active until clocking resumes, the z8s180 still exits the standby mode even if the interrupt sources go away before the timer times out, because /nmi is edge-triggered. the condition is latched internally once /nmi is asserted low. 35 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog idle mode idle mode is another power-down mode offered by the z8s180. to enter idle mode: 1. set d6 and d3 to 0 and 1, respectively. 2. set the i/o stop bit (d5 of icr, i/o address = 3fh) to 1. 3. execute the sleep instruction. when the part is in idle mode, the clock oscillator is kept oscillating, but the clock to the rest of the internal circuit, including the clkout, is stopped completely. idle mode is exited in a similar way as standby mode, in other words, reset, bus request or external inter- rupts, except that the 2 17 bit wake-up timer is bypassed; all control signals are asserted eight clock cycles after the exit conditions are gathered. standby-quick recovery mode standby-quick recovery mode is an option offered in standby mode to reduce the clock recovery time in standby mode from 2 17 clock cycles (6.5 ms at 20 mhz) to 2 6 clock cycles (3.2 m s at 20 mhz). this feature can only be used when providing an oscillator as clock source. to enter standby-quick recovery mode: 1. set d6 and d3 to 1 and 1, respectively. 2. set the i/o stop bit (d5 of icr, i/o address = 3fh) to 1. 3. execute the sleep instruction. when the part is in standby-quick recovery mode, the operation is identical to standby mode except when exit conditions are gathered, in other words, reset, bus request or external interrupts. the clock and other control signals are recovered sooner than the standby mode. note: if standby-quick recovery is enabled, the user must make sure stable oscillation is obtained within 64 clock cycles. 36 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog z8s180 mpu register map notes: registers listed in boldface type represent new registers added to the z8s180. all register addresses not listed are reserved. register name i/o addr/access asci control register a ch 0 %0000/40/80 r/w asci control register a ch 1 %0001/41/81 r/w asci control register b ch 0 %0002/42/82 r/w asci control register b ch 1 %0003/43/83 r/w asci status register ch 0 %0004/44/84 r/w asci status register ch 1 %0005/45/85 r/w asci tx data register ch 0 %0006/46/86 r/w asci tx data register ch 1 %0007/47/87 r/w asci rx data register ch 0 %0008/48/88 r/w asci rx data register ch 1 %0009/49/89 r/w csio control register %000a/4a/8a r/w csio transmit/receive data reg. %000b/4b/8b r/w timer data register ch ol %000c/4c/8c r/w timer data register ch oh %000d/4d/8d r/w reload register ch ol %000e/4e/8e r/w reload register ch oh %000f/4f/8f r/w timer control register %0010/50/90 asci0 extension control reg. %0012/52/92 r/w asci1 extension control reg. %0013/53/93 r/w timer data register ch 1l %0014/54/94 r/w timer data register ch 1h %0015/55/95 r/w timer reload register ch 1l %0016/56/96 r/w timer reload register ch 1h %0017/57/97 r/w free running counter %0018/58/98 r/w asci0 time constant low %001a/5a/9a r/w asci0 time constant high %001b/5b/9b r/w asci1 time constant low %001c/5c/9c r/w asci1 time constant high %001d/5d/9d rw register name i/o addr/access cpu control register %001f/5f/9f r/w dma source addr register ch ol %0020/60/a0 r/w dma source addr register ch oh %0021/61/a1 r/w dma source addr register ch ob %0022/62/a2 r/w dma dest addr register ch ol %0023/63/a3 r/w dma dest addr register ch oh %0024/64/a4 r/w dma dest addr register ch ob %0025/65/a5 r/w dma byte count register ch ol %0026/66/a6 r/w dma byte count register ch oh %0027/67/a7 r/w dma memory addr register ch 1l %0028/68/a8 r/w dma memory addr register ch 1h %0029/69/a9 r/w dma memory addr register ch 1b %002a/6a/aa r/w dma i/o addr register ch 1l %002b/6b/ab r/w dma i/o addr register ch 1h %002c/6c/ac r/w dma i/o addr register ch 1b %002d/6d/ad r/w dma byte count register ch 1l %002e/6e/ae r/w dma byte count register ch 1h %002f/6f/af r/w dma status register %0030/70/b0 r/w dma mode register %0031/71/b1 r/w dma/wait control register %0032/72/b2 r/w il register %0033/73/b3 r/w int/trap control register %0034/74/b4 r/w refresh control register %0036/76/b6 r/w mmu common base register %0038/78/b8 r/w mmu bank base register %0039/79/b9 r/w mmu common/bank area register %003a/7a/ba r/w operation mode control register %003e/7e/be r/w i/o control register %003f/7f/bf r/w 37 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog mpe re te /rts0 mpbr/ efr mod2 mod1 mod0 0 r/w 0 r/w 0 r/w 1 r/w x r/w 0 r/w 0 r/w 0 r/w bit upon reset r/w cntla0 mode selection addr 00h read - multiprocessor bit receive write - error flag reset request to send transmit enable receive enable multiprocessor enable 0 0 0 start + 7-bit data + 1 stop 0 0 1 start + 7-bit data + 2 stop 0 1 0 start + 7-bit data + parity + 1 stop 0 1 1 start + 7-bit data + parity + 2 stop 1 0 0 start + 8-bit data + 1 stop 1 0 1 start + 8-bit data + 2 stop 1 1 0 start + 8-bit data + parity + 1 stop 1 1 1 start + 8-bit data + parity + 2 stop figure 23a. asci control register a (ch. 0) z8s180 mpu registers asci channels control registers mpe re te cka1d mpbr/ efr mod2 mod1 mod0 0 r/w 0 r/w 0 r/w 1 r/w x r/w 0 r/w 0 r/w 0 r/w bit upon reset r/w cntla1 mode selection addr 01h read - multiprocessor bit receive write - error flag reset cka1 disable transmit enable receive enable multiprocessor enable 0 0 0 start + 7-bit data + 1 stop 0 0 1 start + 7-bit data + 2 stop 0 1 0 start + 7-bit data + parity + 1 stop 0 1 1 start + 7-bit data + parity + 2 stop 1 0 0 start + 8-bit data + 1 stop 1 0 1 start + 8-bit data + 2 stop 1 1 0 start + 8-bit data + parity + 1 stop 1 1 1 start + 8-bit data + parity + 2 stop figure 23b. asci control register a (ch. 1) 38 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog mpbt mp /cts/ ps ss2 ss1 ss0 invalid r/w 0 r/w ? r/w 0 r/w 0 r/w 1 r/w 1 r/w 1 r/w r/w cntlb0 clock source and speed select addr 02h bit upon reset dr pe0 divide ratio parity even or odd clear to send/prescale multiprocessor multiprocessor bit transmit ? /cts - depending on the condition of /cts pin. ps - cleared to 0. general ps = 0 ps = 1 divide ratio (divide ratio = 10) (divide ratio = 30) ss, 2, 1, 0 dr = 0 (x16) dr = 1 (x64) dr = 0 (x16) dr = 1 (x64) 000 ? ? 160 ? ? 640 ? ? 480 ? ? 1920 001 ? ? 320 ? ? 1280 ? ? 960 ? ? 3840 010 ? ? 640 ? ? 2560 ? ? 1920 ? ? 7680 011 ? ? 1280 ? ? 5120 ? ? 3840 ? ? 15360 100 ? ? 2560 ? ? 10240 ? ? 7680 ? ? 30720 101 ? ? 5120 ? ? 20480 ? ? 15360 ? ? 61440 110 ? ? 10240 ? ? 40960 ? ? 30720 ? ? 122880 111 external clock (frequency < ?) figure 24. asci control register b (ch. 0) 39 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog asci channels control registers (continued) mpbt mp /cts/ ps ss2 ss1 ss0 invalid r/w 0 r/w 0 r/w 0 r/w 0 r/w 1 r/w 1 r/w 1 r/w r/w cntlb1 clock source and speed select addr 03h bit upon reset dr pe0 divide ratio parity even or odd read - status of /cts pin write - select ps multiprocessor multiprocessor bit transmit general ps = 0 ps = 1 divide ratio (divide ratio = 10) (divide ratio = 30) ss, 2, 1, 0 dr = 0 (x16) dr = 1 (x64) dr = 0 (x16) dr = 1 (x64) 000 ? ? 160 ? ? 640 ? ? 480 ? ? 1920 001 ? ? 320 ? ? 1280 ? ? 960 ? ? 3840 010 ? ? 640 ? ? 2560 ? ? 1920 ? ? 7680 011 ? ? 1280 ? ? 5120 ? ? 3840 ? ? 15360 100 ? ? 2560 ? ? 10240 ? ? 7680 ? ? 30720 101 ? ? 5120 ? ? 20480 ? ? 15360 ? ? 61440 110 ? ? 10240 ? ? 40960 ? ? 30720 ? ? 122880 111 external clock (frequency < ?) figure 25. asci control register b (ch. 1) 40 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog upon reset rdrf ovrn /dcd0 tdre tie 0 r 0 r 0 r 0 r 0 r/w r ?? r 0 r/w r/w s tat 0 transmit interrupt enable addr 04h bit rie fe transmit data register empty data carrier detect receive interrupt enable framing error parity error pe ? over run error receive data register full ? /dcd0 - depending on the condition of /dcd0 pin. ?? /cts0 pin tdre l 1 h 0 figure 26. asci status register (ch. 0) rdrf ovrn cts1e tdre tie 0 r 0 r 0 r 0 r 0 r/w r/w 1 r 0 r/w r/w s tat 1 transmit interrupt enable addr 05h bit upon reset rie fe transmit data register empty reserved receive interrupt enable framing error parity error pe 0 over run error receive data register full figure 27. asci status register (ch. 1) 41 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog rdrf interrupt inhibit send break 0 = normal xmit 1 = drive txa low brg0 mode 0 = as s180 1 = enable 16-bit brg counter x1 bit clk asci0 0 = cka0 /16 or /64 1 = cka0 is bit clock cts0 disable 0 = cts0 auto-enable tx 1 = cts0 advisory to sw dcd0 disable 0 = dcd0 auto-enables rx 1 = dcd0 advisory to sw break detect (ro) break feature enable 00000000 7 65 4 321 0 new z8s180 register asci channels control registers (continued) 76543210 transmit data tdr0 write only addr 06h 76543210 transmit data tdr1 write only addr 07h figure 29. asci transmit data register (ch. 1) xxxxxxxx received data tsr0 read only addr 08h figure 30. asci receive data register (ch. 0) xxxxxxxx received data tsr1 read only addr 09h figure 31. asci receive data register (ch. 1) figure 32. asci0 extension control register (i/o address 12) figure 33. asci1 extension control register (i/o address 13) figure 28. asci transmit data register (ch. 0) break feature enable break detect (ro) send break 0 = normal xmit 1 = drive txa low brg1 mode 0 = as s180 1 = enable 16-bit brg counter x1 bit clk asci1 0 = cka1 /16 or /64 1 = cka1 is bit clock rdrf interrupt inhibit 00000000 7 65 4 321 0 new z8s180 register reserved (program as 0) 42 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog acsi time constant registers new z8s180 registers 76543210 76543210 register: asci0 time constant low address: 1ah register: asci1 time constant low address: 1ch 76543210 76543210 register: asci0 time constant high address: 1bh register: asci1 time constant high address: 1dh csi/o registers ef eie ss2 ss1 ss0 0 r 0 r/w 0 r/w 0 r/w 11 r/w 1 r/w 1 r/w r/w speed select addr 0ah bit upon reset - te transmit enable receive enable end interrupt enable end flag re cntr ss2, 1, 0 baud rate 000 ? ? 20 001 ? ? 40 010 ? ? 80 011 ? ? 100 ss2, 1, 0 baud rate 100 ? ? 320 101 ? ? 640 110 ? ? 1280 111 external clock (frequency < ? ? 20) figure 34. csi/o control register figure 35. csi/o transmit/receive data register 76543210 read - received data write - transmit data trdr read/write addr 0bh 43 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog timer data registers 76543210 tmdr0l read/write addr 0ch figure 36. timer 0 data register l 76543210 tmdr1l read/write addr 14h figure 37. timer 1 data register l 15 14 13 12 11 10 9 8 tmdr0h read/write addr 0dh when read, read data register l before reading data register h. figure 38. timer 0 data register h 15 14 13 12 11 10 9 8 tmdr1h read/write addr 15h when read, read data register l before reading data register h. figure 39. timer 1 data register h timer reload registers 76543210 rldr0l read/write addr 0eh figure 40. timer 0 reload register l 76543210 rldr1l read/write addr 16h 15 14 13 12 11 10 9 8 rldr0h read/write addr 0fh figure 42. timer 0 reload register h 15 14 13 12 11 10 9 8 rldr1h read/write addr 17h figure 41. timer 1 reload register l figure 43. timer 1 reload register h 44 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog timer control register tif1 tif0 toc0 tde1 tde0 0 r 0 r 0 r/w 0 r/w 0 r/w r/w 0 r/w 0 r/w r/w tcr timer down count enable 1,0 addr 10h bit upon reset toc1 tie0 timer output control 1,0 timer interrupt enable 1,0 timer interrupt flag 1,0 tie1 0 toc1,0 a15/tout 00 inhibited 01 toggle 10 0 11 1 figure 44. timer control register free running counter figure 45. free running counter 76 543 210 frc read only addr 18h cpu control register 000 00 000 cpu control register (ccr) d7 d6 d5 d4 d3 d2 d1 d0 addr 1fh figure 46. cpu control register note: see figure 87 for full description. 45 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog dma registers sar0l read/write addr 20h sa7 sa0 sar0h read/write addr 21h sa15 sa8 sar0b read/write addr 22h sa16 sa19 - --- bits 0-3 are used for sar0b sm1-0 11 11 11 11 11 sar18-16 000 001 010 011 111 source ext (tout/dreq) asci0 rx asci1 rx escc rx pia27-20 in figure 47. dma 0 source address registers figure 48. dma 0 destination address registers dar0l read/write addr 23h da7 da0 dar0h read/write addr 24h da15 da8 dar0b read/write addr 25h da16 da19 - --- bits 0-3 are used for dar0b dm1-0 11 11 11 11 11 dar18-16 000 001 010 011 111 destination ext (tout/dreq) asci0 tx asci1 tx escc tx pia27-20 out 46 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog figure 49. dma 0 byte counter registers bcr0l read/write addr 26h bc7 bc0 bcr0h read/write addr 27h bc15 bc8 mar1l read/write addr 28h ma7 ma0 mar1h read/write addr 29h ma15 ma8 mar1b read/write addr 2ah ma16 ma19 - --- figure 50. dma 1 memory address registers d7 d6 d5 d4 d3 d2 d1 d0 alternating channels 0 = dma channels are independent 1 = toggle between dma channels for same device currently selected dma channel when bit 7 = 1 reserved, program as 0. 0 = tout//dreq is dreq in 1 = tout//dreq is tout out 000 = dma1 ext tout/dreq 001 = dma1 asci0 010 = dma1 asci1 011 = dma1 escc 111 = dma1 pia27-20 (p1284) iar1b addr 2d new z8s180 register figure 51. dma i/o address register ch. 1 47 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog dma register description bit 7. this bit should be set to 1 only when both dma channels are set to take their requests from the same device. if this bit is 1 (it resets to 0), the channel end output of dma channel 0 sets a flip-flop, so that thereafter the devices request is visible to channel 1, but is not visible to channel 0. the channel end output of channel 1 clears the ff, so that thereafter, the devices request is visible to channel 0, but not visible to channel 1. bit 6. when both dma channels are programmed to take their requests from the same device, this bit (ff mentioned in the previous paragraph) controls which channel the devices request is presented to: 0 = dma 0, 1 = channel 1. when bit 7 is 1, this bit is automatically toggled by the channel end output of the channels, as described above. bits 5-4. reserved and should be programmed as 0. bits 3. this bit controls the direction and use of the tout/ dreq pin. when its 0, tout/dreq is the dreq input; when its 1, tout/dreq is an output that can carry the tout signal from prt1, if prt1 is so programmed. bits 2-0. with dim1, bit 1 of dcntl, these bits control which request is presented to dma channel 1, as follows: dim1 iar18-16 request routed to dma channel 1 0 000 ext tout/dreq 0 001 asci0 tx 0 010 asci1 tx 0 011 emscc out 0 10x reserved, do not program. 0 1x0 reserved, do not program. 0 111 pia27-20 out 1 000 ext tout/dreq 1 001 asci0 rx 1 010 asci1 rx or tout//dreq pin 1 011 emscc in 1 10x reserved, do not program. 1 1x0 reserved, do not program. 1 111 pia27-20 in iar1l read/write addr 2bh ia7 ia0 iar1h read/write addr 2ch ia15 ia8 figure 52. dma i/o address registers bcr1l read/write addr 2eh bc7 bc0 bcr1h read/write addr 2fh bc15 bc8 figure 53. dma 1 byte count registers de1 de0 die0 - dime 0 r/w 0 r/w 1 w 1 w 00 r/w 10 r r/w dma master enable addr 30h bit upon reset die1 /dwe0 dma interrupt enable 1, 0 dma enable bit write enable 1, 0 dma enable ch 1, 0 /dwe1 d s tat r/w figure 54. dma status register 48 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog dma registers (continued) - - sm0 mmod - 110 r/w 0 r/w 00 r/w 01 r/w memory mode select addr 31h bit upon reset sm1 dm0 ch 0 source mode 1, 0 ch 0 destination mode 1, 0 dm1 dmode r/w r/w dm1, 0 00 01 10 11 destination m m m i/o address dar0+1 dar0-1 dar0 fixed dar0 fixed sm1, 0 00 01 10 11 source m m m i/o address sar0+1 sar0-1 sar0 fixed sar0 fixed 0 1 mode cycle steal mode burst mode mmod figure 55. dma mode registers 49 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog dma registers (continued) mwi1 mwi0 dms0 dim1 dim0 111 r/w 1 r/w 00 r/w 00 r/w dma ch 1 i/o memory mode select addr 32h bit upon reset dms1 iwi0 /dreqi select, i = 1, 0 i/0 wait insertion iwi1 dcntl r/w r/w r/w r/w r/w memory wait insertion dm1, 0 00 01 10 11 transfer mode m - i/o m - i/o i/o - m i/o - m address increment/decrement dmsi 1 0 sense edge sense level sense mwi1, 0 00 01 10 11 no. of wait states 0 1 2 3 iwi1, 0 00 01 10 11 no. of wait states 1 2 3 4 mar1+1 mar1-1 iar1 fixed iar1 fixed iar1 fixed iar1 fixed mar1+1 mar1-1 * note: * if using the wait-state generators provided in register d8, the mwi1-0 bits should be set to 00. figure 56. dma/wait control register 50 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog system control registers il7 il6 - - - 000 r/w 00000 r/w interrupt vector low addr 33h bit upon reset - - il5 il r/w r/w figure 57. interrupt vector low register trap ufo ite2 ite1 ite0 001 110 r/w 01 r/w /int enable 2, 1, 0 addr 34h bit upon reset - - - itc r/w r r/w r/w undefined fetch object trap figure 58. int/trap control register refe refw - cyc1 cyc0 111 11100 r/w cycle select addr 36h bit upon reset - - refresh wait state refresh enable - rcr r/w r/w r/w r/w cyc1, 0 00 01 10 11 interval of refresh cycle 10 states 20 states 40 states 80 states figure 59. refresh control register 51 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog mmu registers cb7 cb6 cb2 cb1 cb0 00 0 r/w 0 r/w 00 r/w 00 r/w mmu common base register addr 38h bit upon reset cb3 cb4 cb5 cbr r/w r/w r/w r/w r/w figure 60. mmu common base register bb7 bb6 bb2 bb1 bb0 00 0 r/w 0 r/w 00 r/w 00 r/w mmu bank base register addr 39h bit upon reset bb3 bb4 bb5 bbr r/w r/w r/w r/w r/w figure 61. mmu bank base register ca3 ca2 ba2 ba1 ba0 11 1 r/w 1 r/w 00 r/w 00 r/w mmu bank area register addr 3ah bit upon reset ba3 ca0 ca1 cbar r/w r/w r/w r/w r/w mmu common area register figure 62. mmu common/bank area register 52 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog system control registers figure 63. operation mode control register m1e /m1te --- 111 11 111 r/w i/o compatibility addr 3eh bit upon reset - - /m1 temporary enable /m1 enable /ioc omcr w r/w r/w notes: 1. this register should be programmed to 0x0xxxxxb (x = don't care) as a part of initialization. 2. if the m1e bit is set to 1, the processor does not fetch a reti instruction. ioa7 ioa6 --- 000 11111 r/w i/o stop addr 3fh bit upon reset - - i/o address combination of 11 is reserved iostp icr r/w r/w r/w figure 64. i/o control register 53 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog cpu control register the cpu control register allows the programmer to select options that directly affect the cpu performance as well as controlling the standby operating mode of the chip. the cpu control register (ccr) allows the programmer to change the divide-by-two internal clock to divide-by-one. in addition, applications where emi noise is a problem, the z8s180 can reduce the output drivers on selected groups of pins to 33 percent of normal pad driver capability which minimizes the emi noise generated by the part (figure 65). 0 0000000 d7 d6 d5 d4 d3 d2 d1 d0 lncpuctl 0 = standard drive 1 = 33% drive on cpu control signals cpu control register (ccr) addr 1fh lnad/data 0 = standard drive 1 = 33% drive on a19-a0, d7-d0 lnio 0 = standard drive 1 = 33% drive on certain external i/o standby/idle enable 00 = no standby 01 = idle after sleep 10 = standby after sleep 11 = standby after sleep 64 cycle exit (quick recovery) lnphi 0 = standard drive 1 = 33% drive on ext.phi clock brext 0 = ignore busreq in standby/idle 1 = standby/idle exit on busreq clock divide 0 = xtal/2 1 = xtal/1 new z8s180 register figure 65. cpu control register 54 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog bit 7. clock divide select. bit 7 of the ccr allows the programmer to set the internal clock to divide the external clock by two if the bit is 0 and divide-by-one if the bit is 1. upon reset, this bit is set to 0 and the part is in divide-by-two mode. since the on-board oscillator is not guaranteed to operate above 20 mhz, an external source must be used to achieve the maximum 33 mhz operation of the device, such as an external clock at 66 mhz with 50 percent duty cycle. if an external oscillator is used in divide-by-one mode, the minimum pulse width requirement must be satisfied. bits 6 and 3. standby/idle enable. these two bits are used for enabling/disabling the idle and standby mode. setting d6, d3 to 0 and 1, respectively, enables the idle mode. in the idle mode, the clock oscillator is kept oscillating but the clock to the rest of the internal circuit, including the clkout, is stopped. the z8s180 enters idle mode after fetching the second opcode of a sleep instruction, if the i/o stop bit is set. setting d6, d3 to 1 and 0, respectively, enables the standby mode. in the standby mode, the clock oscil- lator is stopped completely. the z8s180 enters standby after fetching the second opcode of a sleep instruction, if the i/o stop bit is set. setting d6, d3 to 1 and 1, respectively, enables the standby-quick recovery mode. in this mode, its operations are identical to standby except that the clock recovery is reduced to 64 clock cycles after the exit conditions are gathered. similarly, in standby mode, the z8s180 enters standby after fetching the second opcode of a sleep instruction, if the i/o stop bit is set. bit 5. brext. this bit controls the ability of the z8s180 to honor a bus request during standby mode. if this bit is set to 1 and the part is in standby mode, a busreq is honored after the clock stabilization timer is timed out. bit 4. lnphi. this bit controls the drive capability on the phi clock output. if this bit is set to 1, the phi clock output is reduced to 33 percent of its drive capability. bit 2. lnio. this bit controls the drive capability of certain external i/o pins on the z8s180. when this bit is set to 1, the output drive capability of the following pins is reduced to 33 percent of the original drive capability: /rts0/txs txa0 cka1 txa1 cka0 tout bit 1. lncpuctl. this bit controls the drive capability of the cpu control pins. when this bit is set to 1, the output drive capability of the following pins is reduced to 33 percent of the original drive capability: /busack /iorq /rd /rfsh /wr /halt /m1 st /mreq bit 0. lnad/data. this bit controls the drive capability of the address/data bus output drivers. if this bit is set to 1, the output drive capability of the address and data bus output is reduced to 33 percent of its original drive capa- bility. 55 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog on-chip enhanced serial communications controller (emscc) the z80185 contains a single-channel emscc which features a 4-byte transmit fifo and an 8-byte receive fifo, this enhancement reduces the overhead required to provide data to, and get data from, the transmitter and receiver. the emscc also improves packet handling in sdlc mode to: n automatically transmit a flag before the data; n reset the tx underrun/eom latch; n force the txd pin high at the appropriate time when using nrzi encoding; n deassert the /rts pin after the closing flag; and n better handle aborted frames when using the 10x19 status fifo. the combination of these features, along with the data fifos, significantly simplifies sdlc driver software. the cpu hardware interface has been simplified by reliev- ing the databus setup time requirement and supporting the software generation of the interrupt acknowledge sig- nal (/intack). these changes allow an interface with less external logic to many microprocessor families while main- taining compatibility with existing designs. i/o handling of the emscc is improved over the scc, with faster response of the /dtr//req pin. the many enhancements added to the emscc permits a system design that increases overall system performance with better data handling and less interface logic. significant features of the emscc include: n hardware and software compatible with zilog's scc/ escc n 4-byte transmit fifo n 8-byte receive fifo n programmable fifo interrupt levels provide flexible interrupt response n improved sdlc frame status fifo n new programmable features added with write register 7' n write registers: wr3, wr4, wr5, and wr10 are now readable n read register 0 latched during access n many improvements to support sdlc/hdlc transfers: C deactivation of /rts pin after closing flag C automatic transmission of the opening flag C automatic reset of tx underrun/eom latch C complete crc reception C txd pin automatically forced high with nrzi encoding when using mark idle. C receive fifo automatically unlocked for special receive interrupts when using the sdlc status fifo. C back-to-back frame transmission simplified n software interrupt acknowledge mode n dpll counter output available as jitter-free clock source n a full-duplex channel with a baud rate generator and digital phase-locked loop n multi-protocol operation under program control n asynchronous or synchronous mode in addition, the following features have been added to the emscc channel in the z80185: n programmable localtalk feature n non-multiplexed /dtr pin n internal connection of dma request and /wait signals n emscc programmable clock C programmed to be equal to system clock divided by one or two C programmed by system configuration register note: the emscc programmable clock must be pro- grammed to divide-by-two mode when operating above the following condition: phi > 20 mhz at 5.0v 56 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog transmit logic receive and transmit clock multipexer transmit fifo 4 bytes transmit mux data encoding & crc generation digital phase-locked loop baud rate generator crystal oscillator amplifier modem/control logic receive mux crc checker, data decode & sync character detection rec. status fifo 8-byte rec. data fifo 8-byte sdlc frame status fifo 10 x 19 receive logic txd /trxc /rtxc /cts /dcd /rts /dtr rxd interrupt control logic databus control cpu & dma bus interface /int /intack iei ieo interrupt control channel a tx-rx internal control logic channel a register figure 66. emscc block diagram 57 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog emscc the z80185 features a one-channel emscc that uses two i/o addresses: emscc channel a control i/o address %e8 data i/o address %e9 divide-by-two should be programmed when operating the z80185 beyond 20 mhz, 5v. note: upon power-up, or reset, the system clock is equal to the emscc clock. initialization. the system program first issues a series of commands to initialize the basic mode of operation. this is followed by other commands to qualify conditions within the selected mode. for example, in the asynchronous mode, character length, clock rate, number of stop bits, and even or odd parity should be set first. then the interrupt mode is set, and finally, the receiver and transmit- ter are enabled. write registers. the emscc contains 16 write registers (17 counting the transmit buffer) in each channel. these write registers are programmed separately to configure the functional "personality" of the channels. a new register, wr7', was added to the emscc and may be written to if wr15, d0 is set. figure 50 shows the format of each write register. read registers. the emscc contains ten read registers (11 counting the receive buffer) in each channel. four of these may be read to obtain status information (rr0, rr1, rr10, and rr15). two registers (rr12 and rr13) are read to learn the baud rate generator time constant. rr2 contains either the unmodified interrupt vector (channel a) or the vector modified by status information (channel b). rr3 contains the interrupt pending (ip) bits (channel a only). rr6 and rr7 contain the information in the sdlc frame status fifo, but is only read when wr15 d2 is set. if wr7' d6 is set, write registers wr3, wr4, wr5, wr7, and wr10 can be read as rr9, rr4, rr5, and rr14, respectively. figure 51 shows the format of each read register. with the z80185, the emscc channel's dtr, tx and rx dma request and wait outputs are not subject to multi- plexing and are routed separately to the cpu and pins. in other words, 1. the dtr pin is not multiplexed and always follows wr5 bit 7; 2. if wr1 bits 7-6 are 10, and the processor reads the rdr when the rxfifo is empty, or writes the tdr when the txfifo is full, the processor is "waited" until a character arrives or has been sent out; 3. wr1 bit 5 has no effect; 4. wr14 bit 2 should be kept 0; 5. wr1 bits 7-6 should not be programmed as 11. 58 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog a localtalk feature has been added in one emscc of the z80185, operating as follows: if a certain set of register bits are set, rts acts as a localtalk driver enable output that operates as shown in figure 50. all of the following bits and fields must be programmed exactly as shown to enable this mode: wr4.3-2 = 00: sync modes wr4.5-4 = 10: sdlc wr5.1 = 0: no rts wr7'.2 = 1: auto rts deactivation wr10.3 = 1: mark idle wr5.4 = 1: send break when the first five conditions above are set (as for localtalk operation), the wr5.4 bit is used as a select localtalk driver enable control bit, rather than the send break command bit used in async mode. setting these register bits in this manner configures the emscc transmitter to send three flags before a frame, negating rts during the first to create a coding violation, when software writes the first character of a frame to the tdr and txfifo. this mode also makes the transmitter ensure at least 16 bits of idle time between a closing flag and the end of frame interrupt. the rts output is driven active for one bit time at the start of the first of the three flags, then inactive for four bit times, then active again for the duration of the opening flags, the frame, and closing flag, plus 16 bit times thereafter. there is one other difference in emscc operation when this new mode is enabled. the setting of the txip bit, that normally occurs after the last bit of the crc is sent, is delayed until the 16-bit idle is sent and rts is negated. flag frame 16-bit idle rts txd flag flag flag figure 67. emscc transmitter flag commands 59 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog emscc registers d7 d6 d5 d4 d3 d2 d1 d0 0 0 0 register 0 0 0 1 register 1 0 1 0 register 2 0 1 1 register 3 1 0 0 register 4 1 0 1 register 5 1 1 0 register 6 1 1 1 register 7 0 0 0 register 8 0 0 1 register 9 0 1 0 register 10 0 1 1 register 11 1 0 0 register 12 1 0 1 register 13 1 1 0 register 14 1 1 1 register 15 with point high command * * write register 0 (non-multiplexed bus mode) 0 0 0 null code 0 0 1 point high 0 1 0 reset ext/status interrupts 0 1 1 send abort (sdlc) 1 0 0 enable int on next rx character 1 0 1 reset tx int pending 1 1 0 error reset 1 1 1 reset highest ius 0 0 null code 0 1 reset rx crc checker 1 0 reset tx crc generator 1 1 reset tx underrun/eom latch d7 d6 d5 d4 d3 d2 d1 d0 v0 write register 2 v1 v2 v3 v4 v5 v6 v7 interrupt vector d7 d6 d5 d4 d3 d2 d1 d0 write register 1 ext int enable tx int enable parity is special condition 0 0 rx int disable 0 1 rx int on first character or special condition 1 0 int on all rx characters or special condition 1 1 rx int on special condition only reserved, program as 00. wait request enable d7 d6 d5 d4 d3 d2 d1 d0 write register 4 parity enable 0 0 x1 clock mode 0 1 x16 clock mode 1 0 x32 clock mode 1 1 x64 clock mode parity even//odd 0 0 sync modes enable 0 1 1 stop bit/character 1 0 1 1/2 stop bits/character 1 1 2 stop bits/character 0 0 8-bit sync character 0 1 16-bit sync character 1 0 sdlc mode (01 11111 0 flag) 1 1 external sync mode d7 d6 d5 d4 d3 d2 d1 d0 write register 3 rx enable 0 0 rx 5 bits/character 0 1 rx 7 bits/character 1 0 rx 6 bits/character 1 1 rx 8 bits/character sync character load inhibit address search mode (sdlc) rx crc enable enter hunt mode auto enables figure 68. write register bit functions 60 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog d7 d6 d5 d4 d3 d2 d1 d0 write register 5 tx crc enable 0 0 tx 5 bits(or less)/character 0 1 tx 7 bits/character 1 0 tx 6 bits/character 1 1 tx 8 bits/character rts /sdlc/crc-16 tx enable send break (async mode) localtalk driven enable (hdlc mode) dtr d7 d6 d5 d4 d3 d2 d1 d0 write register 6 sync3 sync3 sync3 1 adr3 x sync2 sync2 sync2 1 adr2 x sync1 sync1 sync1 1 adr1 x sync0 sync0 sync0 1 adr0 x monosync, 8 bits monosync, 6 bits bisync, 16 bits bisync, 12 bits sdlc sdlc (address range ) sync4 sync4 sync4 sync0 adr4 adr4 sync5 sync5 sync5 sync1 adr5 adr5 sync6 sync0 sync6 sync2 adr6 adr6 sync7 sync1 sync7 sync3 adr7 adr7 d7 d6 d5 d4 d3 d2 d1 d0 write register 7 sync3 sync1 sync11 sync7 1 sync2 sync0 sync10 sync6 1 sync1 x sync9 sync5 1 sync0 x sync8 sync4 0 monosync, 8 bits monosync, 6 bits bisync, 16 bits bisync, 12 bits sdlc sync4 sync2 sync12 sync8 1 sync5 sync3 sync13 sync9 1 sync6 sync4 sync14 sync10 1 sync7 sync5 sync15 sync11 0 figure 69. write register bit functions (continued) 61 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog emscc registers (continued) d7 d6 d5 d4 d3 d2 d1 d0 write register 10 6-bit//8-bit sync 0 0 nrz 0 1 nrzi 1 0 fm1 (transition = 1) 1 1 fm0 (transition = 0) loop mode abort//flag on underrun mark//flag idle go active on poll crc preset i//o d7 d6 d5 d4 d3 d2 d1 d0 wr' prime auto tx flag auto eom reset auto rts deactivation rx fifo int level tx dma request timing mode tx fifo int level extended read enable 32-bit crc enable d7 d6 d5 d4 d3 d2 d1 d0 write register 11 0 0 /trxc out = xtal output 0 1 /trxc out = transmit clock 1 0 /trxc out = br generator outpu t 1 1 /trxc out = dpll output /trxc o/i 0 0 transmit clock = /rtxc pin 0 1 transmit clock = /trxc pin 1 0 transmit clock = br generator output 1 1 transmit clock = dpll output 0 0 receive clock = /rtxc pin 0 1 receive clock = /trxc pin 1 0 receive clock = br generator output 1 1 receive clock = dpll output reserved d7 d6 d5 d4 d3 d2 d1 d0 write register 9 vis 0 0 no reset 0 1 not used 1 0 channel reset 1 1 force hardware reset nv dlc mie status high//status low software intack enable figure 70. write register bit functions (continued) 62 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog d7 d6 d5 d4 d3 d2 d1 d0 tc0 write register 12 tc1 tc2 tc3 tc4 tc5 tc6 tc7 lower byte of time constant d7 d6 d5 d4 d3 d2 d1 d0 write register 14 0 0 0 null command 0 0 1 enter search mode 0 1 0 reset missing clock 0 1 1 disable dpll 1 0 0 set source = br generator 1 0 1 set source = /rtxc 1 1 0 set fm mode 1 1 1 set nrzi mode br generator enable br generator source reserved, program as 0. auto echo local loopback d7 d6 d5 d4 d3 d2 d1 d0 wr7' sdlc feature enab le write register 15 zero count ie sdlc fifo enable dcd ie sync/hunt ie cts ie tx underrun/eom ie break/abort ie d7 d6 d5 d4 d3 d2 d1 d0 tc8 write register 13 tc9 tc10 tc11 tc12 tc13 tc14 tc15 upper byte of time constant figure 71. write register bit functions (continued) 63 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog emscc registers (continued) d7 d6 d5 d4 d3 d2 d1 d0 0 read register 3 0 0 ext/status ip tx ip rx ip 0 0 d7 d6 d5 d4 d3 d2 d1 d0 rx character available read register 0 zero count tx buffer empty dcd sync/hunt cts tx underrun/eom break/abort d7 d6 d5 d4 d3 d2 d1 d0 all sent read register 1 residue code 2 residue code 1 residue code 0 parity error rx overrun error crc/framing error end of frame (sdlc) d7 d6 d5 d4 d3 d2 d1 d0 bc0 read register 6* bc1 bc2 bc3 bc4 bc5 bc6 bc7 *can only be accessed if the sdlc fifo enhancement is enabled (wr15 bit d2 set to 1) sdlc fifo status and byte count (lsb) d7 d6 d5 d4 d3 d2 d1 d0 v0 read register 2 v1 v2 v3 v4 v5 v6 v7 interrupt vector d7 d6 d5 d4 d3 d2 d1 d0 bc8 read register 7* bc9 bc10 bc11 bc12 bc13 fda: fifo data available 1 = status reads from fifo 0 = status reads from emscc *can only be accessed if the sdlc fifo enhancement is enabled (wr15 bit d2 set to 1) sdlc fifo status and byte count (lsb) fos: fifo overflow status 1 = fifo overflowed 0 = normal figure 72. read register bit functions 64 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog d7 d6 d5 d4 d3 d2 d1 d0 0 read register 10 on loop 0 0 loop sending 0 two clocks missing one clock missing d7 d6 d5 d4 d3 d2 d1 d0 tc8 read register 13 tc9 tc10 tc11 tc12 tc13 tc14 tc15 upper byte of time constant d7 d6 d5 d4 d3 d2 d1 d0 tc0 read register 12 tc1 tc2 tc3 tc4 tc5 tc6 tc7 lower byte of time constant d7 d6 d5 d4 d3 d2 d1 d0 0 read register 15 zero count ie sdlc status fifo enable dcd ie sync/hunt ie cts ie tx underrun/eom ie break/abort ie figure 73. read register bit functions (continued) 65 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog p1284 register map register name i/o addr/access parm register %d9 r/w parc register (asymmetric) %da r/w parc2 register %db wo part register %dc r/w parv register %dd r/w z80185 bidirectional centronics p1284 controller the centronics p1284 controller can operate in either the host or peripheral role in compatibility mode (host to printer), nibble or byte mode (printer to host), and ecp mode (bidirectional). it provides no hardware support for the epp mode, although it may be possible to implement this mode by software. nine control signals have dedicated hardware pins, and have 12 ma drive (p1284 level 2) capability as does the 8-bit data port pia27-20. note: signal names listed below are those for the original compatible mode. the names shown in parentheses represent the same signal, but in a more recent mode. the z80185 does not include hardware support for the p1284 epp mode. the following signals are outputs in a peripheral mode, inputs in a host mode: n busy (ptrbusy, periphack) n nack (ptrclk, periphclk) n perror (ackdatareq, nackreverse) n nfault (ndataavail, nperiphrequest) n select (xflag) the following signals are inputs in a peripheral mode, outputs in a host mode: n nstrobe (hostclk) n nautofd (hostbusy, hostack) n nselectin (p1284active) n ninit (nreverserequest) note that, because the host/peripheral mode is fully con- trolled by software, a z80185-based product can operate as a host in one system, or as a peripheral in another, without any change to the hardware. a z80185-based product could even act as a host at one time and a peripheral at another time within the same system, if there is a mechanism to control such alternate use. in general, the interface architecture automates opera- tions that are seen as performance-critical, while leaving less frequent operations to software control. to achieve top performance, software should assign a dma channel to the current direction of data flow. note: the ieee 1284 interface should be used with the /ioc bit (bit d5) in the omcr set to 0. the setting of this bit primarily affects rle expansion in peripheral ecp forward and host ecp reverse modes. 66 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog bidirectional centronics registers reading the parallel controls (parc) register allows soft- ware to sense the state of the input signals per the current mode, plus two or three status flags: busy perror select nfault nack illop dreq idle 76543210 the controller sets illop (illegal operation) when it detects an error in the protocol, for example, if its in peripheral mode and it detects that the host has driven p1284active (nselectin) low at a time that mandates an immediate abort, that is, outside one of the windows in which this event indicates an organized disengagement. if status interrupts are enabled, such an interrupt is always re- quested when illop is set. writing parm with newmode=1 clears illop . dreq is the request presented to the dma channels, which may or may not be programmed to service this request. if not, an interrupt can be enabled when dreq is set. writing to parc allows the software to set and clear the output signals per the current mode: 76543210 1=drive busy high 1=drive perror high 1=drive select high 1=drive nfault high 1=drive busy low 1=drive perror low 1=drive select low 1=drive nfault low 76543210 1=drive nautofd high 1=drive nstrobe high 1=drive nselctin high 1=drive ninit high 1=drive nautofd low 1=drive nstrobe low 1=drive nselctin low 1=drive ninit low figure 75b. writing to parc in a peripheral mode (i/o address %da) figure 75a. writing to parc in a host mode (i/o address %da) 76543210 nautofd nstrobe nslctin ninit illop dreq idle figure 74b. reading parc in a peripheral mode (i/o address %da) figure 74a. reading parc in a host mode (i/o address %da) 67 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 bidirectional centronics p1284 controller (continued) because there are five outputs in a peripheral mode, another register, called parc2, allows software to change the nack line, rather than the select line: 76543210 1=drive busy high 1=drive perror high 1=drive nack high 1=drive nfault high 1=drive busy low 1=drive perror low 1=drive nack low 1=drive nfault low figure 76. writing to parc2 in a peripheral mode (i/o address %db) the parallel mode register (parm) includes the basic mode control of the controller: 7 6 5 4 3210 newmode idleie statie dreqie mode figure 77. parm (i/o address %d9) newmode = 1 reinitializes the state machine to the initial state for the mode called out by mode. never change mode without writing a 1 in this bit. idleie = 1 enables interrupts when the controller sets the idle flag. when software uses a dma channel to provide data to the p1284 controller, it can be expected that the channel will do so in a timely manner, and thus, that an idle condition signifies that the channel has finished transfer- ring the block. (software can also enable an interrupt from the dma channel, but on the transmit side, such interrupts are not well-synchronized to events on the p1284 control- ler.) conversely, if software provides data, idle may not be grounds for an interrupt. some modes set the idle flag when they are entered. however, such a setting of idle never requests an interrupt. statie = 1 enables status interrupts that are described separately for each mode. dreqie = 1 enables interrupts when the controller sets dreq, except that in those modes that set dreq when they are entered, such setting doesnt request an interrupt. table 3. bidirectional centronics mode selection mode 0000 non-p1284 mode 0001 peripheral compatible/negotiation mode 0010 peripheral nibble mode 0011 peripheral byte mode 0100 peripheral ecp reverse mode 0101 peripheral inactive mode 0110 peripheral ecp forward mode with software rle handling 0111 peripheral ecp forward mode with hardware rle expansion 1000 host negotiation mode 1001 host compatible mode 1010 host nibble mode 1011 host byte mode 1100 host ecp forward mode 1101 host reserved mode 1110 host ecp reverse mode with software rle handling 1111 host ecp reverse mode with hardware rle expansion 68 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog a second output register has been added for pia27-20. writing to either the z80181-compatible pia 2 data regis- ter (address e3) or the new alternate pia 2 data register (address ee) writes to the output holding register (ohr). when the pia27-20 pins are outputs, the outputs of the ohr are the inputs to the second register, which is called the i/o register (ior), these outputs drive the pia27-20 pins. when the pins are inputs, they are the inputs to the ior, which can be read from the pia 2 data register (address e3). in non-p1284 mode, host negotiation mode, reserved modes, and in peripheral compatible/negotiation mode when the host drives nselectin (p1284active) high to select negotiation, the direction of the pia27-20 pins are controlled by the pia 2 data direction register, as on the z80181. also in these modes the ior is loaded on every phi clock, so that operation is virtually identical to the z80181. in other modes the controller controls the direc- tion of pia27-20 and when the ior is loaded. a time constant register part must be loaded by soft- ware with the smallest number of phi clocks that equals or exceeds the critical time for the mode selected in parm. the critical time is 750 ns for host compatible mode, 500 ns for most other modes, and the time neces- sary to indicate dma completion in host ecp forward and peripheral ecp reverse modes. 76543210 set ius clr ip clr ius number of phi clocks in critical time figure 78. part write (i/o address %dc) reading part yields the status of the ip and ius bits, which are described in the bidirectional centronics inter- face section: 76543210 ius ip 0 number of phi clocks in critical time figure 79. part read (i/o address %dc) the vector register parv must be loaded by software with the interrupt vector to be used for interrupts from this controller. 76543210 interrupt vector figure 80. parv (i/o address %dd) 69 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 bidirectional centronics p1284 controller (continued) parm register state machine state counter data path clocking parc, parc2 registers rle counter time counter part register parv register interrupt logic internal data bus host/peripheral control signal management iei ieo output holding register pia2 data register data path direction pia2 direction register pia27-20 nack busy perror select nfault nautofd nstrobe nselectin ninit figure 81. bidirectional centronics p1284 controller functional block description 70 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog interrupts as in other zilog peripherals, the controller includes an interrupt pending bit (ip), and an interrupt under service bit (ius). the controller is part of an on-chip interrupt acknowl- edge daisy-chain that extends from the iei pin, through the emscc, ctc, and this controller in a programmable priority order, and from the lowest-priority of these devices to the ieo pin. the interrupt request from the controller is logically ored with /int0 and other on-chip interrupt requests to the processor. the controller sets its ip bit whenever any of three condi- tions occurs: 1. parm4 is 1, and the controller sets the dreq bit. this does not include when the controller forces the dreq bit to 1, when software first places the controller in peripheral nibble, peripheral byte, peripheral ecp reverse, host compatible, or host ecp forward mode. 2. parm5 is 1, and a mode-dependent status interrupt condition occurs. the following sections describe the status interrupt conditions (if any) for each mode. 3. parm6 is 1, and the controller sets the idle bit, except when the controller forces the idle bit to 1, when software first places the controller in peripheral nibble, peripheral byte, peripheral ecp reverse, host com- patible, or host ecp forward mode. the following sections describe when idle is set in each mode. once ip is set, it remains set until software writes a 1 to part6. the controller will begin requesting an interrupt of the processor whenever ip is set, its iei signal from the on-chip daisy-chain is high/true, and its ius bit is 0. once it starts requesting an interrupt, the controller will continue to do so until /iorq goes low in an interrupt-acknowledge cycle, or ip is 0, or ius is 1. the controller drives its ieo output high, if its iei input is high, and its ip and ius bits are both 0. a z80 interrupt acknowledge cycle is signalled by /m1 going low, fol- lowed by /iorq going low. the controller, and all other devices in the daisy-chain, freeze the contribution of their ip bits to their ieo outputs while /m1 is low, which prevents new events from affecting the daisy-chain. by the time /iorq goes low, one and only one device will have its iei pin high and its ieo pin low this device responds to the interrupt by providing an interrupt vector, and setting its ius bit. this controller also clears its ip bit when it responds to an interrupt acknowledge cycle. the interrupt service routine, that is initiated when the interrupt vector value identifies an interrupt from this con- troller, should save the processor context and then pro- ceed as follows: 1. if the isr does not allow nested interrupts, it can clear the ip and ius bits by writing hex 60, plus the critical time value to the part, then read the status from parc and proceed based on that status. near the end of the isr it should re-enable processor interrupts. 2. if the isr allows nested interrupts, it can re-enable processor interrupts, clear ip by writing hex 40 plus the critical time value to the part, and then read the status from parc and proceed based on that status. at the end of the isr it should clear ius to allow further interrupts from this controller and devices lower on the daisy-chain, by writing hex 20 plus the critical time value to the part. the remainder of this section describes the operation of the various parm register modes that can be selected. non-p1284 mode the z80185 defaults to this mode after a reset, and this mode is compatible with the use of pia27-20 on the z80181. the directions of pia27-20 can be controlled individually by writing to register e2, as on the z80181. the state of outputs among pia27-20 can be set by writing to register e3, and the state of all eight pins can be sensed by reading register e3. the busy, nack, perror, nfault, and select pins are tri-stated in this mode, while nstrobe, nautofd, nselectin, and ninit are inputs. there are no status interrupts in this mode. peripheral inactive mode this mode operates identically to non-p1284 mode as described above, except that the busy, nack, perror, nfault, and select pins are outputs that can be controlled via the parc and parc2 registers, and status interrupts can occur in response to any edge on nautofd, nstrobe, nselectin, or ninit. this mode differs from peripheral com- patibility/negotiation mode with nselectin (p1284 active) high, only in that the controller will not operate in compat- ibility mode if nselectin goes low. 71 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 bidirectional centronics p1284 controller (continued) host compatible mode 1. setting this mode configures pia27-20 as outputs re- gardless of the contents of register e2. when entering this mode, the controller sets the idle and dreq bits, but these settings do not request an interrupt. 2. if software, or a dma channel, writes eight bits to the output holding register (ohr) when idle is set, the controller transfers the byte to the input/output regis- ter and negates dreq only momentarily, so as to request another byte from software or the dma chan- nel. 3. in this mode, the nautofd line is not under control of the parc register, but rather under control of which regis- ter the software uses to write data to the ohr. each time the controller transfers a byte from the ohr to the input/ output register, it sets nautofd high if the byte was written to address e3, and low if the byte was written to the alternate address ee. in a dma application all of the bytes transferred from one output buffer will have the same state of nautofd, but this state can be changed from one buffer to the next by changing the i/o address used by the dma channel. in non-dma applications software can set the state of nautofd for each character, by writing data to the two different register addresses. 4. when a data byte has been valid on pia27-20 for 750 ns (as controlled by the part register), and the busy and perror lines are low and the select, nack, and nfault lines are high, the controller drives nstrobe low. after the controller has held nstrobe low for 750 ns it drives nstrobe back to high. then it waits for 750 ns of data hold time to elapse. if software or a dma channel has written another byte to the output holding register (thus clearing dreq) by the time this wait is satisfied, the controller transfers the byte from the output holding register to the input/output register, sets dreq again, and returns to the event sequence at the start of this paragraph. otherwise, it sets idle and returns to the event sequence at the start of paragraph #2. status interrupts in this mode include rising and falling edges on perror, nfault, and select. host negotiation mode setting this mode puts pia27-20 under control of registers e2 and e3, as on the z80181. software has complete control of the controller, and can either revert to host compatibility mode, or set one of the following host modes, depending on how the peripheral responds to the negotiation value(s). status interrupts in this mode include rising and falling edges on ptrclk (nack), nackreverse (perror), and nperiphrequest (nfault). nfault is not used during actual p1284 negotiation, but is included because these events are significant during byte and ecp mode idle times. host reserved mode this mode differs from host negotiation mode only in that there are no status interrupts in this mode. peripheral compatible/negotiation mode in this mode, if p1284active (nselectin) is low, the control- ler sets pia27-20 as inputs, regardless of the contents of register e2; when p1284active (nselectin) is high, pia27- 20 are under the control of registers e2 and e3. on entry to this mode, the controller sets the idle bit, if dreq is set from a previous mode. if, in this mode, nstrobe goes (is) low, p1284active (nselectin) is low, and dreq is 0, indicating that any previous data has been taken by the processor or dma channel, the controller captures the data on pia27-20 into the input/output register, sets dreq to notify software or the dma channel to take the byte, drives the busy line high, and one phi clock later drives nack low. when at least 500 ns (as controlled by the part register) have elapsed, the controller drives nack back to high. one phi clock later, if the cpu or dma has taken the data and thus cleared dreq, the controller drives busy back to low, otherwise it sets idle. select, perror and nfault are under software control in this mode, and nautofd can be sensed by software, but has no other effect on operation. 72 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog in this mode, software should monitor for the condition p1284active (nselectin) high, and nautofd low simulta- neously. if software detects this state, it should participate in a negotiation process. software should read the value on pia27-20 and set perror, nfault, xflag, and nack as appropriate for the data value. as long as p1284active (nselectin) remains high in this mode, software is in complete control of the controller. after the host has driven nstrobe low and then high again for an acceptable value, software should reprogram the mode field to the appropri- ate one of the following peripheral modes. status interrupts in this mode include rising and falling edges on p1284active (nselectin) and ninit, and rising and falling edges on hostbusy (nautofd) and hostclk (nstrobe) while p1284active (nselectin) is high. host nibble mode 1. if, during host negotiation mode, software has placed the value 00 or 04 on the data lines, and received a positive response on xflag (select) and a low on ndataavail (nfault) at a rising edge of ptrclk (nack), then after optionally programming a dma channel to store data, it should set this mode. 2. for each byte in this mode, the controller drives hostbusy (nautofd) low and waits until dreq is cleared, indicat- ing that the cpu or dma has taken any previous data, and the peripheral has driven ptrclk (nack) low. at this point it samples the other four status lines from the peripheral into the less-significant four bits of the input/ output register as follows: table 4. nibble mode bit assignments signal first data bit second data bit busy 3 7 perror 2 6 select 1 5 nfault 0 4 the controller then drives hostbusy (nautofd) back to high, and waits for the peripheral to drive ptrclk (nack) back to high. then it drives hostbusy (nautofd) back to low and waits for the peripheral to drive ptrclk (nack) low. at this point it samples the four status lines from the peripheral into the most-significant four bits of the input/ output register, as shown above. then it drives hostbusy (nautofd) back to high, sets the dreq bit, and waits for the peripheral to drive ptrclk (nack) back to high. when this occurs, if the peripheral is driving ndataavail (nfault) low, indicating more data is avail- able, the controller then returns to the event sequence at the start of paragraph #2. 3. if ndataavail (nfault) is high at a rising edge of nack in this mode, indicating that the peripheral has no more data, the controller sets idle and waits for software to program it back to host negotiation mode. software can then select the next mode (reference ieee p1284 specification). if host software is programmed not to select all the data that a peripheral has available, it should first disable the dma channel, if one is in use, then wait for dreq to be 1 and ptrclk (nack) to be high. if ndataavail (nfault) is low at this point, the controller will have already driven hostbusy (nautofd) low to solicit the next byte. software should then program the controller back to host negotiation mode, read the ior to get the current byte, and take the next byte from the peripheral under software control. after the peripheral drives nack high after the second nibble, software can drive p1284active (nselectin) low to tell the peripheral to leave nibble mode. there are no status interrupts in host nibble mode. 73 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 bidirectional centronics p1284 controller (continued) peripheral nibble mode 1. software shouldnt set this mode until there is reverse data available to send. in other words, it should imple- ment the p1284 reverse idle mode via software in peripheral compatibility/negotiation mode. after soft- ware has driven ndataavail (nfault), ackdatareq (perror), and xflag (select) all low to signify that data is available, then driven ptrclk (nack) high after 500 ns, and if requested programmed a dma channel to pro- vide data to send, when it sees hostbusy (nautofd) low to request data, software should set this mode. setting this mode sets dreq and idle, but these settings do not request an interrupt. the pia27-20 pins remain configured for data input but are not used. instead, four of the five control outputs are driven with the ls and ms four bits of the input/output register, as shown in table 2, while ptrclk (nack) serves as a handshake/clock output. on entering this mode the hardware begins routing bits 3-0 of the ior to these lines. 2. if software, or a dma channel, writes a byte to the output holding register when idle is set, the controller immediately transfers the byte to the ior and clears idle, and negates dreq only momentarily to request another byte from software or the dma channel. 3. after data has been valid on the four control outputs for 500 ns (as controlled by the part register), the control- ler drives the ptrclk (nack) line low. then it waits for the host to drive the hostbusy (nautofd) line back to high, after which it drives ptrclk (nack) back to high, switches the four control lines to bits 7-4 of the ior, and begins waiting for the host to drive hostbusy (nautofd) back to low. when bits 7-4 have been valid for 500 ns and the host has driven hostbusy (nautofd) low, the controller drives ptrclk (nack) low again and begins waiting for the host to drive hostbusy (nautofd) high. when hostbusy (nautofd) has been driven high, the control- ler returns the four control outputs to the state set by software in parc. at this point, if software or a dma channel has not yet written another byte to the output holding register (thus clearing dreq), the controller sets idle and waits for software to do so. if/when software or a dma channel has written a new byte to the ohr, the controller transfers the byte to the ior, sets dreq, and clears idle if it had been set. then, when the control outputs have been valid for 500 ns, the control- ler drives ptrclk (nack) to high. it then waits for the host to drive hostbusy (nautofd) back to low, at which time it switches the four control lines back to bits 3-0 of the ior and returns to the event sequence at the start of this paragraph. if there is no more data to send, when the controller sets idle, software should modify parc to make ndataavail (nfault) and ackdatareq (perror) high, and then change the mode to peripheral compatible/negotiation. then (af- ter 500 ns) software should set ptrclk (nack) back to high in parc and enter reverse idle state. status interrupts in peripheral nibble mode include rising and falling edges on p1284active (nselectin) and ninit. the controller sets the illop (illegal operation) bit if p1284active (nselectin) goes low in this mode, before it drives nack high for the status states on the four control lines, or after the host drives hostbusy low thereafter, in which case software should immediately enter peripheral compatibility/negotiation mode. if p1284active goes low, but illop stays 0, indicating that the host negated p1284active in a legitimate manner, software should enter peripheral inactive mode for the duration of the return to compatibility mode, and then enter peripheral compat- ibility/negotiation mode. host byte mode 1. when in host negotiation mode the software has pre- sented the value hex 01 or 05 on pia27-20, it has been acknowledged by the peripheral, and the peripheral has driven ndataavail (nfault) and ackdatareq (perror) to low to indicate data availability and then driven ptrclk (nack) back to high, software should set this mode. this sets pia27-20 as inputs regardless of the contents of register e2, and clears the idle flag. the controller then waits 500 ns (as controlled by the part register) before proceeding. 2. for each byte, the controller drives hostbusy (nautofd) low to indicate readiness for a byte from the peripheral. then it waits for ptrclk (nack) to go low, at which time it captures the state of pia27-20 into the input/output register; sets the dreq bit to request software, or the dma channel to take the byte, and drives hostbusy (nautofd) high and hostclk (nstrobe) low. when software, or the dma channel, has taken the byte (thus clearing dreq) and the peripheral has driven ptrclk (nack) back high, and at least 500 ns after driving hostclk (nstrobe) low, the controller drives hostclk (nstrobe) back to high, and samples ndataavail (nfault). if it is still low, the controller returns to the event sequence at the start of this paragraph, otherwise it sets the idle flag. 74 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog in response to idle, software should enter host negotiation mode. thereafter, it can set hostbusy (nautofd) low, to enter reverse idle state, or enter host compatible mode (reference ieee p1284 specification), or conduct a new negotiation. if software is programmed not to accept all the data that a peripheral has available in this mode, it should first disable the dma channel, if one is in use, and then wait for dreq to be 1 and nack to be 1. then it should reprogram the controller back to host negotiation mode, read the last byte from the ior, drive hostclk (nstrobe) back to high, and then drive p1284active (nselectin) low to instruct the peripheral to leave byte mode. there are no status interrupts in host byte mode. peripheral byte mode 1. software should not set this mode until there is reverse data available to send that is, it should implement the p1284 reverse idle mode via software in peripheral compatibility/negotiation mode. the exact sequenc- ing among ptrclk (nack), ndataavail (nfault), and ackdatareq (perror) differs according to whether this mode is entered directly from negotiation or from reverse idle phase, and is controlled by software. but in either case, before software sets this mode, it should set ndataavail (nfault) and ackdatareq (perror) to low, then after 500 ns, set ptrclk (nack) to high. when it detects that the host has driven hostbusy (nautofd) low to request data, software should set this mode, which sets the dreq and idle flags. 2. in this mode, as long as p1284active (nselectin) re- mains high, the controller drives pia27-20 as outputs, regardless of the contents of register e2. when soft- ware, or a dma channel, writes the first byte to the output holding register, the controller immediately transfers the byte to the input/output register, clears idle but negates dreq only momentarily, to request another byte from software, or the dma channel. 3. after each byte is transferred to the ior, the controller waits 500 ns data setup time (as controlled by the part register) before driving ptrclk (nack) low, and thereaf- ter waits for the host to drive hostbusy (nautofd) high. when this occurs, if software, or the dma channel, has not written more data to the output holding register, that is, if dreq is still set, the controller sets the idle flag and waits for software or the dma channel to do so. if software, or the dma channel, then writes data to the output holding register, the controller clears dreq and idle. when there is data in the ohr and dreq is 0, this guarantees that it is appropriate to keep ndataavail (nfault), and ackdatareq (perror) low to indicate that more data is available, and the controller drives ptrclk (nack) back to high. the controller then waits for a rising edge on hostclk (nstrobe), and then for the host to drive hostbusy (nautofd) low, at which time it transfers the byte from the ohr to the output register, sets dreq, and then it returns to the event sequence at the start of this paragraph. while this mode is in effect, software should monitor the interface for two conditions: case 1: idle set and no more data to send, or case 2: p1284active (nselectin) low. in case #1, the software should write zero to register e3 to keep pia27-20 outputs momentarily, and then set the mode back to peripheral compatibility, so that the inter- face is fully under software control, set ndataavail (nfault) and ackdatareq (perror) high to signify no more data, wait 500 ns, and set ptrclk (nack) back to high. when hostbusy goes back to low, the software should set pia27-20 back to inputs. in case #2, if a falling edge on p1284active happens any time other than between a rising edge on hostclk (nstrobe), and the next falling edge on hostbusy (nautofd), the controller sets the illop bit to notify software that an immediate abort is in order, in which case software should immediately enter peripheral compatibility/negotiation mode. if p1284active goes low, but illop is not set, meaning that the host negated p1284active in a legal manner, software should enter peripheral inactive mode for the duration of the return to compatibility mode, and then enter peripheral compatibility/negotiation mode. status interrupts in peripheral byte mode include rising and falling edges on p1284active (nselectin) and ninit. 75 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 bidirectional centronics p1284 controller (continued) host ecp forward mode 1. after a negotiation for ecp mode, host software should remain in negotiation mode so that it has com- plete control of the interface, until one of two situations occurs. if software has data to send, it should optionally program the dma channel to provide the data, and then set this mode. alternatively, if software has no data to send and it detects that nperiphrequest (nfault) has gone low, indicating the peripheral is requesting re- verse transfer, it should set pia27-20 as inputs, wait 500 ns, drive nreverserequest (ninit) to low to indicate a reverse transfer, and then set host ecp reverse mode. in other words, software should handle all aspects of ecp mode, other than active data transfer sequences. 2. setting this mode configures pia27-20 as outputs re- gardless of the contents of register e2. on entry to this mode, the controller sets idle and dreq to request a byte from software or a dma channel, but these settings do not cause an interrupt request. 3. if software, or a dma channel, writes data to the output holding register while the input/output register is empty, the controller immediately transfers the byte to the ior, clears idle, and negates dreq only momen- tarily, to request another byte. 4. in this mode, the alternate address for the output holding register allows software to send a channel address or an rle count value. such bytes are typi- cally written by software rather than a dma channel. writing to the alternate address loads the ohr and clears dreq, like writing to the primary address, but clears a ninth bit that is set when software, or a dma channel, writes to the primary address. a similar ninth bit is associated with the input/output register, from which it drives the hostack (nautofd) line. 5. as each nine bits arrive in the ior and thus out onto pia27-20 and hostack (nautofd), the controller waits one phi clock and then drives hostclk (nstrobe) to low. it then waits for the peripheral to drive periphack (busy) to high, after which it drives hostclk (nstrobe) back to high. then it waits for the peripheral to drive periphack (busy) back to low. when this has hap- pened, if software or a dma channel has written a new byte to the output holding register, and thus cleared dreq, the controller transfers the byte to the ior, sets dreq again, and returns to the event sequence at the start of this paragraph. otherwise, it returns to the event sequence at the start of paragraph #3. if software, or a dma channel, does not provide a new byte for the time indicated in the part register, the controller sets the idle flag. 6. while this mode is in effect, software should monitor for the condition "idle and no more data left to send", and/ or nperiphrequest (nfault) low. host software has complete freedom as to whether to honor the peripherals reverse request on nfault while it has data to send. when there is no more data, software can set host negotiation mode to have full control of the interface, and if requested can drive p1284active (nselectin) to low in order to terminate ecp mode, or can set host ecp reverse mode, wait 500 ns, and drive nreverserequest (ninit) to low. status interrupts in host ecp forward mode include rising and falling edges on nperiphrequest (nfault). 76 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog peripheral ecp forward modes 1. after a negotiation for ecp mode, peripheral software should remain in compatibility/negotiation mode with p1284active (nselectin) high, so that it has complete control of the interface, though when it detects the host drive hostack (nautofd) low for the second time, it should then set nackreverse (perror) high. if software has data to send, it should drive nperiphrequest (nfault) low at the same time, and optionally program a dma channel to provide the data. whether or not it has data to send, software should then set one of the two ecp forward modes. 2. in these modes, the controller configures pia27-20 as inputs regardless of the contents of register e2. on entry to one of these modes, the controller clears the idle bit, if it had been set. 3. for each byte, the controller waits for the host to drive hostclk (nstrobe) to low. when hostclk (nstrobe) is low and software, or the dma channel, has taken any previous byte and thus cleared dreq, operation di- verges into four cases depending on the state of hostack (nautofd), the mode, the msbit of the data, and the state of an internal 7-bit run-length encoding (rle) counter. if hostack (nautofd) is high, indicating that this byte is neither an rle value, nor a channel address, the control- ler captures the data from pia27-20 into the input/output register, sets dreq to request software, or the dma channel, to take this byte, and drives periphack (busy) high. if the rle counter is zero, the controller waits (if necessary) for the host to drive hostclk (nstrobe) back to high, after which it drives periphack (busy) back to low and returns to the event sequence at the start of paragraph #3. if the rle counter is non-zero, the controller waits for software, or a dma channel, to read the byte from the input/output register, negates dreq only momentarily, and decrements the rle counter. it does this until the rle counter is zero, at which point it proceeds as described above. thus an rle value of n results in the next byte being provided to software, or a dma channel n+1 times. 4. if hostack (nautofd) is low and the ms bit of the byte is zero (pia27 is low), the byte is an rle repeat count. if the mode is hardware rle expansion," the controller transfers (the seven ls bits of) it to the rle counter, leaves dreq cleared, and drives periphack (busy) high. 5. thereafter, the controller waits for the host to drive hostclk (nstrobe) back to high, at which time it drives periphack (busy) back to low, and returns to the event sequence at the start of paragraph #3. 6. if hostack (nautofd) is low, and pia27 is high, the byte is a channel address." in this case, or when pia27 is low and the mode is software rle handling," the controller captures the data from pia27-20 into the input/output register, leaves dreq cleared to keep a dma channel from storing the byte, and sets the idle bit, which it does not otherwise set while in this mode. software should respond to this condition by reading the byte from the pia 2 data register e3. software can then do whatever else is needed to handle the situation, and then set busy high. thereafter the controller clears idle, waits (if necessary) for the host to drive hostclk (nstrobe) back to high, and then drives periphack (busy) back to low and returns to the event sequence at the start of paragraph #3. while this mode is set, if data to send becomes available, software should drive nperiphrequest (nfault) low to alert the host of this fact. also software should monitor the controller for either of two conditions: a. if the host drives nreverserequest (ninit) low in re- sponse to nperiphrequest (nfault) low, software should drive nackreverse (perror) low, optionally program a dma channel to provide the data, and set peripheral ecp reverse mode. b. if p1284active (nselectin) goes low, the controller sets the illop bit in parc, if this occurs between the time the host drives hostclk (nstrobe) low, and when the con- troller subsequently drives periphack (busy) back to low, in which case software should immediately enter peripheral compatibility/negotiation mode. if p1284ac- tive goes low, but illop stays zero, indicating a legal termination, software should enter peripheral inactive mode and sequence the nackreverse (perror), periphack (busy), periphclk (nack), nperiphrequest (nfault), and xflag (select) lines to leave ecp mode. status interrupts in peripheral ecp forward mode include rising and falling edges on p1284active (nselectin) and nreverserequest (ninit). 77 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 bidirectional centronics p1284 controller (continued) host ecp reverse modes 1. in these modes the controller configures pia27-20 as inputs, regardless of the contents of register e2. on entry to one of these modes, the controller clears the idle bit, if it had been set. 2. for each byte, the controller waits for the peripheral to drive periphclk (nack) low. when this happens, and software, or the dma channel, has taken any previous byte from the input/output register and thus cleared dreq, operation diverges into four cases, depending on the state of periphack (busy), the mode, the ls bit of the data, and the state of an internal 7-bit rle counter. if periphack (busy) is high, indicating that this byte is neither an rle value nor a channel address, the controller captures the data from pia27-20 in the ior, sets dreq to notify software, or the dma channel to take the byte, and drives hostack (nautofd) high. if the rle counter is zero, the controller then waits (if neces- sary) for the peripheral to drive periphclk (nack) back to high, after which it drives hostack (nautofd) back to low and returns to the event sequence at the start of paragraph #2. if the rle counter is non-zero, the controller waits for software, or the dma channel, to read the byte from the ior, negates dreq only mo- mentarily, and decrements the rle counter. it does this until the rle counter is zero, at which point it proceeds as described above. thus an rle value of n results in the next byte being provided to software or a dma channel n+1 times. 3. if periphack (busy) is low, and the msbit of the byte is zero (pia27 is low), the byte is an rle repeat count. if the mode is hardware rle expansion, the controller transfers (the seven lsbits of) it to the rle counter, leaves dreq cleared, and drives hostack (nautofd) high. thereafter the controller waits for the peripheral to drive periphclk (nack) back to high, at which time it drives hostack (nautofd) back to low and returns to the event sequence at the start of paragraph #2. 4. if periphack (busy) is low, and the msbit of the byte is 1 (pia27 is high), the byte is a channel address. in this case, or when the lsbit is zero, but the mode is software rle handling," the controller captures the data from pia27-20 in the ior, leaves dreq cleared, to keep a dma channel from storing the byte, and sets idle, which it does not otherwise set in this mode. software should respond to this condition by reading the byte from the pia 2 data register e3, reprogramming a dma channel, if necessary, and doing whatever else is needed to handle the channel address, and finally setting hostack (nautofd) high. thereafter the control- ler clears idle, waits for the peripheral to drive periphclk (nack) back to high, and then drives hostack (nautofd) back to low, and returns to the start of the event sequence in paragraph #2 above. 5. if data has become available to be sent while this mode is in effect and software elects to send it, it should drive nreverserequest (ninit) to high, set host negotiation mode to take full control of the interface, wait for nackreverse (perror) to go high, and then set pia27- 20 as outputs. 6. status interrupts in host ecp reverse mode include rising and falling edges on nperiphrequest (nfault). nperiphrequest carries a valid reverse data available indication during reverse ecp mode. if so, enable status interrupts during this mode; if not, disable them. 78 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog peripheral ecp reverse mode 1. in this mode, as long as nreverserequest (ninit) is low, and p1284active (nselectin) is high, the controller drives the contents of the input/output register onto pia27-20, regardless of the contents of the e2 register. on entry to this mode, the controller sets idle, and sets dreq to request data from software, or a dma channel. 2. if software, or a dma channel, writes data to the output holding register while the input/output register is empty, the controller immediately transfers the byte to the ior, clears idle, and negates dreq only momen- tarily, to request another byte. 3. in this mode, an alternate address for the output holding register allows software to send a channel address or an rle count value. such bytes are not typically written by a dma channel. writing to this alternate address loads the ohr and clears dreq, the same as writing to the primary address, but clears a ninth bit set when software, or a dma channel, writes to the primary address. a similar ninth bit is associated with the ior, and drives the periphack (busy) line in this mode. 4. as each nine bits arrive in the ior, and thus out onto pia27-20 and periphack (busy), the controller waits one phi clock, and then drives periphclk (nack) low. it then waits for the host to drive hostack (nautofd) high, after which it drives periphclk (nack) back to high. the controller then waits for the host to drive hostack (nautofd) back to low. when this has hap- pened, if software, or the dma channel, has written a new byte to the output holding register, and thus cleared dreq, the controller transfers the byte to the ior, sets dreq again, and returns to the start of the event sequence in this paragraph. otherwise, it returns to the event sequence at the start of paragraph #2. if software, or the dma channel, doesnt provide new data within the time indicated by the part register, the controller sets the idle bit. 5. while this mode is in effect, software should monitor whether the host drives nreverserequest (ninit) high. if it detects this, it should set the mode back to periph- eral ecp forward, wait 500 ns and then drive nackreverse (perror) back to high, before proceeding as described for peripheral ecp forward mode above. 6. status interrupts in peripheral ecp reverse mode in- clude rising and falling edges on p1284active (nselectin) and nreverserequest (ninit). since there are no legal terminations during the time this mode is set, the controller sets illop for any falling edge on p1284active (nselectin) in this mode. 79 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 ctc, and miscellaneous registers the following section describes miscellaneous registers that control the z80185 configuration, including ram/ rom registers, interrupt and various status and timer registers. register name i/o addr/access wsg chip select register %d8 r/w pia1/ctc pin select register %de r/w interrupt edge control %df r/w pia 1 data direction register %e0 r/w pia 1 data register %e1 r/w pia 2 data direction register %e2 r/w pia 2 data register %e3 r/w ctc channel 0 control register %e4 r/w ctc channel 1 control register %e5 r/w ctc channel 2 control register %e6 r/w ctc channel 3 control register %e7 r/w register name i/o addr/access emscc control register %e8 r/w emscc data register %e9 r/w ramubr ram upper boundary reg %ea r/w ramlbr ram lower boundary reg %eb r/w rom address boundary reg. %ec r/w system configuration reg. %ed r/w pia 2 data alternate address %ee r/w wdt master register %f0 r/w wdt command register %f1 wo 80 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog system configuration register this register controls a number of device-level features on the z80185 and includes the following control bits: daisy-chain configuration rom emulator mode (reme) 0 = data bus in normal mode 1 = data bus in rom emulator mode 0 = escc clk is phi 1 = escc clk is phi/2 0 = /rts0, /cts0, cka0 1 = txs, rxs, cks disable /romcs 0 = /romcs is enabled 1 = /romcs is disabled daisy-chain configuration decode high i/o 0 = a15-8 not decoded for "non-180" registers. 1 = a15-8 must be 00 to access "non-180" regs. d7 d6 d5 d4 d3 d2 d1 d0 figure 82. system configuration register (i/o address %ed) 81 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 pia and miscellaneous registers (continued) system configuration register (continued) bit 7. decode high i/o. if this bit is 0, as it is after a reset, a15-8 are not decoded for the registers for which a7-6 are 11, that is, the registers for the emscc, ctcs, i/o ports, bidirectional centronics controller. if this bit is 1, a15-8 must all be zero to access these registers, as for the other registers in the z80185. when set to 0, this bit is compatible with the z80181 and z80182, and allows shorter, and more basic i/o instructions to be used to access these registers. alternately, when set to 1, this bit allows more extensive off- chip i/o. bit 6. daisy-chain configuration bit 2. this bit is described with bits 1-0 below. bit 5. disable /romcs. when this bit is 1, /romcs is forced to high, regardless of the status of the address decode logic. this bit resets to 0 so that /romcs is enabled. bit 4. when this bit is 0, the /rts0/txs, /cts0/rxs, and cka0/cks pins have the /rts0, /cts0 and cka0 func- tions, respectively. when this bit is 1, the pins have the txs, rxs, and cks functions, and the csio facility can be used. when this bit is 1, if asci0 is used, the cts auto- enable function must not be enabled. the multiplexing of cka0 is important only with respect to output the same external clock could be used for both asci0 and the csio. bit 3. when this bit is 0, the pclk clock of the emscc is the same as the processors phi clock. when this bit is 1, this clock is phi/2. set this bit if the phi clock is too fast for the emscc. bit 2. rom emulator mode enable. when this bit is 1, read data from on-chip sources is driven onto the d7-d0 pins, as shown in table 6. this bit resets to 0. bits 1-0. these bits, plus bit 6, determine the routing of the on-chip interrupt daisy-chain, and thus the relative inter- rupt priority of the on-chip interrupt sources on the daisy- chain as shown in table 5. table 5. interrupt daisy-chain routing b6 b1 b0 daisy chain configuration 0 0 0 iei pin -> emscc -> ctc -> bidirectional centronics controller -> ieo pin 0 0 1 iei pin -> emscc -> bidirectional centronics controller -> ctc -> ieo pin 0 1 x iei pin -> bidirectional centronics controller -> emscc -> ctc -> ieo pin 1 0 0 iei pin -> ctc -> emscc -> bidirectional centronics controller -> ieo pin 1 0 1 iei pin -> ctc -> bidirectional centronics controller -> emscc -> ieo pin 1 1 x iei pin -> bidirectional centronics controller -> ctc -> emscc -> ieo pin 82 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog table 6. data bus direction (z185 bus master) i/o write to on-chip peripherals i/o read from on-chip peripherals i/o write to off-chip peripherals write to memory read from on-chip rom refresh z80185 idle mode i/o and memory transactions z80185 data bus (rome=0) z80185 data bus (rome=1) out out z out out out out out z z z z i/o read from off-chip peripherals in in intack for on-chip peripheral intack for off-chip peripheral interrupt acknowledge transaction z80185 data bus (rome=0) z80185 data bus (rome=1) z out in in z out read from off-chip memory in in in in table 8. data bus direction (z185 is not bus master) i/o write to on-chip peripherals i/o read from on-chip peripherals i/o read from off-chip peripherals write to memory read from on-chip rom refresh ext. bus master is idle i/o and memory transactions z80185 data bus (rome=0) z80185 data bus (rome=1) in in out out z z z z z z z z i/o write to on-chip peripherals z z intack for on-chip peripheral intack for off-chip peripheral interrupt acknowledge transaction z80185 data bus (rome=0) z80185 data bus (rome=1) out out in in out out read from off-chip memory in in notes: "out" means that the z185 data bus direction is in output mode; "in" means input mode, and "z" means high impedance. rome stands for rom emulator mode and is the status of the d2 bit in the system configuration register. 83 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 pia and miscellaneous registers (continued) ram and rom registers three registers, rombr, ramlbr and ramubr, and two pins, /romcs and /ramcs, assist with decoding of rom and ram blocks of memory. 11111111 a19-a12 ramubr ramubr (i/o address %ea) 7 65 4 321 0 /romcs can be forced to a 1 (inactive state) by setting bit 5 in the system configuration register, to allow the user to overlay the ram area over the rom area. figure 83. ramubr (i/o address %ea) 11111111 a19-a12 ramlbr ramlbr (i/o address %eb) 7 65 4 321 0 figure 84. ramlbr (i/o address %eb) the names ramubr and ramlbr stand for ram upper boundary range and ram lower boundary range. these two registers specify the address range for the /ramcs signal. when accessed, memory addresses are less than, or equal, to the value in the ramubr, and greater than, or equal to, the value programmed in the ramlbr, /ramcs is asserted. rombr rom address boundary register this register specifies the address range for the /romcs signal. when an accessed memory address is less than, or equal to, the value programmed in this register, but greater than the size of on-chip rom (if on-chip rom is enabled), the /romcs signal is asserted. 11111111 a19-a12 rombr rombr (i/o address %ec) 7 65 4 321 0 figure 85. rombr (i/o address %ec) /ramcs and /romcs are active for accesses by an external master, as well as by the z80185 processor. if /romcs and /ramcs are programmed to overlap, /romcs is asserted and /ramcs is inactive for addresses in the overlapping region. chip select signals are active for the address range: /romcs: (rombr) >= a19-a12 >= size of on-chip rom (if enabled, else 0) /ramcs: (ramubr) >= a19-a12 >= (ramlbr) all three of the above registers are set to ffh at power- on reset. this means that if on-chip rom is enabled, /romcs is asserted for all addresses above the size of on- chip rom, if not, /romcs is asserted for all addresses. since /romcs takes priority over /ramcs, the latter will never be asserted until the value in the rombr and ramlbr registers are re-initialized to lower values. 84 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog wait state generation (wsg) the memory wait insertion field of the dcntl register applies to all accesses to memory, and allows insertion of 0-3 wait states. in the z80185, the wsg chip select register allows individual wait state control for the various types and areas of memory. 11111111 other memory wait insertion wsg chip select register (i/o address %d8) 7 65 4 321 0 on-chip rom wait insertion /romcs wait insertion /ramcs wait insertion figure 86. wsg chip select register (i/o address %d8) bits 7-6. this field controls how many wait states are inserted for accesses to external memory in which /ramcs is asserted: 00 = none, 01 = 1, 10 = 2, 11 = 4 wait states. bits 5-4. this field controls how many wait states are inserted for accesses to external memory in which /romcs is asserted, and is encoded like bits 7-6. bits 3-2. this field controls how many wait states are inserted for accesses to on-chip rom, and is encoded like bits 7-6. note: on-chip rom should be fast enough to support no-wait-state operation at the maximum specified clock rate, but this field is included as a hedge against difficulties in this area, as well as to provide timing compat- ibility in unusual circumstances. bits 1-0. this field controls how many wait states are inserted for accesses to external memory in which neither /ramcs nor /romcs is asserted, and is encoded the same as bits 7-6. all fields in this register reset to 11. the 4-wait-state feature is included to allow the use of commodity drams with a clock rate at, or near, the maximum. note that this facility, and the one in the dcntl register, both logically or into the wait signal, to allow this register full control of wait states. bits 7-6 of dcntl should be programmed to 00. 85 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 pia and miscellaneous registers (continued) interrupt edge register figure 87. interrupt edge register (i/o address %df) bits 7-6. these bits control the interrupt capture logic for the /int2 pin. when these bits are 0x, the /int2 pin is level sensitive and low active. when these bits are 10, negative edge detection is enabled. any falling edge will latch an active low on the internal /int2 to the processor. this interrupt must be cleared by writing a 1 to bit 3 of this register. programming these bits to 11 enables rising edge interrupts to be latched. the latch must be cleared in the same fashion as for a falling edge. 01010000 0 = /dcd0/cka0 is /dcd0 1 = /dcd0/cka0 is cka0 interrupt edge register (i/o address %df) 7 65 4 321 0 drive select for pins listed below 0 select normal drive 1 select low noise (33%) drive capabilities /int1 sense/unlatch 0 in: /int1 is low 1 in: /int1 is high out: unlatch edge detection /int2 sense/unlatch 0 in: /int2 is low 1 in: /int2 is high out: unlatch edge detection /int1 mode select 0x normal level detect 10 falling (neg) edge det. 11 rising (pos) edge det. /int2 mode select 0x normal level detect 10 falling (neg) edge det. 11 rising (pos) edge det. bits 5-4. these bits control the interrupt capture logic for the external /int1 pin. when these bits are 0x, the /int1 pin is level sensitive and low active. when these bits are 10, negative edge detection is enabled. any falling edge will latch an active low on the internal /int1 to the processor. this interrupt must be cleared by writing a 1 to bit 2 of this register. programming these bits to 11 enables rising edge interrupts to be latched. the latch must be cleared in the same fashion as for a falling edge. bit 3. software can read this register to sense the state of the /int2 pin. writing a 1 to this bit clears the edge detection logic for /int2. bit 2. software can read this register to sense the state of the /int1 pin. writing a 1 to this bit clears the edge detection logic for /int1. bit 1. this bit selects low noise or normal drive for the parallel ports, bidirectional centronics controller pins, chip select pins, and emscc pins as follows: pia 10-13 /rts nfault pia 14-16/zct0 0-2 /dtr ninit pia 27-20 txd nselectin /romcs /trxc nstrobe /ramcs busy perror /iocs nack select ieo nautofd a 1 in this bit selects the low noise option, which is a 33 percent reduction in drive capability. a 0 selects normal drive, and is the default after power-up. additionally, refer to cpu register (ccr) for a list of the pins that are programmable for low drive, via the ccr register. bit 0. if this bit is 1, the /dcd0/cka1 pin has the cka1 function. the pin is always connected to the dcd input of asci0, so if this pin is 1, and asci0 is used, it should not be programmed to use dcd as a receive auto-enable. 86 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog individual pin selection between pia1 and ctcs the assignment of the choice between pia1 and ctc i/os is controlled by the pia1/ctc pin select register (figure 79). bit 7. reserved, and should be programmed as 0. bits 6-4. when the pia1 data direction register has set the corresponding pins as outputs, for each of these bits that is 0, the pin is driven with the state of the corresponding bit of the pia 1 data register, while for each of these bits that is 1, the associated pin is driven with the indicated ctc output. these bits reset to 0. bits 3-1. these bits control whether the clk/trg inputs of ctcs 3-1 are taken from pia3-1, respectively, or from the zc/to outputs of ctc2-0, respectively. these bits do not have any affect on the operating mode of the ctcs. bit 0. this bit is reserved and should be programmed as 0. ctc0's clk/trg0 input is always connected to the pia10 pin. 00000000 pia1/ctc pin select register (i/o address %de) 7 65 4 321 0 reserved, program as 0. reserved, program as 0. pia11/clktrg1 1 = clk/trg1 = zc/to0 0 = clk/trg1 = pin pia12/clktrg2 0 = clk/trg2 = zc/to1 1 = clk/trg2 = pin pia13/clktrg3 0 = clk/trg3 = zc/to2 1 = clk/trg3 = pin pia14/zcto1 0 = pia14 1 = zc/to1 pia15/zcto2 0 = pia15 1 = zc/to2 pia16/zcto3 0 = pia16 1 = zc/to3 pia16/zcto3 0 = pia16 1 = zc/to3 figure 88. pia1/ctc pin select register (i/o address %de) 87 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 pia and miscellaneous registers (continued) ctc control registers channel control byte this byte is used to set the operating modes and param- eters. bit d0 must be a 1 to indicate that this is a control byte (figure 82). the channel control byte register has the following fields: bit d7. interrupt enable. this bit enables the interrupt logic so that an internal int is generated at zero count. interrupts are programmed in either mode, and may be enabled or disabled at any time. bit d6. mode bit. this bit, along with bit 3, is used to select either timer mode or counter mode (table 8). bit d5. prescaler factor. this bit selects the prescaler factor for use in the timer mode. either divide-by-16 or divide-by-256 is available. bit d4. clock/trigger edge selector. this bit selects the active edge of the clk/trg input pulses. bit d3. mode bit. this bit, along with bit 6, selects either timer mode or counter mode (table 8). bit d2. time constant. this bit indicates that the next byte programmed is time constant data for the downcounter. bit d1. software reset. writing a 1 to this bit indicates a software reset operation, which stops counting activities until another time constant word is written. table 8. ctc operation modes ccw6 ccw3 operation 0 0 (auto start) timer mode. the prescaler is clocked by phi, and the counter is clocked by the prescaler. counting is enabled when the timer constant is loaded. 0 1 timer with clk/trg trigger. the prescaler is clocked by phi, and the counter is clocked by the prescaler. timing starts when the transition specified by d4 is detected on the pia pin, or for ctc3-1, the zc/t0 output of ctc2-0, respectively. 1 0 classic counter mode. the counter is clocked by the pia pin, or for ctc3-1 the zc/to output of ctc-2 respectively. 1 1 long counter mode. the prescaler is clocked by the pia pin, or for ctc3-1 the zc/to output of ctc-2, respectively, and the counter is clocked by the prescaler. 88 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog d7 d6 d5 d4 d3 d2 d1 d0 control or vector 0 vector 1 control word reset 0 continued operation 1 software reset time constant 0 no time constant follows 1 time constant follows mode ccw6 ccw3 0 0 timer mode (auto start) 0 1 timer mode clk/trg pulse starts 1 0 classic counter mode 1 1 long counter mode interrupt 1 enables interrupt 0 disables interrupt prescaler value 1 value of 256 0 value of 16 clk/trg edge selection 0 selects falling edge 1 selects rising edge addr: e4h (ch 0) e5h (ch 1) e6h (ch 2) e7h (ch 3) figure 89. ctc channel control word 89 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 pia and miscellaneous registers (continued) ctc control registers (continued) time constant before a channel can start counting, it must receive a time constant. the time constant value may be anywhere be- tween 1 and 256, with 0 indicating a count of 256 (figure 90). d7 d6 d5 d4 d3 d2 d1 d0 tc0 tc1 tc2 tc3 tc4 tc5 tc6 tc7 figure 90. ctc time constant interrupt vector if one or more of the ctc channels have interrupt enabled, then the interrupt vector word should be programmed. only the five most significant bits of this word are used, bit d0 must be 0 . bits d2-d1 are automatically modified by the ctc channels after responding with an interrupt vector (figure 91). d7 d6 d5 d4 d3 d2 d1 d0 0 interrupt vector register 1 control register channel identifier (automatically inserted by ctc) 0 0 channel 0 0 1 channel 1 1 0 channel 2 1 1 channel 3 supplied by user figure 91. ctc interrupt vector watch-dog timer the z80185's watch-dog timer (wdt) facility is identical to zilog's z84c15 wdt with the following exceptions: 1. the halt mode field of the wdt master register is not used. power control is handled as on the z8s180. 2. rather than having a separate /wdtout output pin, the output of the wdt is logically low-active-ored with the /reset pin. a new register bit controls whether this affects only the processor, by means of an internal logic gate, or whether it also drives the /reset pin low in an open-drain manner, so that external logic can be reset by the wdt as well. the latter is the default state after power-up or reset. 90 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog watch-dog control registers two registers control wdt operations. these are wdt master register (wdtmr; i/o address f0h) and the wdt command register (wdtcr; i/o address f1h). wdt logic has a double key structure to prevent accidental disabling of the wdt. enabling the wdt. the wdt is enabled by reset, and setting the wdt enable bit (wdtmr7) to 1. disabling the wdt. the wdt is disabled by clearing wdt enable bit (wdtr7) to 0 followed by writing "b1h to the wdt command register (wdtcr; i/o address f1h). clearing the wdt. the wdt can be cleared by writing 4eh into the wdtcr. watch-dog timer master register (wdtmr;i/o ad- dress f0h). this register controls the activities of the watch-dog timer. bit d7. watch-dog timer enable (wdte). the wdt can be enabled by setting this bit to 1. to disable wdt, write 0 to this bit, followed by writing b1h to the wdt command register. upon power-on reset, this bit is set to 1 and the wdt is enabled. bit d6-d5. wdt periodic field (wdtp). this 2-bit field determines the desired time period. upon power-on reset, this field sets to "11". 00 - period is (tcc * 2 16 ) 01 - period is (tcc * 2 18 ) 10 - period is (tcc * 2 20 ) 11 - period is (tcc * 2 22 ) bit d4. if this bit is 1 and the wdt times out, the z80185 drives the /reset pin low to reset external logic. if this bit is 0, a wdt timer only resets the z80185 internally. bit d3-d0. reserved. these three bits are reserved and should always be programmed as 0011. reading these bits returns 0011. 11110011 should be 0011 7 65 4 321 0 drive /reset 0 = wdt output only resets 185 1 = output of wdt is driven onto /reset pin wdt periodic field 00 = period is (tcc x 2*16) 01 = period is (tcc x 2*18) 10 = period is (tcc x 2*20) 11 = period is (tcc x 2*22) watch-dog timer enable 0 = disable 1 = enable figure 92. watch-dog timer master register (i/o address %f0) watch-dog timer command register (wdtcr; i/o address f1h). this register is write only (figure 93). write b1h after clearing wdte to 0 - disable wdt write 4eh - clear wdt d7 d6 d5 d4 d3 d2 d1 d0 (b1h) - disable wdt (after clearing wdte) 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 (4eh) - clear wdt to zero wdtcr (write only) figure 93. watch-dog timer command register 91 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog z80185 pia and miscellaneous registers (continued) parallel ports the z80185 has two 8-bit bidirectional ports. each bit is individually programmable for input or output. each port includes two registers: the port direction control register and the port data register. the second port also includes an alternate address that is used with the bidirectional centronics feature. 11111111 pia 1 data direction register 0 = output 1 = input 7 65 4 321 0 00000000 pia 1 data register 7 65 4 321 0 00000000 pia 2 data register 7 65 4 321 0 00000000 pia 2 data register 7 65 4 321 0 00000000 pia 2 data register 7 65 4 321 0 figure 94. pia 1 data direction register (i/o address %e0) the data direction register determines which of the pia16- 10 pins are inputs and outputs. when a bit is set to 1, the corresponding bit in the pia 1 data register is an input. if the bit is 0, then the corresponding pin is an output. these bits must be set appropriately if these pins are used for ctc inputs and outputs. figure 95. pia 1 data register (i/o address %e1) when the processor writes to the pia 1 data register, the data is stored in the internal buffer. any bits that are output are then driven on to the pins. when the processor reads the pia 1 data register, the data on the external pins is returned. figure 96. pia 2 data direction register (i/o address %e2) the data direction register determines which of the pia27- 20 pins are inputs and outputs. when a bit is set to a 1, the corresponding pin is an input. if the bit is 0, then the corresponding bit is an output. these settings can be overridden by the bidirectional centronics controller. figure 97. pia 2 data register (i/o address %e3) when the processor writes to the pia 2 data register, the data is stored in the internal buffer. any bits that are output are then driven on to the pins. in certain modes of the bidirectional centronics controller, an intermediate regis- ter called the output holding register is activated, and the transfer of data from the ohr to the pins is under the control of the controller. when the processor reads the pia 2 data register, the data on the external pins is returned. in certain modes of the bidirectional centronics controller, reading from this address reads the data stored in the port register from pia27-20 under the control of the controller. figure 98. pia 2 data alternate address (rw) (i/o address %ee) reading and writing this register is exactly the same as reading and writing address e3 as described above, except that in certain modes of the bidirectional centronics controller, writing to this address sets a ninth bit in the opposite sense from writing address e3, and this drives one of the control outputs with the opposite polarity. 92 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog electrical characteristics the following classification table describes pins in terms of input and output classes. v dd = 5v 10%, unless otherwise noted. pin input/output classification class o output: full time / totem pole v ol 0.4v max at i ol = 2.0 ma v oh = v dd C1.2v min at i oh = 200 m a slew rate 0.33 v/ns min at c load = 50 pf c out = 15 pf max (output or i/o) class 3 output: as o except tri-state. class h output: as o except v oh = v dd -0.6v min at i oh = 200 m a class d output: open drain v ol 0.4v max at i ol = 12 ma c out = 15 pf max (output or i/o) class t output: tri-state as class "o" at v dd = 3.3v 10% v ol 0.4v max at i ol = 12 ma, v dd = 5v 10% v oh 2.4v min at i oh = 12 ma, v dd = 5v 10% output impedance 45 ohms max slew rate 0.05 - 0.40 v/ns (c load not stated by ieee) c out =15 pf max (output or i/o) class i input: v il 0.8v max at v dd = 5v 10% v il 0.6v max at v dd = 3.3v 10% v ih 2.0v min ii 10 m a max, vi = 0 to 5v (includes leakage if i/o) c in = 5 pf max (if input only, see output type if i/o) inputs of this type include weak latch circuits. class r input: v il 0.6v max v ih v dd -0.6 min at v dd = 5v 10% v ih v dd -0.3 min at v dd = 3.3v 10% ii 10 m a max, vi = 0 to 5v c in = 5 pf max class s input: v il 0.8v max at v dd = 5v 10% v il 0.6v max at v dd = 3.3v 10% v ih 2.0v min hysteresis 0.2v min ii 20 m a max, vi=0.8 to 2v (includes leakage if i/o) inputs of this type include weak latch circuits. 93 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog electrical characteristics (continued) the following table shows the characteristics of each pin in terms of the above classifications. a dash "C" in the input or output column indicates the pin does not have that function. pin input class output class /busreq i C /cts i C /cts0/rxs i C /dcd i C /dcd0/cka1 i 3 /dtr C o /halt C o /int0 i d /int1 i C /int2 i C /iocs C o /iorq i 3 /m1 i 3 /mreq i 3 /nmi r C /ramcs C o /rd i 3 /reset r d /rfsh C o /romcs C o /rts C o /rts0/txs C o /rtxc i 3 /trxc i 3 /wait i d /wr i 3 a0-a19 i 3 pin input class output class busy s t cka0/cks i 3 d0-d7 i 3 extal r C iei i C ieo C o nack s t nautofd s t nfault s t ninit s t nselectin s t nstrobe s t perror s t phi C h pia13-10/clktrg3-0 i 3 pia15-13/zcto2-0 i 3 pia27-20 s t rxa0 i C rxa1 i C rxd i C /st C o select s t tout//dreq i o txa0 C o txa1 C o txd C o xtal C o table 9. pin classification characteristics 94 preliminary z80185/z80195 s mart p eripheral c ontrollers ds971850301 zilog package information 100-pin qfp package diagram 95 preliminary z80185/z80195 s mart p eripheral c ontrolles ds971850301 zilog ordering information z80185 (rom version) 20 mhz 33 mhz z8018520fsc z8018533fsc z80195 (romless version) 20 mhz 33 mhz z8019520fsc Z8019533FSC for fast results, contact your local zilog sales office for assistance in ordering the part(s) desired. package: f = plastic quad flatpack temperature: s = 0 c to +70 c speeds: 20 = 20 mhz 33 = 33 mhz environmental: c = plastic standard example: z 80185 20 f s c is a z80185, 20 mhz, qfp, 0 c to +70 c, plastic standard flow environmental flow temperature package speed product number zilog prefix zilogs products are not authorized for use as critical compo- nents in life support devices or systems unless a specific written agreement pertaining to such intended use is executed between the customer and zilog prior to use. life support devices or systems are those which are intended for surgical implantation into the body, or which sustains life whose failure to perform, when properly used in accordance with instructions for use provided in the labeling, can be reasonably expected to result in significant injury to the user. zilog, inc. 210 east hacienda ave. campbell, ca 95008-6600 telephone (408) 370-8000 telex 910-338-7621 fax 408 370-8056 internet: http://www.zilog.com ? 1997 by zilog, inc. all rights reserved. no part of this document may be copied or reproduced in any form or by any means without the prior written consent of zilog, inc. the information in this document is subject to change without notice. devices sold by zilog, inc. are covered by warranty and patent indemnification provisions appearing in zilog, inc. terms and conditions of sale only. zilog, inc. makes no warranty, express, statutory, implied or by description, regarding the information set forth herein or regarding the freedom of the described devices from intellectual property infringement. zilog, inc. makes no warranty of mer- chantability or fitness for any purpose. zilog, inc. shall not be responsible for any errors that may appear in this document. zilog, inc. makes no commitment to update or keep current the information contained in this document. |
Price & Availability of Z8019533FSC |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |