Total slides: 73
Universal Asynchronous Receiver Transmitter (UART)
Introduction to Serial Communication
Types of Transmission
Simplex Communication
Duplex Communication
Half Duplex Communication
Full Duplex Communication
Methods of Serial data Transmission
Synchronous serial data transfer
Asynchronous serial data transfer
Differences Synchronous Asynchronous
Data Transfer Rate
Calculation of Baud Rate
SCON Register
SBUF Register
Writing to the Serial port
Reading the Serial port
PCON Register
Programming of transmission byte serially
Programming of reception of byte serially
Examples
This presentation discusses the Serial Communication features in 8051, the support for UART. It also discusses serial vs parallel communication, simplex, duplex and full-duplex modes, MAX232, RS232 standards
The 8051 microcontroller has 128 bytes of internal RAM and 4Kbytes of internal ROM memory. It uses the same addresses for code and data but accesses the correct memory based on whether an operation is for code or data. The 128 bytes of internal RAM are organized into 4 banks of 32 bytes each. External memory can be added if more memory is needed for program code or variable data storage. The document also provides information on interfacing external program and data memory with the 8051 microcontroller.
Presents features of ARM Processors, ARM architecture variants and Processor families. Further presents, ARM v4T architecture, ARM7-TDMI processor: Register organization, pipelining, modes, exception handling, bus architecture, debug architecture and interface signals.
The document discusses serial port programming for the 8051 microcontroller. It describes how serial communication works using one bit at a time instead of parallel communication which transfers all bits at once. It explains the registers and pins used for serial communication on the 8051 including the serial data buffer (SBUF) register, serial control (SCON) register, and MAX232 voltage converter. It provides details on programming the 8051 for serial data transmission and reception, including using the TI and RI flags to indicate when data has been sent or received.
A microcontroller is a single-chip microprocessor system consisting of a CPU, memory, and input/output ports. It can be considered a complete computer on a single chip. The 8051 was an early microcontroller developed by Intel for use in embedded systems. It had 4KB of program memory, 128 bytes of data memory, timers, counters, and I/O ports. The 8051 has separate memory spaces for program and data memory and its CPU, registers, timers and I/O ports allow it to monitor and control external devices.
Microcontrollers are small computers that integrate RAM, ROM, I/O ports and other components onto a single chip. They are used in applications where cost, power and space are critical. The document compares microprocessors and microcontrollers, noting that microcontrollers have all components on one chip while microprocessors have separate chips. It then describes the typical internal blocks of a microcontroller, including the CPU, memory, I/O ports, timers and serial ports. Block diagrams show the connections between these internal components.
This presentation discusses the Serial Communication features in 8051, the support for UART. It also discusses serial vs parallel communication, simplex, duplex and full-duplex modes, MAX232, RS232 standards
The 8051 microcontroller has 128 bytes of internal RAM and 4Kbytes of internal ROM memory. It uses the same addresses for code and data but accesses the correct memory based on whether an operation is for code or data. The 128 bytes of internal RAM are organized into 4 banks of 32 bytes each. External memory can be added if more memory is needed for program code or variable data storage. The document also provides information on interfacing external program and data memory with the 8051 microcontroller.
Presents features of ARM Processors, ARM architecture variants and Processor families. Further presents, ARM v4T architecture, ARM7-TDMI processor: Register organization, pipelining, modes, exception handling, bus architecture, debug architecture and interface signals.
The document discusses serial port programming for the 8051 microcontroller. It describes how serial communication works using one bit at a time instead of parallel communication which transfers all bits at once. It explains the registers and pins used for serial communication on the 8051 including the serial data buffer (SBUF) register, serial control (SCON) register, and MAX232 voltage converter. It provides details on programming the 8051 for serial data transmission and reception, including using the TI and RI flags to indicate when data has been sent or received.
A microcontroller is a single-chip microprocessor system consisting of a CPU, memory, and input/output ports. It can be considered a complete computer on a single chip. The 8051 was an early microcontroller developed by Intel for use in embedded systems. It had 4KB of program memory, 128 bytes of data memory, timers, counters, and I/O ports. The 8051 has separate memory spaces for program and data memory and its CPU, registers, timers and I/O ports allow it to monitor and control external devices.
Microcontrollers are small computers that integrate RAM, ROM, I/O ports and other components onto a single chip. They are used in applications where cost, power and space are critical. The document compares microprocessors and microcontrollers, noting that microcontrollers have all components on one chip while microprocessors have separate chips. It then describes the typical internal blocks of a microcontroller, including the CPU, memory, I/O ports, timers and serial ports. Block diagrams show the connections between these internal components.
The document provides an overview of microprocessors and the 8085 microprocessor architecture. It discusses that a microprocessor is a programmable VLSI chip that includes an ALU, registers, and control circuits. The 8085 is an 8-bit microprocessor that can address 64KB of memory. It has three main functional blocks - a register array, ALU and logical group, and instruction decoder/timing and control circuitry. The document also describes the various registers, buses, pins and control signals of the 8085 microprocessor.
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
The document discusses the minimum and maximum mode configurations of the 8086 microprocessor. In minimum mode, a single 8086 processor controls all signals and there is one microprocessor. In maximum mode, more than one microprocessor is present and status signals determine control signals from a bus controller chip. The document also provides details on the pins, signals, and timing diagrams used in read, write, and bus request cycles for both minimum and maximum mode configurations.
The PIC microcontroller uses a Harvard architecture with separate program and data memories. It has a CPU with an ALU, memory unit, and control unit. The memory includes program memory to store instructions, data memory including registers for temporary data storage, and EEPROM for storing variables. It has advantages like a small instruction set, low cost, and built-in interfaces like I2C, SPI, and analog components.
The document provides an introduction to microcontrollers, specifically focusing on the Intel 8051 microcontroller. It defines microcontrollers and distinguishes them from microprocessors by noting that microcontrollers contain peripherals like RAM, ROM, I/O ports and timers on a single chip, while microprocessors require external circuitry. It then describes the architecture and features of the Intel 8051 microcontroller, including its 4KB program memory, 128 bytes of data memory, 32 general purpose registers, two timers, interrupts and I/O ports. Development tools for microcontrollers like editors, assemblers, compilers and debuggers/simulators are also discussed.
Port 0 of the 8051 microcontroller can be used as a bidirectional I/O port or for address/data interfacing with external memory. When used as an input port, writing a 1 to the latch causes the output MOSFETs to turn off, allowing the pin value to be read directly. When used as an output port, a pull-up resistor is needed to write a 1 since the upper MOSFET turns off. Port 1 has internal pull-up resistors so no external resistors are needed, but the external device must sink current when writing a 0. Port 2 is similar to Port 1 for I/O but can also be used for higher address bytes. Port 3 pins each have alternate functions in
The document provides information on the architecture of the 8051 microcontroller. It describes the main features of the 8051 including an 8-bit CPU, 4Kbytes of on-chip program memory, 128 bytes of on-chip data RAM, two 16-bit timers/counters, and 32 I/O lines. It details the core components of the 8051 architecture including the ALU, accumulator, instruction decoder, registers, memory, and addressing modes. It explains the various registers like the program status word, stack pointer, data pointer, and program counter. It also covers the different types of instructions and addressing modes supported by the 8051 microcontroller.
This presentation givens an overview of interfacing of a real tie clock IC with 8051. The contents are referred from book of mazidi.
Also an internal architecture of an RTC is given for reference.
The document discusses the minimum and maximum mode systems of the 8086 microprocessor. In minimum mode, the 8086 generates all control signals and a single processor is used. In maximum mode, an external bus controller chip generates control signals and multiple processors can be used. It describes the components, address latching, read and write cycles, and I/O interfacing for both minimum and maximum mode 8086 systems.
The document discusses the memory organization and registers of the 8051 microcontroller. It describes the program memory and data memory, which are implemented using EPROM and RAM respectively. It then discusses the different registers of the 8051 including the accumulator, B register, data pointer register, stack pointer register, and special function registers. The special function registers are used for tasks like timer control and interrupt control.
Arduinos use serial ports for communicating with computers and other devices. The USB port of an Arduino is used for serial communication with a computer, with the added advantage that USB can also be used to power the device. USB also has the advantage of auto-configuring most of the parameters.
This document discusses various arithmetic and logical instructions in 8051 microcontroller including ADD, SUBB, MUL, DIV, INC, DEC, DA, flags, logical operations, rotate instructions, swap instruction, and comparison operations. It provides examples to explain the working of instructions and how they affect the flag registers. It also summarizes the topics discussed in the lecture on arithmetic and logical operations in 8051 microcontroller.
The PIC 16F877A microcontroller uses a Harvard architecture with separate program and data buses. It has 8kB of flash memory, 368 bytes of RAM, and 256 bytes of EEPROM. It features five I/O ports, three timers, USART serial communication, and 15 interrupt sources. Instructions are in RISC format and execute in 4 machine cycles, with most instructions completing in one cycle.
The document provides an introduction and overview of the Intel 8096 microcontroller. It discusses the 8096's salient features such as its 16-bit architecture, high-speed I/O capabilities, and uses in motor control and robotics. It describes the 8096's architecture including its 16-bit CPU, registers, memory mapping, and I/O features such as timers, serial port, and A/D converter. The document provides details on the 8096's instruction set, addressing modes, and interrupt structure.
The 8051 microcontroller has 2 timers/counters called T0 and T1. As their names suggest, their main purpose is to measure time and count external events. Besides, they can be used for generating clock pulses to be used in serial communication, so called Baud Rate.
The presentation explain about the timers and associated registers in 8051
The document provides an overview of microprocessors and microcontrollers. It discusses the history of microprocessors from early 4-bit processors to modern 64-bit processors. A microprocessor contains a central processing unit while a microcontroller contains additional components like memory and input/output interfaces integrated into a single chip. Microcontrollers require less external hardware than microprocessors. The document describes the basic architecture of microprocessors and microcontrollers including components like registers, buses, and memory. It compares the von Neumann and Harvard architectures. Interrupts and memory-mapped I/O are also discussed.
The document discusses interfacing RS232 with microcontrollers. RS232 uses asynchronous communication and the UART (Universal Asynchronous Receiver/Transmitter) to interface with microcontrollers like the ATmel 89C51. The MAX232 IC is used as a driver to interface RS232 with other devices. Baud rates for communication are set using special function registers in the microcontroller that control the serial port. The baud rate can be doubled by setting the SMOD bit in the PCON register. Data is transmitted by storing it in the serial buffer and cleared the transmit interrupt flag, and received by reading the serial buffer when the receive interrupt flag is set. Functions make it easier to send and receive multiple characters of data through the
1. To make asynchronous serial communication using a microcontroller's USART, the transmitter must configure the baud rate generator and enable transmission by writing data to the transmit register, while the receiver must configure the baud rate generator and enable reception to read incoming data from the receive register.
2. Key steps include setting the SPBRG register and BRGH bit to determine the baud rate, enabling the serial port and transmission/reception, handling 9-bit data if needed, and checking status registers for transmission completion or errors.
3. Asynchronous serial communication allows microcontrollers to transmit data bit by bit over a single line using start and stop bits for synchronization instead of a separate clock line.
The document discusses various addressing modes and instructions of the 8051 microcontroller. It describes the five addressing modes - immediate, register, direct, register indirect and indexed. It explains each addressing mode in detail. It also explains the various instruction groups - data transfer, arithmetic, logical, boolean and branching instructions. It provides examples of instructions like MOV, ADD, ANL, JMP etc. and how they are used to manipulate data in the 8051.
Interfacing memory with 8086 microprocessorVikas Gupta
This document discusses interfacing memory with the 8086 microprocessor. It begins by defining different types of memory like RAM, ROM, EPROM, and EEPROM. It then discusses memory fundamentals like capacity, organization, and standard memory ICs. The document explains two methods of address decoding - absolute and partial decoding. It provides examples of interfacing 32KB RAM, 32K words of memory, and a combination of ROM, EPROM, and RAM with the 8086 using address decoding techniques. Diagrams and tables are included to illustrate the memory mapping and generation of chip select logic.
The 8051 microcontroller has an 8-bit CPU, 4K ROM, 128 bytes RAM, two 16-bit timers, 32 I/O lines, and serial port. It uses an accumulator, B register, program status word and stack pointer along with arithmetic logic unit and instruction decoder to perform operations. The memory includes internal ROM, RAM, and external memory accessed via a 16-bit data pointer and program counter.
MODELLING AND SIMULATION OF 128-BIT CROSSBAR SWITCH FOR NETWORK -ONCHIPVLSICS Design
This is widely accepted that Network-on-Chip represents a promising solution for forthcoming complex embedded systems. The current SoC Solutions are built from heterogeneous hardware and Software components integrated around a complex communication infrastructure. The crossbar is a vital component of in any NoC router. In this work, we have designed a crossbar interconnect for serial bit data transfer and 128-parallel bit data transfer. We have shown comparision between power and delay for the serial bit and parallel bit data transfer through crossbar switch. The design is implemented in 0.180 micron TSM technology.The bit rate achived in serial transfer is slow as compared with parallel data transfer. The simulation resuls show that the critical path delay is less for parallel bit data transfer but power dissipation is high.
DATA TRANSMISSION, Synchronous & Asynchronous Data TransferJabbar Tunyo
The document discusses different methods of data transmission between digital devices. It describes parallel transmission where all bits are transmitted simultaneously on separate wires, allowing for faster transmission but requiring more wires. Serial transmission transmits bits one after the other on a single wire, requiring fewer wires but slower transmission. Synchronous transmission uses a common clock while asynchronous transmission uses start and stop bits between bytes. The document also discusses transmission modes like simplex, half-duplex, and full-duplex, and methods for asynchronous transmission including strobe control and handshaking.
The document provides an overview of microprocessors and the 8085 microprocessor architecture. It discusses that a microprocessor is a programmable VLSI chip that includes an ALU, registers, and control circuits. The 8085 is an 8-bit microprocessor that can address 64KB of memory. It has three main functional blocks - a register array, ALU and logical group, and instruction decoder/timing and control circuitry. The document also describes the various registers, buses, pins and control signals of the 8085 microprocessor.
Minimum mode and Maximum mode Configuration in 8086Jismy .K.Jose
The document discusses the minimum and maximum mode configurations of the 8086 microprocessor. In minimum mode, a single 8086 processor controls all signals and there is one microprocessor. In maximum mode, more than one microprocessor is present and status signals determine control signals from a bus controller chip. The document also provides details on the pins, signals, and timing diagrams used in read, write, and bus request cycles for both minimum and maximum mode configurations.
The PIC microcontroller uses a Harvard architecture with separate program and data memories. It has a CPU with an ALU, memory unit, and control unit. The memory includes program memory to store instructions, data memory including registers for temporary data storage, and EEPROM for storing variables. It has advantages like a small instruction set, low cost, and built-in interfaces like I2C, SPI, and analog components.
The document provides an introduction to microcontrollers, specifically focusing on the Intel 8051 microcontroller. It defines microcontrollers and distinguishes them from microprocessors by noting that microcontrollers contain peripherals like RAM, ROM, I/O ports and timers on a single chip, while microprocessors require external circuitry. It then describes the architecture and features of the Intel 8051 microcontroller, including its 4KB program memory, 128 bytes of data memory, 32 general purpose registers, two timers, interrupts and I/O ports. Development tools for microcontrollers like editors, assemblers, compilers and debuggers/simulators are also discussed.
Port 0 of the 8051 microcontroller can be used as a bidirectional I/O port or for address/data interfacing with external memory. When used as an input port, writing a 1 to the latch causes the output MOSFETs to turn off, allowing the pin value to be read directly. When used as an output port, a pull-up resistor is needed to write a 1 since the upper MOSFET turns off. Port 1 has internal pull-up resistors so no external resistors are needed, but the external device must sink current when writing a 0. Port 2 is similar to Port 1 for I/O but can also be used for higher address bytes. Port 3 pins each have alternate functions in
The document provides information on the architecture of the 8051 microcontroller. It describes the main features of the 8051 including an 8-bit CPU, 4Kbytes of on-chip program memory, 128 bytes of on-chip data RAM, two 16-bit timers/counters, and 32 I/O lines. It details the core components of the 8051 architecture including the ALU, accumulator, instruction decoder, registers, memory, and addressing modes. It explains the various registers like the program status word, stack pointer, data pointer, and program counter. It also covers the different types of instructions and addressing modes supported by the 8051 microcontroller.
This presentation givens an overview of interfacing of a real tie clock IC with 8051. The contents are referred from book of mazidi.
Also an internal architecture of an RTC is given for reference.
The document discusses the minimum and maximum mode systems of the 8086 microprocessor. In minimum mode, the 8086 generates all control signals and a single processor is used. In maximum mode, an external bus controller chip generates control signals and multiple processors can be used. It describes the components, address latching, read and write cycles, and I/O interfacing for both minimum and maximum mode 8086 systems.
The document discusses the memory organization and registers of the 8051 microcontroller. It describes the program memory and data memory, which are implemented using EPROM and RAM respectively. It then discusses the different registers of the 8051 including the accumulator, B register, data pointer register, stack pointer register, and special function registers. The special function registers are used for tasks like timer control and interrupt control.
Arduinos use serial ports for communicating with computers and other devices. The USB port of an Arduino is used for serial communication with a computer, with the added advantage that USB can also be used to power the device. USB also has the advantage of auto-configuring most of the parameters.
This document discusses various arithmetic and logical instructions in 8051 microcontroller including ADD, SUBB, MUL, DIV, INC, DEC, DA, flags, logical operations, rotate instructions, swap instruction, and comparison operations. It provides examples to explain the working of instructions and how they affect the flag registers. It also summarizes the topics discussed in the lecture on arithmetic and logical operations in 8051 microcontroller.
The PIC 16F877A microcontroller uses a Harvard architecture with separate program and data buses. It has 8kB of flash memory, 368 bytes of RAM, and 256 bytes of EEPROM. It features five I/O ports, three timers, USART serial communication, and 15 interrupt sources. Instructions are in RISC format and execute in 4 machine cycles, with most instructions completing in one cycle.
The document provides an introduction and overview of the Intel 8096 microcontroller. It discusses the 8096's salient features such as its 16-bit architecture, high-speed I/O capabilities, and uses in motor control and robotics. It describes the 8096's architecture including its 16-bit CPU, registers, memory mapping, and I/O features such as timers, serial port, and A/D converter. The document provides details on the 8096's instruction set, addressing modes, and interrupt structure.
The 8051 microcontroller has 2 timers/counters called T0 and T1. As their names suggest, their main purpose is to measure time and count external events. Besides, they can be used for generating clock pulses to be used in serial communication, so called Baud Rate.
The presentation explain about the timers and associated registers in 8051
The document provides an overview of microprocessors and microcontrollers. It discusses the history of microprocessors from early 4-bit processors to modern 64-bit processors. A microprocessor contains a central processing unit while a microcontroller contains additional components like memory and input/output interfaces integrated into a single chip. Microcontrollers require less external hardware than microprocessors. The document describes the basic architecture of microprocessors and microcontrollers including components like registers, buses, and memory. It compares the von Neumann and Harvard architectures. Interrupts and memory-mapped I/O are also discussed.
The document discusses interfacing RS232 with microcontrollers. RS232 uses asynchronous communication and the UART (Universal Asynchronous Receiver/Transmitter) to interface with microcontrollers like the ATmel 89C51. The MAX232 IC is used as a driver to interface RS232 with other devices. Baud rates for communication are set using special function registers in the microcontroller that control the serial port. The baud rate can be doubled by setting the SMOD bit in the PCON register. Data is transmitted by storing it in the serial buffer and cleared the transmit interrupt flag, and received by reading the serial buffer when the receive interrupt flag is set. Functions make it easier to send and receive multiple characters of data through the
1. To make asynchronous serial communication using a microcontroller's USART, the transmitter must configure the baud rate generator and enable transmission by writing data to the transmit register, while the receiver must configure the baud rate generator and enable reception to read incoming data from the receive register.
2. Key steps include setting the SPBRG register and BRGH bit to determine the baud rate, enabling the serial port and transmission/reception, handling 9-bit data if needed, and checking status registers for transmission completion or errors.
3. Asynchronous serial communication allows microcontrollers to transmit data bit by bit over a single line using start and stop bits for synchronization instead of a separate clock line.
The document discusses various addressing modes and instructions of the 8051 microcontroller. It describes the five addressing modes - immediate, register, direct, register indirect and indexed. It explains each addressing mode in detail. It also explains the various instruction groups - data transfer, arithmetic, logical, boolean and branching instructions. It provides examples of instructions like MOV, ADD, ANL, JMP etc. and how they are used to manipulate data in the 8051.
Interfacing memory with 8086 microprocessorVikas Gupta
This document discusses interfacing memory with the 8086 microprocessor. It begins by defining different types of memory like RAM, ROM, EPROM, and EEPROM. It then discusses memory fundamentals like capacity, organization, and standard memory ICs. The document explains two methods of address decoding - absolute and partial decoding. It provides examples of interfacing 32KB RAM, 32K words of memory, and a combination of ROM, EPROM, and RAM with the 8086 using address decoding techniques. Diagrams and tables are included to illustrate the memory mapping and generation of chip select logic.
The 8051 microcontroller has an 8-bit CPU, 4K ROM, 128 bytes RAM, two 16-bit timers, 32 I/O lines, and serial port. It uses an accumulator, B register, program status word and stack pointer along with arithmetic logic unit and instruction decoder to perform operations. The memory includes internal ROM, RAM, and external memory accessed via a 16-bit data pointer and program counter.
MODELLING AND SIMULATION OF 128-BIT CROSSBAR SWITCH FOR NETWORK -ONCHIPVLSICS Design
This is widely accepted that Network-on-Chip represents a promising solution for forthcoming complex embedded systems. The current SoC Solutions are built from heterogeneous hardware and Software components integrated around a complex communication infrastructure. The crossbar is a vital component of in any NoC router. In this work, we have designed a crossbar interconnect for serial bit data transfer and 128-parallel bit data transfer. We have shown comparision between power and delay for the serial bit and parallel bit data transfer through crossbar switch. The design is implemented in 0.180 micron TSM technology.The bit rate achived in serial transfer is slow as compared with parallel data transfer. The simulation resuls show that the critical path delay is less for parallel bit data transfer but power dissipation is high.
DATA TRANSMISSION, Synchronous & Asynchronous Data TransferJabbar Tunyo
The document discusses different methods of data transmission between digital devices. It describes parallel transmission where all bits are transmitted simultaneously on separate wires, allowing for faster transmission but requiring more wires. Serial transmission transmits bits one after the other on a single wire, requiring fewer wires but slower transmission. Synchronous transmission uses a common clock while asynchronous transmission uses start and stop bits between bytes. The document also discusses transmission modes like simplex, half-duplex, and full-duplex, and methods for asynchronous transmission including strobe control and handshaking.
Design and implementation of uart on socIjrdt Journal
Security is primary concern in our day-to-day life. Everyone wants to be as much as secure as possible. The UART (universal asynchronous receiver and transmitter) module provides asynchronous serial communication with external devices such as modems and other computers. The UART can be used to control the process of breaking parallel data from the PC down into serial data that can be transmitted and vice versa for receiving data. The UART allows the devices to communicate without the need to be synchronized. UART is a popular method of serial asynchronous communication. Typically, the UART is connected between a processor and a peripheral. To the processor, the UART appears as an 8-bit read-write parallel port that performs serial-to-parallel conversions for the processor, and vice versa for the peripheral. With the implementation of UART the serial communication is done in high data rate and no interrupts. Baud rate generator provides high data rate and interrupt controller handles all the interrupts. The UART serial communication interface device receives data and converts data from serial to parallel, where as the transmitter performs parallel to serial conversion.
Giga bit per second Differential Scheme for High Speed InterconnectVLSICS Design
This document summarizes a research paper on developing a high-speed transmitter for off-chip communication using differential signaling. It describes a transmitter circuit that consists of low-speed input buffers, serializers to convert parallel data to serial data, and current-mode drivers to transmit the serial data differentially over transmission lines. The serializers use a delay locked loop to generate clock phases that sample the parallel inputs and transmit each bit over the serial link for an equal duration. The current-mode drivers convert the serial data to differential current levels on the transmission line. The design is intended to increase I/O bandwidth for high-speed chip-to-chip communication.
This document discusses different types of data transmission between digital devices. It describes parallel transmission, where all bits are transmitted simultaneously on separate wires, and serial transmission, where bits are transmitted sequentially on a single wire. The document also discusses synchronous transmission, which uses a common clock, and asynchronous transmission, which uses start and stop bits. Finally, it covers strobe control and handshaking methods for asynchronous transmission, where handshaking provides confirmation that data was received.
International Journal of Computational Engineering Research(IJCER)ijceronline
International Journal of Computational Engineering Research (IJCER) is dedicated to protecting personal information and will make every reasonable effort to handle collected information appropriately. All information collected, as well as related requests, will be handled as carefully and efficiently as possible in accordance with IJCER standards for integrity and objectivity.
The document discusses serial port programming for the 8051 microcontroller. It describes how serial communication works using one bit at a time instead of parallel communication which transfers all bits at once. It explains the registers and pins used for serial communication on the 8051 including the SBUF, SCON, TMOD registers and MAX232 voltage converter. It provides details on programming the 8051 for serial data transmission and reception by monitoring the TI and RI flags in the SCON register.
Congratulations! #You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points######################################################### have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app №########################################################################################################################################################################################################################№##################################№#################################################################################onelink.to/tn3ze7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem points using Fonepay app ######onelink.to/tn3z#####################№№#########################e7Congratulations! You have earned 30 reward points for the first Fonepay transaction. Your balance is 30. Redeem p#################################
The document provides information on the OSI model and its seven layers. It discusses:
- The OSI model was developed in the 1970s and published in 1984 to standardize network communication. It helps troubleshoot errors and understand network hardware and software relationships.
- The seven layers are the physical, data link, network, transport, session, presentation and application layers. The physical layer deals with raw data transmission and the data link layer frames the data for transmission.
- Error detection methods like CRC are used at the data link layer to ensure error-free transmission of data packets between nodes. CRC adds a checksum to the data for the receiving node to verify.
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology.
Codec Scheme for Power Optimization in VLSI InterconnectsIJEEE
This document summarizes a research paper that presents a codec scheme to optimize power in VLSI interconnects using bus encoding. The scheme detects different types of crosstalk couplings between wires and encodes the data to reduce switching activity. It was implemented using Cadence tools in 0.18um technology. Simulation results found a maximum power of 6.44uW for an input combination, showing a 38.89% power reduction over previous work. The scheme models the full custom design approach instead of semi-custom.
Introduction to Computer Networking and TypesProf Ansari
Digital data can be transmitted over many different types of media. Selecting a transmission medium is guided by comparing transmission requirements against the medium’s characteristics. Four important criteria influence the choice:ThesisScientist.com
"Emblogic.com" is the best education center in India to assist you about serial port device driver and their development as well. To know more about these kind of training program, visit our professional website.
An approach to Measure Transition Density of Binary Sequences for X-filling b...IJECEIAES
Switching activity and Transition density computation is an essential stage for dynamic power estimation and testing time reduction. The study of switching activity, transition densities and weighted switching activities of pseudo random binary sequences generated by Linear Feedback shift registers and Feed Forward shift registers plays a crucial role in design approaches of Built-In Self Test, cryptosystems, secure scan designs and other applications. This paper proposed an approach to find transition densities, which plays an important role in choosing of test pattern generator We have analyze conventional and proposed designs using our approache, This work also describes the testing time of benchmark circuits. The outcome of this paper is presented in the form of algorithm, theorems with proofs and analyses table which strongly support the same. The proposed algorithm reduces switching activity and testing time up to 51.56% and 84.61% respectively.
UART project report by Tarun Khaneja ( 09034406598 )Tarun Khaneja
This document provides information about asynchronous serial communication and UARTs. It discusses how UARTs convert parallel data from a computer to serial data for transmission and vice versa. Key points include:
- UARTs add start and stop bits and optionally parity bits, and handle interrupts from serial devices.
- Asynchronous serial transmission uses start and stop bits to delineate each byte or character, while synchronous transmission requires a shared clock.
- Serial communication can transmit data over longer distances than parallel and requires fewer wires. However, it is more complex to interface with serial devices.
- For asynchronous transmission to work, the transmitting and receiving devices must agree on parameters like bit rate, number of data bits,
Hands On Data Communications, Networking and TCP/IP TroubleshootingLiving Online
More and more people who work in plants need to understand how data from the field is transmitted to the control room and even to Manufacturing Execution Systems located in head offices situated considerable distances from the plant. It is a technological marvel and this manual helps you to understand the flow of information and the various techniques involved in it.
MORE INFORMATION: http://www.idc-online.com/content/hands-data-communications-networking-and-tcpip-troubleshooting-30?id=37
this presentation contains all sort of information regarding USCI(Universal Serial Communication Interface)
UART, SPI, I2C etc.
this will be very helpful to the people those who are planning or starting projects or want to get idea how devices interfaced.
Serial Communication Interface with Error Detectioniosrjce
UART is used for serial data communication. UART is a piece of computer hardware that translates
between parallel bits of data and serial bits. UART is usually an integrated circuit used for serial
communications over a computer or peripheral device serial port. Bits have to be moved from one place to
another using wires or some other medium. Over many miles, the expense of the wires becomes large. To reduce
the expense of long communication links carrying several bits in parallel, data bits are sent sequentially. Errors
may occur either internally or externally while we transmit information from source to destination. The errors
generated during the transmission would affect the performance of the overall system. In order to reduce the
errors we should incorporate any error detecting schemes like hamming decoder, check parity systems etc.
Different serial communication devices are available.
This document discusses serial communication interfaces and error detection techniques. It begins with an introduction to serial communication interfaces and some common interfaces like RS-232, I2C, and SPI. It then discusses the differences between synchronous and asynchronous serial communication. The bulk of the document focuses on using Hamming codes for error detection and correction in serial transmission. It provides an example of how Hamming codes can be used to detect and correct single bit errors in transmitted data. The document concludes by stating that error correction can improve the reliability and fault tolerance of integrated circuits.
This document provides a case study to calculate bandwidth requirements for interfaces in a UTRAN network based on given traffic modeling parameters:
1. It models the traffic with 3 million users distributed across 2000 sites and 6000 cells, and defines busy hour voice/data usage profiles.
2. For scenario 1 using E1 IMA ATM on Iub, it calculates bandwidth needs per NodeB for signaling at 0.91 Mbps and common channels at 0.17 Mbps, plus NBAP/ALCAP signaling.
3. It then calculates Iub CS bandwidth at 1.43 Mbps and PS bandwidth based on the given downlink throughput per user, accounting for overhead and redundancy factors.
4.
Similar to Serial communication of microcontroller 8051 (20)
Nilesh Bhaskarrao Bahadure presents information on biomedical image processing and signal analysis. The document discusses biomedical signals, their origin and dynamics, and processing techniques. It explains that physiological processes produce signals that can provide information about health and disease states. Advanced signal processing is needed to extract clinically relevant data from complex biomedical signals. The document also describes computer-aided diagnosis systems, which apply computer technology to medical imaging to assist physicians' clinical decision making and improve diagnostic accuracy.
The document provides an overview of various medical imaging techniques used to image the brain including CT, MRI, fMRI, PET, and SPECT. It describes each technique, how they work, what types of images they produce, and what they can be used to detect in the brain. CT uses X-rays to produce 2D images while MRI uses magnetic fields and radio waves to produce detailed 3D images without radiation. fMRI can show which parts of the brain are active during tasks by tracking blood flow and oxygen usage. PET and SPECT involve radioactive tracers to detect biochemical processes.
The document discusses timers in 8051 microcontrollers. It describes the different modes timers can operate in, including 13-bit, 16-bit, and 8-bit auto-reload modes. It explains the timer-related special function registers TMOD, TCON, THx and TLx. It provides steps for initializing timers, programming timers in mode 1, and calculating time delays. The document is intended to provide an understanding of how to generate time delays, measure time, and count pulses using the timers in 8051 microcontrollers.
Programmable Peripheral Interface (PPI) 8255
Features of 8255
Block Diagram of 8255 PPI
3 Modes of operation of 8255 PPI
BSR Mode of 8255 PPI
Parallel IO of 8255 PPI
IC 8155/8156
Features of 8155/8156
Block Diagram of 8155/8156
Chip Enable Logic & Port Addresses (Peripheral I/O Addressing
Scheme
Control Word Register of 8155
Timers of 8155/8156
Modes of Timers of 8155
IC 8355/8755
Block Diagram of 8155/8156
The document discusses the Microprocessor 8085. It describes the architecture of the 8085, which is divided into registers, an arithmetic logic unit, an instruction decoder, address buffers, interrupt control, and timing/control circuitry. It details the registers of the 8085 including general purpose, temporary, special purpose, and 16-bit registers like the program counter and stack pointer. The document also examines the ALU, instruction decoder, addressing mechanisms, interrupt handling, serial I/O, and timing control circuitry of the 8085 microprocessor.
Addressing Modes of 8051
Symbol or nomenclature used for data or memory
Instruction sets of 8051
Assembler and Assembler Directives
Delay Calculation
Examples on Delay Calculation
The Microcontroller 8051 Family
Features of 8051 Microcontroller
Pin Configuration of 8051 Microcontroller
Ports of 8051 Microcontroller
Architecture of 8051 Microcontroller
Registers of 8051
Special Function Registers (SFR's)
Bit addressable RAM
Register Bank and Stack of 8051
Semiconductor Memory Fundamentals
Memory Types
Memory Structure and its requirements
Memory Decoding
Examples
Input - Output Interfacing
Types of Parallel Data Transfer or I/O Techniques
Introduction to Interrupts
What happens when the interrupt is occurs
Interrupt Vs Polling
Classfication of Interrupts
Hardware Interrupts of 8085
Software Interrupts of 8085
Maskable Interrupts of Microprocessor 8085
Non - Maskable Interrupts of Microprocessor 8085
Vectored Interrupts of Microprocessor 8085
Non - Vectored Interrupts of Microprocessor 8085
8085 Microprocessor Interrupt Structure
Interrupt Structure of Microprocessor 8085
SIM Instruction
Non - Vectored Interrupt
Pending Interrupts
What is Interrupt
Introduction to 8051 Microcontroller Interrupts
Interrupts of 8051 Microcontroller
Interrupt Vs Polling
IE register
IP register
What happens when an interrupt occurs?
What happens when an interrupt Ends?
Programming Timer Interrupt
Serial Interrupt
External Hardware Interrupt
Examples
The document discusses the instruction sets and programming of the 8085 microprocessor. It covers the various addressing modes of the 8085 including immediate, register, direct, indirect, and implicit addressing modes. It also describes the instruction format, opcode format, and the different instruction groups of the 8085 such as data transfer, arithmetic, logical, branching, and machine control instructions. For each instruction group, it provides the list of instructions, number of bytes, and number of clock cycles.
Introduction
Embedded Operating Systems
Applications of Embedded Systems
Characteristics of Embedded Systems
Architecture of Real Embedded Systems
Embedded Operating System
Real Time Operating Systems (RTOS)
Total slides: 102
Depletion Layer in PN Junction
Barrier Potential in a PN junction
Energy Diagram of PN Junction
Biasing The PN Junction
V-I Characteristics of P-N junction Diode
Applications of Diode - Rectiers
Photodiode
Light Emitting Diodes - LED
Zener Diode
Total slides: 75
What is Transducers
Selection Criteria of the Transducers
Basic Requirements of a Transducers
Strain Gauge
Inductive Transducer - LVDT
Load Cell
Temperature Transducers
Photoelectric Transducer
LDR
Photovoltaic Solar Cells
The document provides an overview of the bipolar junction transistor (BJT) including:
1. A BJT has three terminals connected to three doped semiconductor regions, either NPN or PNP.
2. BJTs act as current-controlled switches, regulating the current flowing from emitter to collector in proportion to the base voltage.
3. There are three common configurations - common base has voltage gain but no current gain, common emitter has both gains, and common collector has current gain but no voltage gain. Each configuration has different characteristics.
Total slides: 109
Light Emitting Diodes
Seven Segment LED
LCD Interfacing
Stepper Motor Interfacing
Digital to Analog Converter
ADC Interfacing
Keyboard Interfacing
This document contains 99 questions related to programmable logic controllers (PLCs). The questions cover topics such as PLC components, ladder logic programming, registers, instructions, numbering systems, and applications. They range from basic questions testing understanding of PLC concepts to more complex questions involving designing PLC programs to solve application problems. The questions are divided into three units, with unit one focusing on basic PLC operation, unit two on registers and instructions, and unit three on numbering systems, subroutines, and advanced instructions.
This document contains a question bank for the subject "Microprocessor & Interfaces" provided by Dr. Nilesh Bhaskarrao Bahadure of the Department of Electronics Engineering. It includes short answer, mid-range, and long answer type questions related to the architecture, operation, registers, pins, signals, addressing modes and instructions of the 8085 microprocessor. The questions cover topics such as the components of a computer system, microprocessor architecture, assembly language, interrupts, memory interfacing, I/O techniques and programming of the 8085 microprocessor.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTjpsjournal1
The rivalry between prominent international actors for dominance over Central Asia's hydrocarbon
reserves and the ancient silk trade route, along with China's diplomatic endeavours in the area, has been
referred to as the "New Great Game." This research centres on the power struggle, considering
geopolitical, geostrategic, and geoeconomic variables. Topics including trade, political hegemony, oil
politics, and conventional and nontraditional security are all explored and explained by the researcher.
Using Mackinder's Heartland, Spykman Rimland, and Hegemonic Stability theories, examines China's role
in Central Asia. This study adheres to the empirical epistemological method and has taken care of
objectivity. This study analyze primary and secondary research documents critically to elaborate role of
china’s geo economic outreach in central Asian countries and its future prospect. China is thriving in trade,
pipeline politics, and winning states, according to this study, thanks to important instruments like the
Shanghai Cooperation Organisation and the Belt and Road Economic Initiative. According to this study,
China is seeing significant success in commerce, pipeline politics, and gaining influence on other
governments. This success may be attributed to the effective utilisation of key tools such as the Shanghai
Cooperation Organisation and the Belt and Road Economic Initiative.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
1. Serial Communication of 8051 Microcontroller
Dr. Nilesh Bhaskarrao Bahadure
https://www.sites.google.com/site/nileshbbahadure/home
July 25, 2021
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 1 / 73
2. Overview I
1 Universal Asynchronous Receiver Transmitter (UART)
2 Introduction to Serial Communication
3 Types of Transmission
Simplex Communication
Duplex Communication
Half Duplex Communication
Full Duplex Communication
4 Methods of Serial data Transmission
Synchronous serial data transfer
Asynchronous serial data transfer
Differences Synchronous Asynchronous
5 Data Transfer Rate
6 Calculation of Baud Rate
7 SCON Register
Importance of TI Flag Bit
Importance of RI Flag Bit
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 2 / 73
3. Overview II
8 SBUF Register
9 Writing to the Serial port
10 Reading the Serial port
11 PCON Register
12 Programming of transmission byte serially
13 Programming of reception of byte serially
14 Examples
Example -1: Transmission of N
Example -2: Transmission of N
Example -3: Receive byte serially
Example -4: Transmission of multiple byte serially
Example -5: Transmission & Reception byte serially
Example - 6: Switch base Yes - No
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 3 / 73
4. Universal Asynchronous Receiver Transmitter (UART)
UARTs are used for serial communication between systems; they can be
either half duplex (send or receive but at different intervals) or full duplex
(send and receive at the same time). Also known as an RS232 connection
the microcontroller UART can provide the connection with a PC or another
Microcontroller-based system. Figure 1 illustrates possible connection ar-
rangements. In a minimum connection there could be only two transmission
lines, transmit (Tx) and receive (Rx) as shown in Figure 2. The data is con-
veyed as a bit stream, either transmit or receive, and the speed is defined
by the baud rate i.e. the bits per second.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 4 / 73
5. Universal Asynchronous Receiver Transmitter (UART)...
Figure : Use of RS232 interface between PC and Microcontroller or between two
microcontrollers
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 5 / 73
6. Universal Asynchronous Receiver Transmitter (UART)...
Figure : RS 232 transmit (Tx) and Receive (Rx) connections between a PC and
Microcontroller
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 6 / 73
7. Universal Asynchronous Receiver Transmitter (UART)...
The UART has four modes of operation, 0 to 3. Modes 0 and 2 have fixed
baud rates, mode 0 is one-sixth of the oscillator frequency, and mode 2 is
1/16 or 1/32 of the oscillator frequency. For modes 1 and 3 the baud rate
can be selected, a typical range is:
75; 150; 300; 600; 1200; 2400; 4800; 9600; 19200; 38400
Modes 0 and 1 are used for connection between two devices. Modes 2 and 3
are used for master slave multiprocessor systems, in principle there could be
one master microcontroller and up to 255 slave microcontrollers. In mode
1 ten bits are used to specify an RS232 frame consisting of 1 start bit (logic
0), 8 data bits and 1 stop bit (logic 1). For example the ASCII bit pattern
0100 0001 (hex 41) represents the character ’A’ and is transmitted as shown
in Figure 3; least significant bit (LSB) first.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 7 / 73
8. Universal Asynchronous Receiver Transmitter (UART)...
Figure : ASCII bit pattern 01000001 (41h) for character ’A’
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 8 / 73
9. Introduction to Serial Communication
One of the 8051s most powerful features is its integrated UART, otherwise
known as a serial port. The fact that the 8051 has an integrated serial port
means that you may very easily read and write values to the serial port.
If it were not for the integrated serial port, writing a byte to a serial line
would be a rather complicated process requiring turning ON and OFF one
of the I/O lines in rapid succession to properly “clock out” each individual
bit, including start bits, stop bits, and parity bits.
Actually, if the serial communication port is not integrated within the chip
then proper synchronization between the transmitter and the receiver is
very complicated process. However, we do not have to do this. Instead,
we simply need to configure the serial ports operation mode and baud rate.
This configuration can be done by writing very simple code, may requires
only 5 to 8 lines of code. Once configured, all we have to do is write to
an SFR to write a value to the serial port or read the same SFR to read a
value from the serial port.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 9 / 73
10. Types of Transmission
Serial communication is capable of processing or transmitting of information
by 2 types they are Simplex communication and Duplex communication.
Further the duplex communication is also of 2 types, they are, half duplex
communication and full duplex communication.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 10 / 73
11. Simplex Communication
In the simplex communication, the serial data is transmitted only in one
direction, i.e. from transmitter to receiver.
The simplex is a one way transmission, data is transferred only in one di-
rection over a single communication channel. For example Microprocessor
transmit data to the Printer, Microprocessor transmit data to the CRT dis-
play unit.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 11 / 73
12. Simplex Communication...
Figure : Simplex Transmission
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 12 / 73
13. Duplex Communication
The Duplex is a two way transmission; data may be transferred between
two transceivers in both directions simultaneously. So it will contain one
way transmission or two way transmission at a time. For example Telephone
line.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 13 / 73
14. Half Duplex Communication
The Half Duplex is a two way transmission but in such a way that data may
travel in only one direction at a time. For example Wacky Talky (Wireless
System).
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 14 / 73
15. Full Duplex Communication
The full duplex is a two way transmission (communication) but in such a
way that the data may travel in both the direction at the same time. For
example Telephone line, mobile communication etc.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 15 / 73
16. Duplex Communication...
Figure : Duplex Transmission
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 16 / 73
17. Methods of Serial data Transmission / Format of serial
data transmission
In modern data communication system for the data transfer two types of
format are used Synchronous and Asynchronous.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 17 / 73
18. Synchronous serial data transfer
In this method block of data bytes are transferred serially at a time. The
numbers of data bytes are not limited. The data bytes are transferred one
after the other and so on up to the end. In this method at the starting of
data transfer, first transfer synchronous characters one synchronous char-
acter is compulsory for the data transfer and 2nd is optional. Synchronous
characters are inform to the receiver will start the transferring of data i.e.
its provide synchronization between transmitter and receiver. In one syn-
chronous character 256 receivers are connected i.e. from 00 to FFh. As
the synchronization is done only once and before the start of data transfer,
the synchronous communication is faster compared to asynchronous com-
munication. So it is generally used for fast data transfer at high rate. The
synchronous data format with two synchronous characters is shown in the
figure 6
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 18 / 73
19. Synchronous serial data transfer
Figure : Synchronous data format
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 19 / 73
20. Asynchronous serial data transfer
In this method block of data bytes are transferred serially at a time. The
numbers of data bytes are not limited. The data bytes are transferred one
after the other and so on up to the end. In this method at the starting of
data transfer, first transfer synchronous characters one synchronous char-
acter is compulsory for the data transfer and 2nd is optional. Synchronous
characters are inform to the receiver will start the transferring of data i.e.
its provide synchronization between transmitter and receiver. In one syn-
chronous character 256 receivers are connected i.e. from 00 to FFh. As
the synchronization is done only once and before the start of data transfer,
the synchronous communication is faster compared to asynchronous com-
munication. So it is generally used for fast data transfer at high rate. The
synchronous data format with two synchronous characters is shown in the
figure 7
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 20 / 73
21. Asynchronous serial data transfer
Figure : Asynchronous data format
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 21 / 73
22. Differences Between Synchronous & Asynchronous Data
Transfer
Synchronous data transfer Asynchronous data transfer
It is used to transfer a group of
Characters at a time.
It is used to transfer one char-
acter at a time
Used for high data transfer
rates 20 K bits / second
Used for data transfer rates 20
K bits / second
Synchronous character are
transmitted along with the
group of characters
Synchronous characters are not
transmitted along with the
characters
No start and stop bits for each
character is used
Start and stop bit for each char-
acter is present which forms a
frame
Table : Differences Syn Asynch
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 22 / 73
23. Differences Between Synchronous & Asynchronous Data
Transfer...
Synchronous data transfer Asynchronous data transfer
One clock is used for both
transmitter and receiver
Two separate clock inputs can
be used for transmitter and re-
ceiver
Since synchronization is in-
volved, this can be imple-
mented by using hardware only
No synchronization is required
hence hardware and software
implementation is possible.
Table : Differences Syn Asynch
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 23 / 73
24. Data Transfer Rate / Baud Rate
Data transfer rate is defined as the number of bits are transmitted or re-
ceived in one second. Usually it is referred as bits per second (BPS) and
sometimes it is also called baud rate (BR). Transmission of the serial data
requires configuring baud rate, actually at the baud rate it was defines that
how many bits to be transferred in one second. It is not possible to con-
figure data transfer serially without configuring baud rate. It is important
to note that, it is not necessary that bits per second and baud rate are
same. Because the baud rate is used in reference to MODEM (Modulator
- Demodulator), where number of signal changes indicate bits transmission
and in single signal change may indicate more data bits are transmitted,
whereas if conductor based transmission is concerned then bits per second
and baud rate are same.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 24 / 73
25. Data Transfer Rate / Baud Rate...
Baud rate in 8051 Microcontroller is programmable, means that different
baud rates can be easily achieved without any hardware configuration or
modifications; this is simply done by writing a set of instructions. The
8051 Microcontroller divides crystal frequency by 12 to get the machine
cycle frequency, in other words we say that internal frequency is the 1/12th
of crystal frequency (External frequency). Serial communication UART
circuitry once again divides this frequency i.e. machine cycle frequency by
32 or 16, depending on the status of SMOD bit in the PCON register to use
by timer 1 to generate baud rate. in other words we may say that on chip
UART circuitry uses the frequency after diving the machine cycle frequency
by 32 or 16 for calculation of baud rate.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 25 / 73
26. Data Transfer Rate / Baud Rate...
Figure : Setting baud rate for SMOD =0
Figure : Setting baud rate for SMOD =1
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 26 / 73
27. Data Transfer Rate / Baud Rate...
To set baud rate compatible with IBM PCs timer 1 must be operated in
auto reload mode. The reason behind to use the auto reload mode is that,
it is possible to get maximum overflows (ticks) at very high rate only in
auto reload mode.
The values to be loaded in TH1 register and their corresponding baud rate
compatible with IBM PCs are shown in the table 3
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 27 / 73
28. Data Transfer Rate / Baud Rate...
TH1 (Decimal) TH1 (Hex) Baud Rate
-3 FDh 9600
-6 FAh 4800
-12 F4h 2400
-24 E8h 1200
-48 D0h 600
Table : Timer 1 TH1 Register Value for the Baud Rate
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 28 / 73
29. Calculation of Baud Rate
In mode 1 and 3, the baud rate is determined by how frequently timer 1
overflows. The more frequently timer 1 overflows, the higher the baud rate
i.e. how fast the timer flag bit overflows that decides baud rate. In other
words we can say that baud rate is directly related with timer flag rollover.
There are many ways one can cause timer 1 to overflow at a rate that
determines a baud rate but the most common method is to put timer 1 in 8
- bit auto - reload mode (timer mode 2) and set a reload value (TH1) that
causes timer 1 to overflow at a frequency appropriate to generate a baud
rate.
To determine the value that must be loaded in TH1 register to generate a
given baud rate, we may use the following equation:
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 29 / 73
30. Calculation of Baud Rate...
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
TH1 = 256 − 2SMOD ×Oscillator Frequency
384×Baud Rate
if SMOD = 0
TH1 = 256 − Oscillator Frequency
384×Baud Rate
if SMOD = 1
TH1 = 256 − Oscillator Frequency
192×Baud Rate
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 30 / 73
31. SCON Register
D7 D6 D5 D4 D3 D2 D1 D0
SM0 SM1 SM2 REN TB8 RB8 TI RI
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 31 / 73
32. SCON Register...
Bit Name Bit address Function
7 SM0 9Fh
Serial port mode bit 0
6 SM1 9Eh
Serial port mode bit 1
5 SM2 9Dh
Multiprocessor communication
enable bit
4 REN 9Ch
Receiver enables. This bit must
be set in order to receive char-
acters serially.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 32 / 73
33. SCON Register...
Bit Name Bit address Function
3 TB8 9Bh
Transmit bit 8. The 9th bit to
transmit in mode 2 and mode 3
2 RB8 9Ah
Receive bit 8. The 9th bit re-
ceived in mode 2 and mode 3
1 TI 99h
Transmit flag. Set when a
byte has been transmitted com-
pletely.
0 RI 98h
Receive flag. Set when a byte
has been received completely.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 33 / 73
34. SCON Register...
SM0 SM1 Serial mode Explanation Baud rate
0 0 0 8 - bit shift register Oscillator/12
0 1 1 8 - bit UART Set by timer 1
1 0 2 9 - bit UART Oscillator/32
1 1 3 9 - bit UART Set by timer 1
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 34 / 73
35. Importance of TI Flag Bit
The following steps are observed when the character byte transferred serially
via TxD line
1. The start bit is transmitted; indicate that data transmitted is going to
be start.
2. The 8 - bit main value of the character byte start transmission with LSB
(bit D0) first.
3. The stop bit is transmitted. The stop bit is the last bit to be transmitted
if the parity bit is not considered. It is during the transmission of stop bit,
TI flag bit is raised to one (logic high) by CPU, indicating that transmission
is completed. So 8051 is ready to transfer a new character byte.
4. By monitoring TI flag bit we ensure that the previous byte is transmitted
completely or not. Suppose TI flag bit doesn’t raises and we are trying to
send new character, so there may be chances that some bits of the previous
byte are lost and new character gets transmitted. In other words TI flag bit
is raised by CPU in order to ensure proper transmission of data bits.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 35 / 73
36. Importance of TI Flag Bit..
5. When TI rises it must be forced to zero by software program in order to
transmit next character or byte.
From the above points it is clear that when 8051 Microcontroller finishes
transmission, it will raise TI flag bit automatically, gives the information
that transmission is completed in all respects.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 36 / 73
37. Importance of RI Flag Bit
In receiving bits via its RxD line, the 8051 Microcontroller goes through the
following steps
1. It receives the start bit, indicating that the next bit is the first bit of the
character byte it is about to receive.
2. The 8 - bit character is received one bit at a time, The LSB i.e. D0 bit
receives first. When the last bit (bit D7) is received, a byte is formed and
placed in the SBUF register.
3. The stop bit is received, when receiving the stop bit the 8051 makes RI
= 1, indicating that an entire character byte has been received and must
be picked up before it gets over written by an incoming character.
4. By checking the RI flag bit when it is raised, we know that the character
has been received and it is available in the SBUF register. We must copy the
SBUF register contents to a safe place in some other register or in memory
before it is lost.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 37 / 73
38. Importance of RI Flag Bit...
5. After the SBUF contents are copied into a safe place, the RI flag bit
must be forced to 0 by the software instruction CLR RI in order to allow the
next received character byte to be placed in SBUF, failure to do this causes
loss of the received character.
From the above, we conclude that by checking the RI flag bit, we know
whether or not the 8051 has received a character byte. If we fail to copy
SBUF into a safe place, we risk the loss of the received byte. More impor-
tantly, it must be noted that RI flag bit is raised by the 8051, but it must
be cleared by the programmer with an instruction such as CLR RI. It must
also be noted that if we copy SBUF into a safe place before the RI flag bit
is raised, we risk copying the garbage.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 38 / 73
39. SBUF Register
The SBUF register is used to load the data to be transmitted serially. The
data received serially by 8051 Microcontroller is also copied to the SBUF
register. The ON chip address of SBUF register is 99h. The SBUF register
is also access like any other register of 8051 Microcontroller for example, to
load data 34h to the SBUF register then, it may written as
MOV SBUF, #34h or MOV 99h, #34h
Similarly the data from SBUF register is copied to any other register, for
example MOV A, SBUF
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 39 / 73
40. Writing to the serial port
Once the Serial Port has been properly configured as explained above, the
serial port is ready to be used to send data and receive data. If you thought
that configuring the serial port was simple, using the serial port will be a
breeze. To write a byte to the serial port one must simply write the value
to the SBUF (99h) SFR.
For Example, if you wanted to send the letter “A” to the serial port, it could
be accomplished as easily as:
MOV SBUF, #’A’
Upon execution of the above instruction the 8051 will begin transmitting the
character via the serial port. Obviously transmission is not instantaneous–it
takes a measureable amount of time to transmit
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 40 / 73
41. Writing to the serial port
The 8051 lets us know when it is done transmitting a character by setting
the TI bit in SCON. When this bit is set we know that the last character has
been transmitted and that we may send the next character, if any. Consider
the following code segment:
CLR TI ; be sure the bit is initially clear
MOV SBUF, #’A’ ; Send the letter A to the serial port
JNB TI, $ ; Pause until the RI bit is set.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 41 / 73
42. Reading the serial port
Reading data received by the serial port is equally easy. To read a byte
from the serial port one just needs to read the value stored in the SBUF
(99h) SFR after the 8051 has automatically set the RI flag in SCON. For
example, if your program wants to wait for a character to be received and
subsequently read it into the Accumulator, the following code segment may
be used:
JNB RI, $ ; Wait for the 8051 to set the RI flag
MOV A, SBUF ; Read the character from the serial port
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 42 / 73
43. PCON Register
Question
Explain how to double the baud rate without changing crystal frequency
D7 D6 D5 D4 D3 D2 D1 D0
SMOD – – – GF1 GF0 PD IDL
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 43 / 73
44. PCON Register...
There are two ways to increase the baud rate of data transfer in the 8051
Microcontroller
1. Use a higher frequency crystal
2. Change a bit in the PCON register, i.e. bit D7 (SMOD) bit of PCON
register
When the 8051 is powered up, D7 bit of the PCON register is zero, we can
set this bit to HIGH by software and thereby double the baud rate. The
following sequence of the instructions must be used to set bit D7 HIGH of
the PCON register, since PCON is not a bit addressable register. There
may be more methods to set SMOD = 1, without affecting the other bits of
PCON register, so one may use any sequence of the program with ensuring
that the other bits of the PCON register is unaffected and only SMOD gets
high.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 44 / 73
45. PCON Register...
MOV A, PCON ; get original or old value of PCON register in Accumulator
SETB ACC.7 ; make D7 (SMOD) = 1
MOV PCON, A ; now SMOD = 1 without modifying other bits of the PCON
register
Alternatively,
MOV A, PCON ; get original or old value of PCON register in Accumulator
OR A, #0FFh ; make D7 (SMOD) = 1
MOV PCON, A ; now SMOD = 1 without modifying other bits of the PCON
register
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 45 / 73
46. Calculation of Baud Rate...
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
TH1 = 256 − 2SMOD ×Oscillator Frequency
384×Baud Rate
if SMOD = 0
TH1 = 256 − Oscillator Frequency
384×Baud Rate
if SMOD = 1
TH1 = 256 − Oscillator Frequency
192×Baud Rate
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 46 / 73
47. Baud rate comparision for SMOD = 0 & SMOD = 1
Baud rate comparisons for SMOD = 0 and SMOD =1 is shown in the table
below. It shows that the for the same value of TH1, the baud rate are
doubled when SMOD = 1
TH1 (Decimal) TH1 (Hex) Baud Rate
SMOD = 0 SMOD = 1
-3 FDh 9600 19200
-6 FAh 4800 9600
-12 F4h 2400 4800
-24 E8h 1200 2400
-48 D0h 600 1200
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 47 / 73
48. Programming of transmission byte serially
The following steps are taken to transmit a character or byte serially through
the TxD line of 8051 Microcontroller.
1. The TMOD register must be initialized with 20h indicating that timer
1 in auto - reload mode (mode 2), to set the baud rate. The baud rate
is configured only using auto - reload mode, because only in auto - reload
mode it is possible to get maximum overflow at very high rate.
2. Load TH1 register with a value corresponding to the specified baud rate.
3. Initialize SCON register with value 50h indicating serial mode 1 i.e. 8 -
bit data, 1 start bit and 1 stop bit. In most of the system use only serial
mode 1, because this mode is IBM compatible.
4. Set TR1 = 1 to start the timer 1, to get the baud rate.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 48 / 73
49. Programming of transmission byte serially...
5. The character byte to be transmitted serially must be put in the SBUF
register.
6. Keep monitoring TI (transmitter interrupt) flag bit using the instruction
“CHECK: JNB TI, CHECK”, in order to ensure that transmission is com-
pleted or not. When TI rises, indicates completion of the transmission of
character them go out of the loop.
7. Clear TI flag bit using instruction CLR TI
8. In order to repeat the process, i.e. to transmit another character or byte
go to step 5. No need to start the timer again, as once the baud rate is
configured; it is available throughout the completion of the program. The
baud rate is change again by loading another value in TH1 register and start
the timer or it may gets laps by resetting the system.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 49 / 73
50. Programming of reception of byte serially
The following steps are followed to receive character or byte serially through
the RxD line of 8051 Microcontroller.
1. The TMOD register must be initialized with 20h indicating that timer
1 in auto - reload mode (mode 2), to set the baud rate. The baud rate
is configured only using auto - reload mode, because only in auto - reload
mode it is possible to get maximum overflow at very high rate.
2. Load TH1 register with a value corresponding to the specified baud rate.
3. Initialize SCON register with value 50h indicating serial mode 1 i.e. 8 -
bit data, 1 start bit and 1 stop bit. In most of the system use only serial
mode 1, because this mode is IBM compatible.
4. Set TR1 = 1 to start the timer 1, to get the baud rate.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 50 / 73
51. Programming of reception of byte serially...
5. Keep monitoring RI (receiver interrupt) flag bit using the instruction
“CHECK: JNB RI, CHECK”, in order to ensure that reception is completed
or not. When RI rises, indicates completion of the reception of character
then go out of the loop.
6. When RI flag bit is rises then there is a byte i.e. received byte in SBUF
register, so it must be picked up before a new incoming character is received.
In other words when RI is rises then store the SBUF contents in safe place.
7. Clear RI flag bit using instruction CLR RI
8. In order to repeat the process, i.e. to receive another character or byte
go to step 5. No need to start the timer again, as once the baud rate is
configured; it is available throughout the completion of the program. The
baud rate is change again by loading another value in TH1 register and start
the timer or it may gets laps by resetting the system.
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 51 / 73
52. Example -1: Transmission of character N serially
Example - 1
8051 Microcontroller has an oscillator frequency of 11.0592MHz. Using
timer 1 and configuring the UART in mode 1 write an assembly language
program that transmits the ASCII character “N” at a baud rate of 9600.
Solution
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
(Assume) SMOD = 0
By putting baud rate 9600, we get
TH1=FDh
Calculate TMOD and SCON
TMOD = 20h
SCON = 50h
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 52 / 73
53. Example -1: Transmission of character N serially
Assembly Language Program
ORG 0 ; reset address
SJMP START ; jump over reserved area
ORG 40H ; program start address
START: MOV SCON, #50H ; serial mode 1
MOV TMOD, #20H ; timer 1 mode 2
MOV TH1, #0FDH ; baud rate 9600
SETB TR1 ; turn timer 1 on
AGAIN: MOV SBUF, #’N’ ; ASCII of N into SBUF
HERE: JNB TI, HERE ; stay here till TI is set
CLR TI ; clear TI
SJMP AGAIN ; repeat
END ; end of assembly language
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 53 / 73
54. Example -2: Transmission of character N serially
Example - 2
8051 Microcontroller has an oscillator frequency of 11.0592MHz. Using
timer 1 and configuring the UART in mode 1 write an assembly language
program that transmits the ASCII character “N” at a baud rate of 19200.
Solution
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
(Assume) SMOD = 0
By putting baud rate 19200, we get
TH1=FEh
Calculate TMOD and SCON
TMOD = 20h
SCON = 50h
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 54 / 73
55. Example -2: Transmission of character N serially
Assembly Language Program
ORG 0 ; reset address
SJMP START ; jump over reserved area
ORG 40H ; program start address
START: MOV SCON, #50H ; serial mode 1
MOV TMOD, #20H ; timer 1 mode 2
MOV TH1, #0FEH ; baud rate 9600
SETB TR1 ; turn timer 1 on
AGAIN: MOV SBUF, #’N’ ; ASCII of N into SBUF
HERE: JNB TI, HERE ; stay here till TI is set
CLR TI ; clear TI
SJMP AGAIN ; repeat
END ; end of assembly language
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 55 / 73
56. Example -3: Receive byte serially and send to port P1
Example - 3
8051 Microcontroller has an oscillator frequency of 11.0592 MHz. Write an
assembly language program that receives a character into the serial buffer
(SBUF) of the UART and writes the hex value of the character onto port
1. The UART should be configured as mode 1. Use 9600 baud rate.
Solution
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
(Assume) SMOD = 0
By putting baud rate 9600, we get
TH1=FDh
Calculate TMOD and SCON
TMOD = 20h
SCON = 50h
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 56 / 73
57. Example -3: Receive byte serially
Assembly Language Program
ORG 0 ; reset address
SJMP START ; jump over reserved area
ORG 40H ; program start address
START: MOV SCON, #50H ; mode 1, REN enabled
MOV TH1, #0FDH ; 9600 baud
MOV TMOD, #20H ; timer 1 mode 2
SETB TR1 ; turn timer 1 on
STAY: JNB RI, STAY ; stay here, until RI = 1
CLR RI ; clear RI
MOV A, SBUF ; move character from buffer to A
MOV P1, A ; hex value onto port 1
RETI ; return from interrupt
END ; no more assembly language
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 57 / 73
58. Example -4: Transmission of message BHEL serially
Example - 4
8051 Microcontroller has an oscillator frequency of 11.0592 MHz. write
an assembly language program to transfer the message “BHEL” serially at
4800 baud rate, 8 - bit data, 1 start bit and 1 stop bit. Send the message
continuously.
Solution
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
(Assume) SMOD = 0
By putting baud rate 4800, we get
TH1=FAh
Calculate TMOD and SCON
TMOD = 20h
SCON = 50h
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 58 / 73
59. Example -4: Trans. of byte serially (Method - I)
Assembly Language Program
ORG 0
SJMP START
ORG 0040H
START: MOV TMOD, #20H
MOV TH1, #-6 / MOV TH1, # 0FAH
MOV SCON, #50H
SETB TR1
AGAIN: MOV A, #’B’
ACALL SEND
MOV A, #’H’
ACALL SEND
MOV A, #’E’
ACALL SEND
MOV A, #’L’
ACALL SEND
SJMP AGAIN
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 59 / 73
60. Example -4: Trans. of byte serially (Method - I)...
Assembly Language Program
SEND: MOV SBUF, A
HERE: JNB TI, HERE
CLR TI
RET
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 60 / 73
61. Example - 4: Trans. of byte serially (Method - II)
Assembly Language Program
ORG 0
SJMP START
ORG 0040H
START: MOV TMOD, #20H
MOV TH1, #-6 / MOV TH1, #0FAH
MOV SCON, #50H
SETB TR1
LAST: MOV DPTR, #MSG
AGAIN: CLR A
MOVC A, @A+DPTR
JZ LAST ; If last character get o
repeat again
ACALL SEND
INC DPTR
SJMP AGAIN
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 61 / 73
62. Example - 4: Trans. of byte serially (Method - II)...
Assembly Language Program
SEND: MOV SBUF, A
HERE: JNB TI, HERE
CLR TI
RET
MSG: DB ’BHEL’, 0
END
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 62 / 73
63. Example -5: Transmission & Reception byte serially
Example - 5
Assume that the 8051 microcontroller’s serial port is connected to the COM
port of the IBM PC, and on the PC we are using the Hyper Terminal program
to send and receive data serially. Port P1 and P2 of the 8051 are connected
to the LED’s and switches respectively. Write an assembly language program
to perform the following
1. Send to the PC the message “Microcontroller is ready”
2. Receive any data sent by the PC and put it on LEDs connected to the
port P1.
3. Get data on switches connected to port P2 and send it to the PC
serially. The program should perform in part (1) once but part (2) and (3)
continuously. Assume the baud rate 4800 with oscillator frequency 11.0592
MHz.
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 63 / 73
64. Example -5: Transmission & Reception byte serially
Solution
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
(Assume) SMOD = 0
By putting baud rate 4800, we get
TH1=FAh
Calculate TMOD and SCON
TMOD = 20h
SCON = 50h
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 64 / 73
65. Example -5: Transmission & Reception byte serially
Assembly Language Program
ORG 0 ; reset address
SJMP START ; jump over reserved area
ORG 40H ; program start address
START: MOV P2, #0FFH ; Port P2 configured as an input port
MOV SCON, #50H ; serial mode 1
MOV TMOD, #20H ; timer 1 mode 2
MOV TH1, #0FAH ; baud rate 19200
SETB TR1 ; turn timer 1 on
MOV DPTR, #MSG ; load pointer for message
TR MSG: CLR A
MOVC A, @A+DPTR ; get the character
JZ READ SW ; check for last character, get out if las
ACALL SEND ; otherwise transfer message serially
INC DPTR ; next character
SJMP TR MSG ; stay in loop until last character is sen
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 65 / 73
66. Example -5: Transmission & Reception byte serially...
Assembly Language Program
READ SW: MOV A, P2 ; read switches value from port P2
ACALL SEND ; transfer it serially
ACALL RECEV ; get the serial data
MOV P1, A ; display it on LED’s
SJMP READ SW ; repeat the process
SEND: MOV SBUF, A ; load the data into SBUF
HERE: JNB TI, HERE ; stay here till TI set
CLR TI ; clear TI
RET
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 66 / 73
67. Example -5: Transmission & Reception byte serially...
Assembly Language Program
RECEV: JNB RI, RECEV
MOV A, SBUF
CLR RI
RET
MSG: DB ’Microcontroller is ready’, 0
END ; end of assembly language
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 67 / 73
68. Example - 6: Switch base Yes - No
Example - 6
Assume a switch is connected to pin P0.3, write an assembly language
program to monitor its status and send two messages to the serial port
continuously as follows:
SW = 0 send “NO”
SW = 1 send “YES”
Assume that crystal frequency of the 8051 is 11.0592 MHz, use 19200 baud
rate and 8 - bit UART. Use SMOD =1
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 68 / 73
69. Example - 6: Transmission & Reception byte serially
Solution
TH1 = 256 − 2SMOD ×Oscillator Frequency
12×32×Baud Rate
(Given) SMOD = 1
By putting baud rate 19200, we get
TH1=FDh
Calculate TMOD and SCON
TMOD = 20h
SCON = 50h
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 69 / 73
70. Example - 6: Switch base Yes - No
Assembly Language Program
ORG 0 ; reset address
SJMP START ; jump over reserved area
ORG 40H ; program start address
START: MOV A, PCON
SETB ACC.7
MOV PCON, A
MOV SCON, #50H ; serial mode 1
MOV TMOD, #20H ; timer 1 mode 2
MOV TH1, #0FDH ; baud rate 19200
SETB TR1 ; turn timer 1 on
SETB P0.3 ; make port pin P0.3 as an input port
CHECK: JB P0.3, NEXT
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 70 / 73
71. Example - 6: Switch base Yes - No...
Assembly Language Program
MOV DPTR, #MSG1 ; If SW = 0 then send message NO
REP1: CLR A
MOVC A, @A+DPTR ; read the message
JZ CHECK ; check for last character
ACALL SEND ; send message serially
INC DPTR ; go for next byte
SJMP REP1
NEXT: MOV DPTR, #MSG2 ; if SW = 1 then send message YES
REP2: CLR A
MOVC A, @A+DPTR ; read the message
JZ CHECK ; check for last character
ACALL SEND ; send message serially
INC DPTR ; go for next byte
SJMP REP2
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 71 / 73
72. Example - 6: Switch base Yes - No...
Assembly Language Program
SEND: MOV SBUF, A ; copy A into SBUF for serial transmission
HERE: JNB TI, HERE ; stay here till TI set
CLR TI ; clear TI
RET
MSG1: DB ’NO’, 0
MSG2: DB ’YES’, 0
END ; end of assembly language
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 72 / 73
73. Thank you
Please send your feedback at nbahadure@gmail.com
For more details and updates kindly visit
https://sites.google.com/site/nileshbbahadure/home
Main Slide
Dr. Nilesh Bhaskarrao Bahadure () Unit - III (Part I) July 25, 2021 73 / 73