friends welcome to this lesson on serial transmission modes data communication between a computer and a peripheral can be done in two ways the serial transmission and the parallel transmission the serial transmission uses a common data path for the different bits that has to be transmitted the bits are transmitted one after the other and that is why the name serial transmission what is the other method that is used if each bit is allocated a dedicated path then we get what is known as the parallel transmission mode if eight bits are to be transmitted then a transmission lines are required in parallel transmission mode the parallel transmission is used when the computer on the peripheral or close together the serial transmission is used for longer transmission distances say if the separation is more than five meters the reason is serial transmission requires fewer lines so if the same data path is used for transmitting the different bits then how is the receiver going to identify the beginning and end of a bit how is a receiver going to enter fie the beginning and end of a byte so for this bit and byte identification special timing signals are added with the data and transmitted along with the data such timing signals are known as the synchronizing signals two different methods are used to add these synchronizing signals accordingly the serial transmission is known as synchronous transmission and a synchronous transmission when large volume of data is to be transmitted transmission is used the entire data is treated as a block synchronizing signals are just added once before the block and transmitted at a fixed rate over the line this is known as synchronous transmission the term synchronous means the number of characters transmitted per second is uniform over the entire transmission period framing overhead for synchronous transmission is much smaller and therefore it is much efficient it is used for high speed data transfer however it requires complex circuitry at the receiver for clock and data recovery a synchronous transmission adds timing signals to each character of data a start bit is added at the beginning a stop bit is added at the end a low-level signal is used for start bit a high-level signal is used for stop bit this process of adding start and stop bits to a character is known as framing the falling edge of the start bit is the timing reference the one level of the stop bit and the zero level of the start bit ensures a high to low transition for every character a parity bit is also added to the data bits just before the stop bit thus every character contains a start bit data bits parity bit and a stop it the asynchronous transmission use a simple circuitry it is used for low-speed data transmission up to a

speed of 20 kilobits per second now let us study the terms and standards associated with serial transmission the number of bits transmitted per second is called bit rate the bit rate is also known as baud rate if the direction of data flow through a serial line never changes that is if it is a one-way transmission then it is called simplex transmission in duplex transmission data can flow in both directions however if the transmission goes one way at a time it is called half duplex if data flows both ways simultaneously then it is full duplex system the walkie talkie wireless communication system is an example of half duplex system a telephone conversation between two users is an example of full duplex system on the transmission line the signal could be transmitted by two ways as a current pulse or as a voltage pulse the current pulse method is known as current Lu for a logical one level current flows through the line and for a logical zero level no current flows there are two standards for the current loop 20 milliamps loop 60 milliamps loop the figures 20 milliamps and 60 milliamps specify the amount of current flow for one level a current loop reduces noise pickups and so is suitable for long-distance transmission when data is transmitted as voltage the standard used is rs-232 see a one level signal is transmitted as minus 12 volts a zero level signal is transmitted as plus 12 volts a device called line driver does this voltage level shifting at the transmitter end a line receiver does the reverse shifting at the receiver this level shifting is done to overcome losses and for better noise performance we have just learned the details about a serial communication systems one of the most common application of serial transmission would be communication between computers imagine two officers situated at two corners of a city if the computers in these officers want to communicate how are we going to connect them are we going to lay a dedicated rs-232c cable between them a ready-made and quick solution would be to use the telephone connection between these two offices the advantage is the telephone cables are already laid out however there is a problem the telephone cables support only analog signals they will not readily support the digital signal therefore the digital data has to be translated into audio frequency analog signals a device called modem modulator and demodulator does this signal translation ascending modem converts digital data into audio frequency analog format a receiving modem converts audio signal back to digital data modems often use a technique called frequency shift keying for this conversion this technique converts a one level signal into an audio signal at 1200 Hertz and zero level into audio signal at 2200

Hertz the calling computer simply dials the receiving one and a link is thus established whenever there is need to send data an exclusive rs-232c line or a telephone line with modems carry the signal between places modem communicates with the computer using control signals the microprocessor 885 has facilities to handle serial transmission now we are going to learn about the 80-85 facility for serial transmission the 80-85 has a serial output data pin s OD and a serial input data pin s ID they can be used for software controlled serial data transfer the sim and REM instructions are used for this purpose a zero or one can be transferred out through a so deep in by executing the same instruction the first step is to load the data bit into the accumulator where d7 is the serial data d6 enables serial output operation the single big data to be transmitted is placed at the D seventh bit a one at D six bit enables the sim instruction to send a one through the Esso deep in the data byte pattern would be 1 1 0 0 0 0 0 0 that is C o H the program segment sends out the 1 bit through the Esso deepen the program segment sends out a zero bit through the Esso deep in the si deep in can be used to receive serial data the rim instruction is used for this purpose when the rim instruction is executed once the single bit data available at the si deep in is brought into the accumulator as the D seventh bit all other bits are main zero thus the si D and s OD pins may be used to transmit data in and out of the microcomputer the framing of the data for synchronous or asynchronous format can be done using software a better approach is to use a dedicated device to handle the serial communication the Intel a 2 Phi 1 is a serial communication controller which is to be used with the 885 CPU the a 2 Phi 1 is fully programmable it supports simultaneous a transmission and reception it can be programmed for a synchronous operation the a 2 Phi 1 has provisions for interfacing with modem therefore a 2 Phi 1 is known as universal synchronous a synchronous receiver transmit module let us move over to the graphic to learn the details about a 2 Phi 1 the four functional blocks of the device are the receiver section transmitter section modem control section and microprocessor interface section the input register of the receiver section gets the serial data input the data is clocked into the input register using the receiver clock with every falling edge of the receiver clock a new bit is entered into the input register it receives the data bits along with framing bits they are transferred to the receiver buffer register the buffer stores the data in parallel format the RX ready is raised to indicate the buffer has a character ready for the CPU along with these steps for receiving

data the eight-to-five one is capable of simultaneously transmitting data the transmitter buffer register accepts parallel data from the processor the data is transferred to the output register the TX Reddy is raised after each data transfer from buffer register into output register the DX Reddy may be used to interrupt the CPU for a new character framing bits are added the assembled character is sent out through TX d bit by bit every falling edge of the transmitter clock sends out one bit out of the output register after all the bits are transferred the transmitter mt TX e is raised to indicate it is ready to receive one more character the modem takes care of interfacing with the telephone line therefore it is called the data communication equipment the microcomputer is the data source therefore it is known as the data terminal equipment the eight-to-five one is a part of the microcomputer I see eight two five one has all the control signals necessary to interface a modem with a computer the eight data lines are connected to the data bus of the CPU the internal registers of the device can be memory mapped or i/o mapped the read bar and write bar lines enable the CPU to read and write into these registers in this example the device is io mapped therefore the read bar and write bar are connected to the i/o are and iow signals of the bus the CD bar line enables the control or data register the cs bar is connected to the external address decoder the device a 2 Phi 1 is a programmable device it has the two 8-bit registers to store the more word and the command word these two registers reside at the same address they are accessed through the write operation the mode word sets the different parameters for serial transmission the contents of the command word register are used to enable and disable the transmitter and receiver sections friends now let us see a demonstration of serial communication between a personal computer and a microprocessor trainer kit the serial port of this personal computer is connected with the serial port of this trainer kit the trainer kit as an eight to five one to implement serial communication the trainer kit is set for serial transmission through this dip switch the message serial appears on the display any program to be run on a microprocessor trainer cake can be conveniently entered and edited on the personal computer any text editor can be used for this purpose the advantage is the program can be in demonics and it can be assembled later into a machine code the file is assembled using cross assembler to produce the object code the object code file is converted into hex code file using the linker the hex code file has to be transferred to the kit for this the serial communication software xt8 5 2 is used

for running a program we need to give the starting address on the RAM now TD Ti is displayed on the kit thus the serial communication is established the device has a control register which can store two bytes the mode word and the command word the mode word sets up the basic parameters needed for transmission such as synchronous or asynchronous operation baud rate number of stop bits and type of parity d7 and d6 represent the number of stop bits when d7 is 0 and D 6 is 0 it is invalid zero 1 indicates 1 stop bit 1 zero indicates one and a half stop bits 1 1 indicates two stop bits d4 enables the parity d5 determines the type of parity when d5 is 0 and d 4 is zero then no parity 0 1 represents odd parity 1 1 represents even parity d3 and d2 represent the character length when d3 a 0 and D 2 is 0 then it means five bits character length 0 1 means 6 bits 1 0 means 7 bits 1 1 means 8 bits d1 and d0 represent the baud rate factor the relation between the baud rate and the transmitter receiver clock when a to phi1 is used in synchronous mode d1 is made 0 and d0 is made 0 other bits option determines the baud rate factor for asynchronous mode 0 1 indicates that the clock is same as the baud rate 1 0 indicates that the clock is 16 times the baud rate 1 1 indicates that the clock is 64 times the baud rate let us see an example to set the mode word for a synchronous mode 1200 baud keeping the baud rate factor 64 the clock frequency is equal to seventy six point eight kilo Hertz 8-bit character and two bits stop it odd parity the mode word becomes 1 1 0 1 1 1 1 1 that is d F H assume the data register at the address 4 0 H and the control register at 4 1 H this program segment will load the mode word into the control word register the basic parameters have been set using the mode word the actual operation is controlled by the command word functions such as enabling the transmission and reception error resetting and modem control are provided by the command word the device has a single control register after reset the first write operation in this control register is treated as mode word and the subsequent write operations will be treated as command word that is the command word can be changed at any time during the operation however to change the mode word resetting of the device is needed resetting can be done using the reset pin or through the command word itself the d7 bit is used in synchronous mode

it enables the receiver to look for the synchronizing data the d6 bit is used as the internal reset a high level resets the device so that a new mode word can be entered the d5 bit is used for modem control the d4 bit resets the error flags it resets the parity overrun and framing error flags the d3 bit makes the transmitter send continuous break characters the d2 bit enables the receiver the d1 bit controls the data terminal ready pin the d0 bit enables the transmitter in order to set the device for transmission the command word would be 0 0 0 1 0 0 0 1 that is 1 1 H the program segment will load the command word into the control register when the more word and command word or return the device starts sending and receiving data in order to know the status of the transmission and reception process a register called the status register is to be read now let us understand the format and meaning of the status word stored by the status register the d7 bit indicates the status of the modem the d6 bit indicates the detection of synchronizing data it is used in synchronous mode operation the d5 indicates that framing error has occurred that is a valid stop bit has not been detected the d4 indicates over an error that is a new character has arrived but still the old one was not read in the d3 indicates parity error d2 assumes the level of the transmitter empty pin d1 assumes level of receiver ready pin d0 takes level of transmitter-ready pin the status register is used to check a current activity of the IC the address of the register is same as the mode set and command register however it is accessed by a read operation suppose the CPU wants to send an 8-bit data to 8 to 5 1 for serial transmission first the CPU checks whether the 8 to 5 1 is ready it does the checking by reading the d0 bit of the status word the program checks the status word continuously until it finds the zero hi then it sends the data to the data register of eight to five one it is to be noted that the address of the status word register is for one H and the address of the data register is for zero H now we will review what we have learnt in this lesson the serial transmission is the preferred method for fairly long distance transmission high speed transmission systems use synchronous mode a synchronous mode is essentially a low speed mode the rs-232 C is a widely used serial transmission standard the modems enable telephone lines to be used for interconnection the a 2 Phi 1 is a powerful serial communication interface device it can transmit and simultaneously receive data up to nine point six kilo board it can

implement synchronous and asynchronous format it also implements modem control signals it has built-in error detection facility thus using serial communication a microcomputer can exchange data with another computer or with a remote terminal it can be implemented with a dedicated rs-232c line or using existing telephone lines so until we meet again goodbye you