RS-232 Port Lecture L9.3. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)

Slides:



Advertisements
Similar presentations
Review: Interrupts & Timers
Advertisements

28/10/2007DSD,USIT,GGSIPU1 Latch & Register Inference.
Arbitrary Waveform Discussion 5.5 Example 34.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
A Simple Microcontroller VHDL Tutorial R. E. Haskell and D. M. Hanna T6: VHDL State Machines.
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Registers VHDL Tutorial R. E. Haskell and D. M. Hanna T2: Sequential Logic Circuits.
RS-232 Port Discussion D7.1. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
Data Stack Lecture 8.2 A VHDL Forth Core for FPGAs: Sect. 3.
Simple Sequential Circuits in VHDL. Contents Sequential circuit examples: - SR latch in dataflow style - D flip-flop in behavioral style - shift register.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Lab 6 Program Counter and Program ROM Mano & Kime Sections 7-1 – 7-6.
USART and Asynchrono us Communica tion The USART is used for synchronous and asynchronous serial communication. USART = Universal Synchronous/Asynchronous.
7-Segment Displays Digilent Spartan 3 Board Discussion DS-4.2.
Programming Example Lecture 8.6 A VHDL Forth Core for FPGAs: Sect. 7.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Registers Lab 5 Mano and Kime Sections 5-2, 5-3, 5-7.
LCD Display DIO2 Board CPLD. DIO2 Board CPLD Interface LCD Display.
Shift Registers Discussion D5.2 Example Bit Shift Register qs(3) qs(2) qs(1) qs(0) if rising_edge(CLK) then for i in 0 to 2 loop s(i) := s(i+1);
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
The 8051 Microcontroller and Embedded Systems
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
Lecture Set 9 MCS-51 Serial Port.
“Describe the overview of hardware interfacing and the serial communication interface. Describe the PIC18 connections to RS232. Explain the serial port.
Universal Asynchronous Receiver/Transmitter (UART)
1 Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
UART ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Serial Communications
BYU ECEn 320 Lab 4 UART Transmitter. BYU ECEn 320 UART Transmimtter Specification VGA Serial A1 Expansion Connector PS2 A2 Expansion Connector B1 Expansion.
Example. SBUF Register SCON Register(1) SCON Register(2)
ENG241 Digital Design Week #8 Registers and Counters.
Universal Asynchronous Receiver/Transmitter (UART)
Reaction Timer Project
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
Lecture # 14. RS – 232C Standard Standard for physical dimensions of the connectors. PC (DTE) Modem RS – 232C Cable Connected via serial port (DCE)
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Sequential statements (1) process
Serial mode of data transfer
UART Serial Port Programming
RS-232 Communications.
Registers and Counters
Source: Serial Port Source:
Lecture # 13.
SERIAL PORT PROGRAMMING
Serial Communication: RS-232 (IEEE Standard)
UART Serial Port Programming
UART Serial Port Programming
Fast, Asynchronous SRAM
Serial Communication Interface
Преглед Начин функционисања Имплементације
VHDL (VHSIC Hardware Description Language)
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
8051 Micro Controller.
Figure 8.1. The general form of a sequential circuit.
DIO2 Board Projects.
Source: Serial Port Source:
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Chapter 6 Transmission of Digital Data Interfaces and Modems
RS-232 Port Discussion D12.1.
PIC Serial Port Interfacing
8051SERIAL PORT PROGRAMMING
PIC Serial Port Interfacing
(Sequential-Circuit Building Blocks)
Presentation transcript:

RS-232 Port Lecture L9.3

Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)

Spartan-3 board: DCE male connector PC: DTE female connector Straight-through cable

Note: TxD (pin 2) on Spartan-3 DCE connector is connected to RD (pin 2) on the PC DTE connector

UART clock frequency = 16 x Baud rate or 64 x Baud rate

Standard ASCII Codes

RS-232 Interface to the WC16

\ A software UART for the Spartan-3 board HEX : CYCLES( n -- )\ delay 2n+5 FOR NEXT ; : KEY( -- n ) 0\ byte to read BEGIN\ wait for start bit 80 XOR UNTIL 797\ 3900 = 1.5 bit times 8 FOR\ 2*797 + E = $F3C = 3900 CYCLES\ delay U2/ OR\ get next bit 50E\ 2*50E + C = $A28 = 2600 NEXT\ = 1 bit time BEGIN\ wait for stop bit UNTIL DROP ;

: bit_time( n -- )\ 9600 baud bit time 511 FOR NEXT ; : TX!( n -- ) 0 >tx DROP\ start bit bit_time 8 FOR\ 8 data bits >tx bit_time U2/ NEXT DROP 1 >tx DROP\ stop bit bit_time ;

: MAIN( -- ) BEGIN KEY\ receive byte DUP DIG! \ display it TX! AGAIN ;

when rxfetch =>-- read uart in E2 tload <= '1'; nload <= '1'; tsel <= "101"; dpush <= '1'; when totx =>-- latch T(0) to txreg txload <= '1'; Add to wc16_control.vhd

How would you make the following hardware UART? 8-bit asynchronous serial data comes in RxD and fills up the shift register data_rx. When data_rx is full, rdrf is set to 1. rdrf is cleared to zero by bringing clrflg high. The framing error flag FE is set to 1 if the stop bit is not 1.

UART Receive State Diagram

entity uart_rx is port( RxD : in STD_LOGIC; clk : in STD_LOGIC; clr : in STD_LOGIC; rdrf_clr : in STD_LOGIC; rdrf : out STD_LOGIC; FE : out STD_LOGIC; rx_data : out STD_LOGIC_VECTOR(7 downto 0) ); end uart_rx;

architecture uart_rx of uart_rx is type state_type is (mark, start, delay, shift, stop); signal state: state_type; signal rxbuff: STD_LOGIC_VECTOR (7 downto 0); signal baud_count: STD_LOGIC_VECTOR (11 downto 0); signal bit_count: STD_LOGIC_VECTOR (3 downto 0); signal rdrf_set, fe_set, cclr, cclr8, rxload: STD_LOGIC; constant bit_time: STD_LOGIC_VECTOR (11 downto 0) := X"A28"; constant half_bit_time: STD_LOGIC_VECTOR (11 downto 0) := X"514"; begin 9600 baud

uart2: process(clk, clr, rdrf_clr) begin if clr = '1' then state <= mark; rxbuff <= " "; baud_count <= X"000"; bit_count <= "0000"; FE <= '0'; elsif rdrf_clr = '1' then rdrf <= '0'; elsif (clk'event and clk = '1') then case state is when mark =>-- wait for start bit if RxD = '1' then state <= mark; else baud_count <= X"000"; bit_count <= "0000"; rxbuff <= " "; FE <= '0'; state <= start; -- go to start end if;

when start =>-- check for start bit if baud_count >= half_bit_time then baud_count <= X"000"; state <= delay; else baud_count <= baud_count + 1; state <= start; end if; when delay => if baud_count >= bit_time then baud_count <= X"000"; if bit_count < 8 then state <= shift; else state <= stop; end if; else baud_count <= baud_count + 1; state <= delay; end if;

when shift =>-- get next bit rxbuff(7) <= RxD; rxbuff(6 downto 0) <= rxbuff(7 downto 1); bit_count <= bit_count + 1; state <= delay; when stop => rdrf <= '1'; if RxD = '0' then FE <= '1'; else FE <= '0'; end if; state <= mark; end case; end if; end process uart2; rx_data <= rxbuff; end uart_rx;

\ Test of uart HEX : key( -- n ) BEGIN 8000 AND UNTIL ; : main( -- ) BEGIN clr_rdrf key DIG! AGAIN ;