SlideShare a Scribd company logo
UART 
BY-INDRA RAJ SHUKLA 
MRIDUL PANDEY
Serial Data Transmission
Standard Serial Data Format
UART Block Digram
library ieee; 
use ieee.std_logic_1164.all; 
entity UART_Transmitter is 
port(Bclk, sysclk, rst_b, TDRE, loadTDR: in std_logic; 
DBUS:in std_logic_vector(7 downto 0); 
setTDRE, TxD: out std_logic); 
end UART_Transmitter; 
architecture xmit of UART_Transmitter is 
type stateType is (IDLE, SYNCH, TDATA); 
signal state, nextstate : stateType;
signal TSR : std_logic_vector (8 downto 0); -- Transmit Shift Register 
signal TDR : std_logic_vector(7 downto 0); -- Transmit Data Register 
signal Bct: integer range 0 to 9; -- counts number of bits sent 
signal inc, clr, loadTSR, shftTSR, start: std_logic; 
signal Bclk_rising, Bclk_dlayed: std_logic; 
begin 
TxD <= TSR(0); 
setTDRE <= loadTSR; 
Bclk_rising <= Bclk and (not Bclk_dlayed); -- indicates the rising edge of bit clock 
Xmit_Control: process(state, TDRE, Bct, Bclk_rising) 
begin 
inc <= '0'; clr <= '0'; loadTSR <= '0'; shftTSR <= '0'; start <= '0'; 
-- reset control signals 
case state is 
when IDLE => if (TDRE = '0' ) then 
loadTSR <= '1'; nextstate <= SYNCH; 
else nextstate <= IDLE; end if; 
when SYNCH => -- synchronize with the bit clock 
if (Bclk_rising = '1') then 
start <= '1'; nextstate <= TDATA; 
else nextstate <= SYNCH; end if;
when TDATA => 
if (Bclk_rising = '0') then nextstate <= TDATA; 
elsif (Bct /= 9) then 
shftTSR <= '1'; inc <= '1'; nextstate <= TDATA; 
else clr <= '1'; nextstate <= IDLE; end if; 
end case; 
end process; 
Xmit_update: process (sysclk, rst_b) 
begin 
if (rst_b = '0') then 
TSR <= "111111111"; state <= IDLE; Bct <= 0; Bclk_dlayed <= '0'; 
elsif (sysclk'event and sysclk = '1') then 
state <= nextstate; 
if (clr = '1') then Bct <= 0; elsif (inc = '1') then 
Bct <= Bct + 1; end if; 
if (loadTDR = '1') then TDR <= DBUS; end if; 
if (loadTSR = '1') then TSR <= TDR & '1'; end if; 
if (start = '1') then TSR(0) <= '0'; end if; 
if (shftTSR = '1') then TSR <= '1' & TSR(8 downto 1); end if; -- shift out one bit 
Bclk_dlayed <= Bclk; -- Bclk delayed by 1 sysclk 
end if; 
end process; 
end xmit;
Application

More Related Content

What's hot

Serial Communication Uart soc
Serial Communication  Uart socSerial Communication  Uart soc
Serial Communication Uart soc
Satyam Sharma
 
UART Communication
UART CommunicationUART Communication
UART Communication
dattatraya1
 
Uart
UartUart
8051 serial communication-UART
8051 serial communication-UART8051 serial communication-UART
8051 serial communication-UART
Pantech ProLabs India Pvt Ltd
 
Fun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol WorksFun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol Works
Ritesh Kanjee
 
Verification of uart ip core using uvm
Verification of uart ip core using uvmVerification of uart ip core using uvm
Verification of uart ip core using uvm
eSAT Publishing House
 
FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...
ASHIMA GUPTA
 
UART
UARTUART
Universal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project reportUniversal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project report
Shahrukh Javed
 
Wireless UART Controller: XR18W750
Wireless UART Controller: XR18W750Wireless UART Controller: XR18W750
Wireless UART Controller: XR18W750
Premier Farnell
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPT
Sai_praneeth
 
Serial communication in LPC2148
Serial communication in LPC2148Serial communication in LPC2148
Serial communication in LPC2148
sravannunna24
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communicationasteriskbimal
 
Serial communication
Serial communicationSerial communication
Serial communication
Vikas Dongre
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16
Techvilla
 

What's hot (20)

Serial Communication Uart soc
Serial Communication  Uart socSerial Communication  Uart soc
Serial Communication Uart soc
 
UART
UARTUART
UART
 
UART Communication
UART CommunicationUART Communication
UART Communication
 
Uart
UartUart
Uart
 
8051 serial communication-UART
8051 serial communication-UART8051 serial communication-UART
8051 serial communication-UART
 
Fun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol WorksFun and Easy UART - How the UART Protocol Works
Fun and Easy UART - How the UART Protocol Works
 
Verification of uart ip core using uvm
Verification of uart ip core using uvmVerification of uart ip core using uvm
Verification of uart ip core using uvm
 
FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...FPGA implementation of synchronous and asynchronous counter and simulation of...
FPGA implementation of synchronous and asynchronous counter and simulation of...
 
UART
UARTUART
UART
 
Universal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project reportUniversal asynchronous receiver-transmitter UART Dsa project report
Universal asynchronous receiver-transmitter UART Dsa project report
 
NAVEEN UART BATCH 43
NAVEEN UART BATCH 43NAVEEN UART BATCH 43
NAVEEN UART BATCH 43
 
Naveen UART BATCH 43
Naveen UART BATCH 43Naveen UART BATCH 43
Naveen UART BATCH 43
 
Wireless UART Controller: XR18W750
Wireless UART Controller: XR18W750Wireless UART Controller: XR18W750
Wireless UART Controller: XR18W750
 
Intel Quark HSUART
Intel Quark HSUARTIntel Quark HSUART
Intel Quark HSUART
 
Xilinxaxi uart16550
Xilinxaxi uart16550Xilinxaxi uart16550
Xilinxaxi uart16550
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPT
 
Serial communication in LPC2148
Serial communication in LPC2148Serial communication in LPC2148
Serial communication in LPC2148
 
8051 serial communication
8051 serial communication8051 serial communication
8051 serial communication
 
Serial communication
Serial communicationSerial communication
Serial communication
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16
 

Similar to Uart

Uart
UartUart
Uart
cs1090211
 
Tdm to vo ip 2
Tdm to vo ip 2Tdm to vo ip 2
Tdm to vo ip 2
Abhiroop Mn
 
vhdll.docx
vhdll.docxvhdll.docx
vhdll.docx
NguynTinDng35
 
Vhdl programs
Vhdl programsVhdl programs
Vhdl programs
Kirthika Natarajan
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
Syed Ghufran Hassan
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
Miguel Angel Peña
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDL
Omkar Rane
 
Direct analog
Direct analogDirect analog
Direct analog
srikanthsailu
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
Sandra Long
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
Omkar Rane
 
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Shinya Takamaeda-Y
 
Datapath_control_path_pruned.pptxhghygvvgygh
Datapath_control_path_pruned.pptxhghygvvgyghDatapath_control_path_pruned.pptxhghygvvgygh
Datapath_control_path_pruned.pptxhghygvvgygh
21ELB370MOHAMMADAREE
 
Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptsatish 486
 
Data Acquisition
Data AcquisitionData Acquisition
Data Acquisition
azhar557
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
SANTIAGO PABLO ALBERTO
 
Reporte vhd10
Reporte vhd10Reporte vhd10
Reporte vhd10
Miguel Angel Peña
 
407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture
PallaviBR4UB20EI021
 

Similar to Uart (20)

Uart
UartUart
Uart
 
Tdm to vo ip 2
Tdm to vo ip 2Tdm to vo ip 2
Tdm to vo ip 2
 
Fpga creating counter with internal clock
Fpga   creating counter with internal clockFpga   creating counter with internal clock
Fpga creating counter with internal clock
 
vhdll.docx
vhdll.docxvhdll.docx
vhdll.docx
 
Vhdl programs
Vhdl programsVhdl programs
Vhdl programs
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 
REPORT
REPORTREPORT
REPORT
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
 
Digital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDLDigital to analog -Sqaure waveform generator in VHDL
Digital to analog -Sqaure waveform generator in VHDL
 
Direct analog
Direct analogDirect analog
Direct analog
 
Fpga creating counter with external clock
Fpga   creating counter with external clockFpga   creating counter with external clock
Fpga creating counter with external clock
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
 
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
Pythonによるカスタム可能な高位設計技術 (Design Solution Forum 2016@新横浜)
 
Datapath_control_path_pruned.pptxhghygvvgygh
Datapath_control_path_pruned.pptxhghygvvgyghDatapath_control_path_pruned.pptxhghygvvgygh
Datapath_control_path_pruned.pptxhghygvvgygh
 
Vechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor pptVechicle accident prevention using eye bilnk sensor ppt
Vechicle accident prevention using eye bilnk sensor ppt
 
Data Acquisition
Data AcquisitionData Acquisition
Data Acquisition
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
Reporte vhd10
Reporte vhd10Reporte vhd10
Reporte vhd10
 
407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture407841208-Modular-UART.pptx design and architecture
407841208-Modular-UART.pptx design and architecture
 

Uart

  • 1. UART BY-INDRA RAJ SHUKLA MRIDUL PANDEY
  • 5.
  • 6. library ieee; use ieee.std_logic_1164.all; entity UART_Transmitter is port(Bclk, sysclk, rst_b, TDRE, loadTDR: in std_logic; DBUS:in std_logic_vector(7 downto 0); setTDRE, TxD: out std_logic); end UART_Transmitter; architecture xmit of UART_Transmitter is type stateType is (IDLE, SYNCH, TDATA); signal state, nextstate : stateType;
  • 7. signal TSR : std_logic_vector (8 downto 0); -- Transmit Shift Register signal TDR : std_logic_vector(7 downto 0); -- Transmit Data Register signal Bct: integer range 0 to 9; -- counts number of bits sent signal inc, clr, loadTSR, shftTSR, start: std_logic; signal Bclk_rising, Bclk_dlayed: std_logic; begin TxD <= TSR(0); setTDRE <= loadTSR; Bclk_rising <= Bclk and (not Bclk_dlayed); -- indicates the rising edge of bit clock Xmit_Control: process(state, TDRE, Bct, Bclk_rising) begin inc <= '0'; clr <= '0'; loadTSR <= '0'; shftTSR <= '0'; start <= '0'; -- reset control signals case state is when IDLE => if (TDRE = '0' ) then loadTSR <= '1'; nextstate <= SYNCH; else nextstate <= IDLE; end if; when SYNCH => -- synchronize with the bit clock if (Bclk_rising = '1') then start <= '1'; nextstate <= TDATA; else nextstate <= SYNCH; end if;
  • 8. when TDATA => if (Bclk_rising = '0') then nextstate <= TDATA; elsif (Bct /= 9) then shftTSR <= '1'; inc <= '1'; nextstate <= TDATA; else clr <= '1'; nextstate <= IDLE; end if; end case; end process; Xmit_update: process (sysclk, rst_b) begin if (rst_b = '0') then TSR <= "111111111"; state <= IDLE; Bct <= 0; Bclk_dlayed <= '0'; elsif (sysclk'event and sysclk = '1') then state <= nextstate; if (clr = '1') then Bct <= 0; elsif (inc = '1') then Bct <= Bct + 1; end if; if (loadTDR = '1') then TDR <= DBUS; end if; if (loadTSR = '1') then TSR <= TDR & '1'; end if; if (start = '1') then TSR(0) <= '0'; end if; if (shftTSR = '1') then TSR <= '1' & TSR(8 downto 1); end if; -- shift out one bit Bclk_dlayed <= Bclk; -- Bclk delayed by 1 sysclk end if; end process; end xmit;