BYU ECEn 320 Lab 4 UART Transmitter. BYU ECEn 320 UART Transmimtter Specification VGA Serial A1 Expansion Connector PS2 A2 Expansion Connector B1 Expansion.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

Review: Interrupts & Timers
Programmable Interval Timer
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Lab 09 :D Flip Flop, Shift Registers and Switch Bounce: Slide 2 Slide 3 The D Flip Flop. 4-Bit Shift Register. Slide 4 Shift Register De-bounce System:
Input/Output Organization Asynchronous Bus
Microprocessor and Microcontroller
RS-232 Port Discussion D7.1. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
Project Check-off 2 UART Design Jeffrey Tsai. Project Thus Far FIFO SRAM UART IN UART OUT Main Control FSM Collision Audio In interface Audio Out interface.
CS150 Project Checkpoint 2 CheckPt2 is easy!!! BUT………………. This lab can be very tricky. BUT……………… Mark is here to help! You get to listen to cool.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
Logic and Computer Design Fundamentals Registers and Counters
Analog-to-Digital Converters Lecture L11.2 Section 11.3.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 20 Datapath and Control Datapath - performs data transfer and processing operations.
RS-232 Port Lecture L9.3. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
Sistemas Digitais I LESI - 2º ano Lesson 8 - Sequential Design Practices U NIVERSIDADE DO M INHO E SCOLA DE E NGENHARIA Prof. João Miguel Fernandes
Interface circuits I/O interface consists of the circuitry required to connect an I/O device to a computer bus. Side of the interface which connects to.
Digital Fundamentals Floyd Chapter 9 Tenth Edition
9/15/09 - L25 Registers & Load Enable Copyright Joanne DeGroat, ECE, OSU1 Registers & Load Enable.
Counters and Registers
Electronics Technology
ECEN 248 Lab 6: De-Bouncing, Counters & LCD Display Control
PS2 Keyboard Interface Using Spartan-3 Starter Kit Board
INPUT-OUTPUT ORGANIZATION
Counters Clocked sequential circuit whose state diagram contains a single cycle. Modulus – number of states in the cycle. Counters with non-power of 2.
Dr. H.v.d.Biggelaar / Mar3-Ver2 / 1 Engineering Technology Dr. H.v.d.Biggelaar March 22, 2000 State Machines in VHDL.
Digilent System Board Capabilities Serial Port (RS-232) Parallel Port 1 Pushbutton Hint: Good for a reset button Connected to a clock input. See Digilent.
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
1 Registers and Counters A register consists of a group of flip-flops and gates that affect their transition. An n-bit register consists of n-bit flip-flops.
Rabie A. Ramadan Lecture 3
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
ECE 448: Lab 5 Serial Communications. Part 1: Serial Communications Part 2: Clock Management Part 3: Clock Domains Part 4: User Constraint File (UCF)
Example. SBUF Register SCON Register(1) SCON Register(2)
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 17 Dr. Shi Dept. of Electrical and Computer Engineering.
Digital Design Lectures 11 & 12 Shift Registers and Counters.
ECE 448: Spring 11 Lab 3 Part 1 Sequential Logic for Synthesis.
ENG241 Digital Design Week #8 Registers and Counters.
ECE 448: Spring 11 Lab 3 Part 2 Finite State Machines.
Abdullah Said Alkalbani University of Buraimi
Instructor: Alexander Stoytchev
Digital Logic Design.
Sequential logic circuits
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
Lab Environment and Miniproject Assignment Spring 2009 ECE554 Digital Engineering Laboratory.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
REGISTER TRANSFER LANGUAGE (RTL) INTRODUCTION TO REGISTER Registers1.
ECE 554 Miniproject Spring
Counters and registers Eng.Maha Alqubali. Registers Registers are groups of flip-flops, where each flip- flop is capable of storing one bit of information.
Implementation of Pong over VGA on the Nexys 4 FPGA
Copyright ©2009 by Pearson Higher Education, Inc. Upper Saddle River, New Jersey All rights reserved. Digital Fundamentals, Tenth Edition Thomas.
UART Jin-Fu Li. 2 EE613 VLSI DesignNational Central University Introduction UART (modem)  Universal asynchronous receiver and transmitter Data format.
REGISTER TRANSFER LANGUAGE (RTL)
Flip-Flops and Related Devices
Source: Serial Port Source:
SERIAL PORT PROGRAMMING
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Basics of digital systems
Instructor: Alexander Stoytchev
ECE 434 Advanced Digital System L12
Introduction to ModelSim Implementing Sequential
Analog-to-Digital Converters
KU College of Engineering Elec 204: Digital Systems Design
RS-232 Port Discussion D12.1.
Presentation by Anthony Dotterer
Presentation transcript:

BYU ECEn 320 Lab 4 UART Transmitter

BYU ECEn 320 UART Transmimtter Specification VGA Serial A1 Expansion Connector PS2 A2 Expansion Connector B1 Expansion Connector Power Send ASCII value on 8 toggle switches to serial port for display on screen when button 1 is pressed.

BYU ECEn 320 Top Level System Block Diagram Clock/Reset Generator Switch and Button Interface Button Debouncer tx_test tx Transmitter Two Entities: tx_test - top level file to test the transmitter tx - The transmitter itself, which is instantiated in the body of tx_test You will reuse the transmitter in a later lab 7 segment display ctrl

BYU ECEn 320 Transmitter Tester (tx_test) Block Diagram tx 8 data_in tx_out clk (50 MHz) rst tx_busy send_character Debounce Circuit button switch(7 downto 0) txd clk_in display cntrl signals

BYU ECEn 320 Transmitter (tx) Block Diagram FSM Shift Register Bit Timer 8 data_in tx_out clk rst clrTimer tx_bit shift clk rst clk rst tx_busy send_character load Transmit Out shift_out stop start

BYU ECEn 320 Bit Timer FSM Shift Register Bit Timer 8 data_in tx_out clk rst clrTimer tx_bit shift clk rst clk rst tx_busy send_character load Transmit Out shift_out stop start

BYU ECEn 320 Bit Timer - Transmitter Clocking Everything is clocked on same global clock (clk) Global clock is 50MHz The Bit Timer controls the timing of bits coming out of the serial port. Bit Timer needs to create timing pulse at rate of 19,200Hz –That is the baud rate of our serial port –Divide factor = 50,000,000/19,200 = … –We will use 2604 cycles/pulse

BYU ECEn 320 Transmitter Bit Timer Bit timer can be created from a counter –Can be cleared, otherwise increments up to 2603 and rolls over –Signal tx_bit is asserted during the last cycle (cycle 2603 in this case) clk tx_bit state serial_out 2604 cycles “one bit”

BYU ECEn 320 Building a Parameterizable Bit-Timer To make our transmitter more reusable, we will use generics for the clock rate and baud rate generic CLK_RATE : Natural := 50_000_000; generic BAUD_RATE : Natural := 19_200; generic BIT_TIMER_WIDTH : Natural := 12;. constant BIT_TIMER_COUNT : Natural := CLK_RATE/BAUD_RATE; signal BIT_TIMER : unsigned(BIT_TIMER_WIDTH-1 downto 0); Use the constant BIT_TIMER_COUNT in the design of your counter to determine when to return to 0 –Changes in generics will automatically result in changes to the counter

BYU ECEn 320 Shift Register FSM Shift Register Bit Timer 8 data_in tx_out clk rst clrTimer tx_bit shift clk rst clk rst tx_busy send_character load Transmit Out shift_out stop start

BYU ECEn 320 Shift Register A shift register is used to load the “parallel” data from the switches and “shift” the data out on the serial port –The “LSB” of the shift register drives the “shift_out” signal load: The shift register should load all data from the switches shift: The shift register should shift right

BYU ECEn 320 Transmit Out FSM Shift Register Bit Timer 8 data_in tx_out clk rst clrTimer tx_bit shift clk rst clk rst tx_busy send_character load Transmit Out shift_out stop start

BYU ECEn 320 Transmit Out Additional logic is needed to make sure the TX signal is valid and clean –Outputs a ‘0’ when start is high –Outputs a ‘1’ when stop is high –Outputs selected data bit from shift_out otherwise This signal should be registered in a flip-flop to prevent glitches before leaving the chip –The Flip-Flop will remove any transient glitches.

BYU ECEn 320 Transmitter FSM FSM Shift Register Bit Timer 8 data_in tx_out clk rst clrTimer tx_bit shift clk rst clk rst tx_busy send_character load Transmit Out shift_out stop start

BYU ECEn 320 Transmitter FSM Controls the operation of all elements in the transmitter –Controls clearing of Bit timer –Controls loading and shifting of shift register –Controls transmit out (start bit, stop bit, or shift bit) Inputs: –send_character:Control signal to initiate transfer –tx_bit:Indicates the end of a bit time Outputs: –tx_busy:Transmitter is busy (middle of transmit) –clrTimer:Clear the bit timer –load:Load switch data into shift register –shift:Shift shift register –stop:Send a stop bit –start:Send a start bit

BYU ECEn 320 Transmitter State Diagram (Transitions) STRT RETRN send_character tx_bit send_character tx_bit IDLE send_character STP tx_bit rst B0 tx_bit B1 tx_bit B2 tx_bit B3 tx_bit B4 tx_bit B5 tx_bit B6 tx_bit B7 tx_bit See following two pages for a description of the states and the state machine outputs

BYU ECEn 320 Transmitter FSM States IDLE:Waiting for signal to start transmit STRT:Issue start bit B0-B7:Send a bit (B0 = send bit 0, etc.) STP:Send stop bit RETRN:Wait for “send_character” to clear

BYU ECEn 320 Transmitter FSM Outputs tx_busy: –true when not in IDLE state load: –Occurs on transition from IDLE state to STRT state –STATE = IDLE and (send_character = ‘1’) shift: –Occurs on each transition between B x and B x+1 –tx_bit = ‘1’ and (STATE = B0 or STATE = B1... or STATE = B7) stop: –True when in STP, RETRN, and IDLE state –Transmitter must drive a ‘1’ when IDLE (i.e. a STOP bit) start: –True in STRT state clrTimer: –True in IDLE state (the counter is free running otherwise)

BYU ECEn 320 Signal Debouncing

BYU ECEn 320 Signal Bouncing The buttons will “bounce” many times each time the button is pressed –Pressing the button generates a very noisy analog signal –The corresponding digital signal will transition many times until the button settles Additional circuitry must be added to “debounce” the button –If this bounce is not removed, one press of the “send character” button will result in many distinct send character signals –You will see many characters send to the PC You must add a debouncing circuit to this signal

BYU ECEn 320 Button Debounce Circuit Debounce Logic A digital equivalent of a low pass filter switch settle time button settle time is typically around 10 msec button input output

BYU ECEn 320 Debounce Circuit T sample > T settle D Q bouncydebounc ed en Timer/Clock Divider T settle T sample bouncy debounced clk en_sample

BYU ECEn 320 Debounce Circuit You can create a debouncer by “sampling” the input signal infrequently (~10 ms?) –Create a counter to measure the delay time –Sample the input signal every time the counter rolls over You should make the delay parameterizable (with generics) so you can adjust the debounce time