ky7 SGS-THOMSON 28530 SERIAL COMMUNICATIONS CONTROLLER Thank you for your interest in the SCC, one of the most versatile and most popular Serial Data Com- munications |Cs. This document is intended to pro- vide answers to all technical questions about the 28530 Serial Communications Controller. Please ready this Preface where we try to anticipate your questions. a Ifyou are new to serial data communications, you will need additional tutorial information. Of the many introductory texts on this subject, Techni- cal Aspects of Data Communications by John E. McNamara, published by Digital Press (DEC) 1982, is one of the best. a If you have designed with simpier UARTs and USARTs, and HDLC/SDLC devices, the SCC of- fers you far greater flexibility, but also requires an in-depth study and understanding of the impact and the use of its many powerful features. This manual contains important information. PLOC44 If you are familiar with the Z80-SIO, you will feel right at home with the SCC, for it is really a func- tionally enhanced superset of the Z80-SIO. (Ordering Information at the end of the datasheet) PDIP-40 CDIP-40 Most users read only chapters that are of interest to them. If you are designing the microcomputer hard- Figure 1 : Logic Functions. ware structure using the SCC as a peripheral, you will want to read the Initialisation Worksheet and In- terrupt Routine Sections. ; . ++ D, TDA L_ | SERIAL If you are programming a system using the SCC, +41 0, RxDA } DATA you will be more interested, on the Initialization >| 05 TRKOA |@ | CHANNEL Worksheet Section. pata sus, +>) 4 ATXGA =} CLOCKS +1 SYNCA |e CHA Points To Watch Out For : +o wreon | | conTmoLs 1. Follow the worksheet for initialization (page ). 7% DTAREGA |e | OR Unexplainable operations may occur if this pro- 7% ATSA [ / OTHER cedure is not followed. rns {= FO 2. Watch out for Write Recovery time violation (In- AND RESET 7 a Foe | \ seruat terfacing Section). Both the CPU clock rate and contron { 9! cE os a7} DATA the SCC clock ate will affect the Write Recove- + 0 Trxce je | CHANNEL ry time. aw RIB =} cLocKs 3. Ensure Mode bits are not changed when writing + INTACK SYNCB fa cHB Commands. (Register Overview page 75). Each mneneuen | a et WREQR | CONTROLS Mode bit affects only one function and a Com- + ro BTRREGB) | FOR MODEM, mand bit entry requires a rewrite of the entire re- RTS8 |e | OER gister ; therefore, care must be taken to insure 20530 TSB + the integrity of the Mode bits whenever a new p08 le command Is issued. 4. Data must be valid prior to falling edge of WR or f f f DS. +5V GND PCLK 5. If not used, INTACK should be tied high. Januar 1989 1/93 44928530 CAPABILITIES a Two independent full-duplex channels. a Synchronous/Isosynchronous data rates : - Upto 1/4 of the PCLK (i.e., 1 Mbit/sec. maxi- mum data rate with 4 MHz PCLK. Using ex- ternal phase-lock loop. - Up to 375 Kbit/sec. with a 6 MHz clock rate. Up to 250 Kbit/sec. with a 4 MHz clock rate (FM encoding using digital phase-locked loop). - Up to 187.5 Kbit/sec. with a 6 MHz clock rate Up to 125 Kbit/sec. with a 4 MHz clock rate (NRZI encoding using digital phase-locked loop). a Asynchronous capabilities : - 5,6, 7, or 8 bits per character - 1, 1-1/2, or 2 stop bits - Odd or even parity - Times 1, 16, 32, or 64 clack modes - Break generation and detection - Parity, overrun and framing error detection. a Byte-oriented synchronous capabilities : - Internal or external character synchronization - 1 or 2sync characters (6 or 8 bits/character) in separate registers - Automatic Cyclic redundancy check (CRC) generation/detection. = SDLC/HDLC capabilities - ~ Abort sequence generation and checking - Automatic zero insertion and deletion - Automatic flag insertion between messages - Address field recognition - [field residue handling - CRC generation/detection - SDLC loop mode with EOP recognition/loop entry and exit. = Receiver data registers quadruply buffered. Transmitter data registered double buffered. a NRZ, NR2ZI, or FM encoding/decoding. a Baud-rate generator in each channel. a Digital phase-locked loop for clock recovery. a Crystal oscillator. 2/93 57 S&S-THOMSON GENERAL DESCRIPTION The SCC Serial Communications Controller is a dual-channel, multiprotocol data communications peripheral designed for use with 8-bit and 16-bit microprocessors. The SCC functions as a serial-to- parallel, parallel-to-serial converter/controller. The SCC can be software-configured to satisfy a wide variety of serial communications applications. The device contains a variety of new, sophisticated in- ternal functions including on-chip baud rate gene- rators, digital phase-lock loops, and crystal oscilla- tors, which dramatically reduce the need for exter- nal logic. The SCC handles asynchronous formats, Synchro- nous byte-oriented protocols such as IBM Bisync, and Synchronous bit-oriented protocols such as HDLC and IBM SDLC. This versatile device sup- ports virtually any serial data transfer application (te- lecommunications, cassette, diskette, tape drivers, etc.). The device can generate and check CRC codes in any Synchronous mode and can be programmed to check data integrity in various modes. The SCC al- so has facilities for modem controls in both chan- nels. in applications where these controls are not needed, the modem controls can be used for gene- ral-purpose V/O. With access to 14 Write registers and 7 Read regis- ters per channel, the user can configure the SCC so that it can handle all asynchronous formats regar- dless of data size, number of stop bits, or parity re- quirements. The SCC accommodates all synchro- nous formats including character, byte, and bit- oriented protocols. Within each operating mode, the SCC also allows for protocol variations by checking odd or even pa- rity bits, character insertion or deletion, CRC gene- ration and checking/oreak and abort generation and detection, and many other protocol-dependent fea- tures. The SCC 28530 is designed for non-multiplexed buses and is easily interfaced to CPUs such as the 8080, Z80, 6800, 68000 and *Multibus. MICROELECTRONICS 450GENERAL DESCRIPTION (cont'd) Figure 2 and Figure 5 show block diagrams of the SCC. Received data enters the receive data pins and follows one of severai data paths, depending on the state of the control logic. The contents of the registers and the state of the external control pins establish the internal control logic. Transmitted da- ta follows a similar pattern of control, register, and external pin definition. PIN DESCRIPTIONS The SCC pins are divided into seven functional groups : Address/Data, Bus Timing and Reset, De- vice Control, Interrupt, Serial Data (both channels), Peripheral Control (both channels), and Clocks (both channels). Figures 3 and 4 show the Pin Confi- Figure 2 : SCC Block Diagram. 28530 guration in both the proposed packages, Dual in Line and Chip Carrier. The Address/Data group consists of the bidirectio- nal lines used to transfer data between the CPU and the SCC. The direction of these lines depends on whether the SCC is selected and whether the ope- ration is a Read or a Write. The Timing and Control groups designate the type of transaction to occur and when this transaction will occur. The interrupt group provides inputs and out- puts to conform to the bus specifications for han- dling and prioritizing interrupts. The remaining groups are divided into Channel A and Channel B groups for serial data (transmit or receive), periphe- BAUD RATE GENERATOR a a] ! SERIAL DATA CHANNEL A INTERNAL CONTROL Locic CHANNEL A REGISTERS < tr | CHANNEL cLOcKs pe SYNC * WAITIREQUEST DISCRETE CONTROL e | MODEM, DMA, Of aE STATUS Pe? OTHER CONTROLS DOR A | Dara <8 aus vo INTERNAL BUS CONTROL cy crscrere CONTROL < | movem, oma, on a STATUS p / OTHER CONTROLS 8 i INTERRUPT CONTROL Locic iNTEARUPT CONTROL LINES tt +5 GNOPCLK CHANNEL B REGISTERS -~ | . j SERIAL DATA CHANNEL B Vo NY pare | CHANNEL cocks e SvNC P WAITIREQUEST BAUD RATE GENERATOR 5 3/93 yf Sieonacmoncs 451Z8530 PIN DESCRIPTION (cont'd) ral control (such as DMA or modem), and the input and output lines for the receive and transmit clocks. Here below are described the pin functions of the 28530 Serial Communications Controller. A/B. Channel A/ChannelB Select (input, Channel A active HIGH). This signal selects the channel in which the Read or Write operation occurs. CE. Chip Enable (input, active LOW). This signal se- lects the SCC for operation. It must remain active throughout the bus transaction. DO-D7. Data Lines (bidirectional, 3-state). These I/O lines carry sata or control information to and from the SCC. D/C. Data/Control (input, Data active HIGH). This signal defines the type of information transfer per- formed by the SCC : data or control. RD. Read (input, Active LOW). This signal indicates a Read operation and when the SCC is selected, enables the SCC bus drivers. During the interrupt acknowledge cycle, this signal gates the interrupt vector onto the bus if the SCC is the highest priori- ty device requesting an interrupt. WR. Write (input, active LOW). When the SCC is selected, this signal indicates a Write operation. The coincidence of RD and WR is interpreted as a Re- set. Figure 3 : DIP Pin Connections. CTSA, CTSB. Clear to Send (inputs, active LOW). If these pins are programmed as auto enables, a LOW on these inputs enables the respective trans- mitters. If not programmed as auto enables, they may be used as general-purpose inputs. Both inputs are Schmitttrigger buffered to accommodate slow rise-time inputs. The SCC detects transitions on these inputs and can interrupt the CPU on either jo- gic level transitions. DCDA, DCDB. Data Carrier Detect (inputs, active LOW). These pins function as receiver enables if they are programmed as auto enable bits ; other- wise they may be used as general-purpose input pins. Both pins are Schmitt-trigger buffered to acco- modate slow rise-time signals. The SCC detects transitions on these pins and can interrupt the CPU on either logic level transitions. DTR/ REQA, DTR/ REQB. Data Carrier Detect (in- puts, active LOW). These pins function as receiver enables if they are programmed into the DTR bit. They can also be used as general-purpose outputs (transmit) or as request lines for the DMA controller. The SCC allows full duplex DMA transfers. IEI. Interrupt Enable In (input, active HIGH). IEI is used with IEO to form an interrupt daisy chain when there is more than one interrupt-driven device. A HIGH on IEI indicates that no other higher priority Figure 4 : Chip Carrier Pin Connection. oC! 0 [1] oy bs [] 2 a9 [] 0, o; (J 3 af] po, [J] 37 [J 9% Ego aeoroa & & int (J 5 36 [J aD @5 632 8 4443 a2 res ico C] 5 3s [) wr ie (J 7 4 a intack [] 8 33 [J cE vec [] 9 32] pc WIREOA 28530 WIREQA Qj. sce xO nD synca (J 11 30 [] wines RTxCA (] 12 29 [DJ svnce axpa (J 13 28 [] atxce Taxca () 4 27] rxpe txoa [I] 15 26 [} Trace eo 6 28 A 18 19 20 21 22:23:26 25 26 27 28 RTSA LJ 17 24} DTR/REQB 2 crsa (] 8 23 [ atse eee cf CES ocoa [] 19 22) ctse % peek (| 20 21 [[] ocos 488 (7 SGS-THOMSON yf MITROELECTRONICS 452PIN DESCRIPTION (cont'd) device has an Interrupt Under Service (US) oris re- questing an interrupt. IEO. Interrupt Enable Out (output, active HIGH). IEO is HIGH only if IEl is HIGH and the CPU is not ser- vicing an SCC or SCC interrupt, or the controller is not requesting an interrupt (interrupt acknowledge cycle only). EO is connected to the next lower prio- rity devices IEI input and thus inhibits interrupts from lower priority devices. INTACK. Interrupt Acknowledge (input, active LOW). This signal indicates an active interrupt ac- knowledge cycle. During this cycle, the interrupt dai- sy chain settles. When RD or DS becomes active, the SCC places an interrupt vector on the data bus (if Elis HIGH). INTACK is latched by the rising edge of AS or PCLK. INT. Interrupt Request (output, open-drain, active LOW). This signal is activated when the SCC is re- questing an interrupt. PCLK. Clock (input). This is the master clock used to synchronize internal signals. PCLK is not requi- red to have any phase relationship with the master system clock. PCLK is a TTL level signal. RTSA, RTSB. Request to Send (outputs, active LOW). When the Request to Send (RTS) bit in Write Register 5 (Figure 48) is set, the RTS signal goes LOW. When the RTS bit is reset in the Asynchro- nous 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 pins strictly follow the state of the RTS bit. Both pins can be used as general-purpose out- puts. RTxCA, RTxCB. Receive/ Transmit Clocks (inputs, active LOW). The functions of these pins are under Program control. In each channel, RTxC may sup- ply the receive clock, the transmit clock, the clock for the baud rate generator, or the clock for the di- gital phase-locked loop (refer to Section 4 for bit configurations). This pins can also be programmed for use the respective SYNC pins as a crystal os- cillator. The receive clock may be 1, 16, 32, or 64 times the data rate in asynchronous modes. RxDA, RxDB. Receive Data (inputs, active HIGH). These input signals receive serial data at standard TTL levels. 28530 SYNCA, SYNCB. Synchronization (inputs/outputs, active LOW). These pins can act as either inputs, outputs, or as part of the crystal oscillator circuit. In the Asynchronous Receive mode (crystal oscillator option not selected), these pins are inputs similar to CTS and DCD. In this mode, transitions on these lines affect the state of the Sync/ Hunt status bits in Read Register 0 (Figure 59), but have no other func- tion. In External Synchronization mode with the crystal oscillator not selected, these lines also act as inputs. in this mode, SYNC must be driven LOW two re- ceive clock cycles after the last bit in the sync cha- racter is received. Character assembly begins on the rising edge of the receive clock immediately pre- ceding the activation of SYNC. In the Internal Synchronization mode, (Monosync and Bisync) with the crystal oscillator not selected, these pins act as outputs and are active only during the part of the receive clock cycle in which sync cha- racters are recognized. The sync condition is not lat- ched, so these outputs are active each time a sync character is recognized (regardless of character boundaries). In SDLC mode, these pins act as out- puts and are valid on receipt of a flag. TRxCA, TRxCB. Transmit/ Receive Clocks (inputs or outputs, active LOW). The functions of these pins are under program control. TRxC may supply the receive clock or the transmit clock in the Input made 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. (Refer to Sec- tion 4 for bit configuration). TxDA, TxDB. Transmit Data (outputs, active HIGH). This output signal transmits serial data at standard TTL levels. W/ REQA, W/ REQB. Wait/ Request (outputs, open drain when programmed for Wait function, driven HIGH or LOW when programmed for a Request function). These dual-purpose outputs can be pro- grammed as Request (receive) lines for a DMA con- troller or as Wait lines to synchronize the CPU to the SCC data rate. The reset state is Wait. The SCC al- lows full duplex DMA transfer. L577 SGS-THOMSON 5/98 MICROELECTRONICS 453Z8530 OVERVIEW The SCC internal structure provides all the interrupt and control logic necessary to interface with non- multiplexed bus. Interface logic is also provided to monitor modem or peripheral control inputs and out- puts. All of the control signals are general purpose and can be applied to various peripheral devices as well as used for modem control. The center for data activity revolves around the in- ternal read and write registers. The programming of these registers provides the SCC with functional personality ; i.e., register values can be assigned before or during program sequencing to determine how the SCC will establish a given communication protocol. Register Functions All modes of communication are established by the bit values of the write registers. As data is received or transmitted, read register values may change. These changed values can promote software action or internal hardware action for further register changes. The register set for each channel includes 14 write registers and seven read registers. Ten write regis- ters are used for control, two for sync character ge- neration, and two for baud rate generation. In addi- tion there are two write registers which are shared by both channels ; one is the interrupt vector regis- ter and one is the master interrupt control and reset register. Four read registers indicate status informa- tion, two are for baud rate generation, and one for the receive buffer. In addition there are two read re- gisters which are shared by both channels ; one for the interrupt pending bits and one for interrupt vec- tor. Table 1 lists the assigned functions for each read and write register. The SCC contains only one WR2 {interrupt vector) and one WR9 (master interrupt control). Both registers are accessed and shared by Table 1 : Register Set. Read Register Functions RRO Transmitt/ Receive buffer status, and Ex- ternal status RR1 Special Receive Condition status, residue codes, error conditions RR2 Moditied (Channel B only) interrupt vec- tor and Unmodified interrupt vector (Channel A only) RR3 Interrupt Pending bits (Channel A only) RR8& Receive buffer RR1i0 ~ Miscellaneous XMTR, RCVR status para- meters RR12 Lower byte of baud rate generator time constant RR13 ~Upper byte of baud rate generator time constant RR15 ~~ External/ Status interrupt control informa- tion Write Register Functions WRO Command Register, CRC initialization re- sets for various modes WRI1 Interrupt conditions, Wait / DMA request control WRe Interrupt vector (access through either channel) WR3 Receive / Control parameters, number of bits per character, RxCRC enable WR4 Transmit / Receive miscellaneous para- meters and codes, clock rate, number of sync characters, stop bits, parity WR5 Transmit parameters and control, number of Tx bits per character, TxCRC enable WR6 Sync character (1 st byte) or SDLC flag WR8 Transmitt buffer WR9 Master interrupt control and reset (acces- sed through either channel), reset bits. control interrupt daisy chain either channel. Chapter 7 provides a detailed bit le- R10 Miscellaneous. transmitter/receiver con gend and description of each register. CRC re sat ; 9: WR11. Clock mode control, source of Rx and Tx clocks WRi2 Lower byte of baud rate generator time constant WR13 Upper byte of baud rate generator time constant WR14 = ~Miscellaneous control bits : baud rate generator, Phase-Locked Loop control auto echo, local loopback WR14__ External/ Status interrupt control informa: tion-control external conditions causing interrupts 6/93 L597 Sigactomanes 454OVERVIEW (cont'd) Data Paths Figure 6 illustrates the data paths involved in the six major areas of the SCC : a Transmitter a Receiver a Baud rate generator a DPLL a Clocking options a Data encoding All communication modes are established by pro- gramming the write registers. As data is received or transmitted, read register values may change, alte- ring the direction of the data path. These changed values can promote software action or internal hard- ware action for further register changes. Transmitter. The transmitter has an 8-bit Transmit Data register (WR8) loaded from the internal data bus and a Transmit Shift register loaded from either WR6, WR7, or the Transmit Data register. In byte- oriented modes, WR6 and WR7 can be program- med with sync characters. In Monosync mode, an 8-bit or 6-bit sync character is used (WR6), whereas a 16-bit syne character is used (WR6 and WR7) in Bisync mode. In bit-oriented synchronous modes, the flag contained in WR7 is loaded into the Trans- mit Shift register at the beginning and end of a mes- sage. If asynchronous data is processed, WR6 and WR7 are not used and the Transmit Shift register is for- matted with start and stop bits shifted out to the transmit multiplexer at the selected clock rate. Syn- chronous data (except SDLC/HDLC) is shifted to the CRC generator as well as to the transmit multiplexer. SDLC/HDLC data is shifted to the CRC Generator and out through the zero insertion logic (which is di- sabled while the flags are being sent). A "0" is inser- ted in all address, control, information, and frame check fields following five contiguous "1s" in the da- tastream. The result of the CRC generator for SDLC data is also routed through the zero insertion logic and then to the transmit multiplexer. Receiver. The receiver has a three deep 8-bit Data FIFO (paired with an 8-bit Error FIFO), and an 8-bit shift register. This arrangement creates a 3-byte de- lay time, which allows the CPU time to service an in- terrupt at the beginning of a block of high-speed da- ta. With each Receive Data FIFO, the error FIFO stores parity and framing errors and other types of status information. The error FIFO is readable in Read Register 1. Incoming data is routed through one of several paths depending on the mode and character length. In 28530 Asynchronous mode, serial data enters the 3-bit de- lay (Figure 5) if the character length of seven or eight bits is selected. If a character length of five or six bits is selected, data enters the receive shift register di- rectly. In synchronous modes, the data path is determined by the phase of the receive process currently in ope- ration. A synchronous receive operation begins with a hunt phase in which a bit pattern that matches the programmed sync characters (6-bit, 8-bit, or 16-bit is searched). The incoming data then passes through the Sync re- gister and is compared to a sync character stored in WRE6 or WR7 (depending on which mode it is in). The monosync mode matches the sync character programmed in WR7 and the character assembled in the Receive Sync register to establish synchroni- zation. Synchronization is achieved differently in the Bisync mode. Incoming data is shifted to the Receive Shift register while the next eight bits of the message are assembled in the Receive Sync register. If these two characters match the programmed characters in WR6 and WR7, synchronization is established. In- coming data can then bypass the Receive Sync re- gister and enter the 3-bit delay directly. The SDLC mode of operation uses the Receive Sync register to monitor the receive data stream and to perform zero deletion when necessary ; i.e., when five continuous "1s" are received, the sixth bit is ins- pected and deleted from the data stream if it is "0". The seventh bit is inspected only if the sixth bit equais one. If the seventh bit is "0", a flag sequence has been received and the receiver is synchronized to that flag. If the seventh bit is a'"1", an abort or an EOP (End Off Poll) is recognized, depending on the selection of either the normal SDLC mode or SDLC Loop mode. The same path is taken by incoming data for both SDLC modes. The reformatted data enters the 3-bit delay and is transferred to the Receive Shift regis- ter. The SDLC receive operation begins in the hunt phase by attempting to match the assembled cha- racter in the Receive Shift Register with the flag pat- tern in WR7. Then the flag character is recognized, subsequent data is routed through the same path, regardless of character length. Either the CRC - 16 or CRC - SDLC cyclic redun- dancy check (CRC) polynomial can be used for both Monosync and Bisync modes, but only the CRC - SDLC polynomial is used for SDLC operation. The data path taken for each mode is also different. yz S&S-THOMSON 788 MICROELECTROMICS 455OVERVIEW (cont'd) Figure 5 : Data Paths. 28530 tuoi THoso ONAS W9013 WOLVUANED HE