ECEN 248 Lab 6: De-Bouncing, Counters & LCD Display Control Dept. of Electrical and Computer...
-
Upload
primrose-washington -
Category
Documents
-
view
220 -
download
0
Transcript of ECEN 248 Lab 6: De-Bouncing, Counters & LCD Display Control Dept. of Electrical and Computer...
ECEN 248ECEN 248
Lab 6: De-Bouncing, Lab 6: De-Bouncing, Counters & LCD Display Counters & LCD Display
ControlControl
Dept. of Electrical and Dept. of Electrical and Computer EngineeringComputer Engineering
Lab 6 in BriefLab 6 in Brief
Design an eight bit counterDesign an eight bit counter Bouncing counterBouncing counter De-bouncing counterDe-bouncing counter
Learn about configuring the LCD displayLearn about configuring the LCD display
Sequential Logic
We are only handling the combinational logic circuits in the previous labs
Starting from Lab 5, we will deal with the sequential logic circuits
In sequential logic circuits, the output will depend on not only the current input, but also the previous inputs.
Always driven by clock pulses
Counter
Using sequential logic to count clock events
Push Buttons
A push button is a mechanical switch and rely on mechanical contact to generate an electrical pulses
Switch Bouncing
Push Release
When you push the button, it will not instantly give a 0 (or a 1 when inverted); instead, the voltage will fluctuate in a middle region at first. Voltages in the middle region are still interpreted (quantized) as 1’s and 0’s, so the output will “bounce” between 0 and 1 until the value settles. That means even you only push the button once, there will be multiple rising edges generated.
De-Bouncing Need to get rid of the bounces and get the
“clean” signal Two methods
RS latch based debouncing Needs two buttons
Sampling based de-bouncing One button
Method 1: SR Latch• Use the SR latch to clean the
bouncing signal
S
R
Q
Bounci ng
De-bounced
Method 2: Sampling based debouncing
always @ (posedge clock)if (reset) begin new <= noisy; clean <= noisy; count <= 0; endelse if (noisy != new) begin new <= noisy; count <= 0; endelse if (count == 500000) clean <= new;else count <= count+1;
LCD DisplayLCD Display•Two Verilog modules
•lcd_disp•Given in the zip file for lab 5•You can reuse this module
•Lcd_int •You need to design a specific lcd_int module for each lab•Determine data display location in LCD •One characters 8bit (check decoder chart Fig. 6.9)•Outputs 32 eight-bit sequences for 32 characters in LCD
Lab 6 To-Do listLab 6 To-Do list Design 1Design 1
Configure LCD displayConfigure LCD display Design 2Design 2
Design a non-debounced counterDesign a non-debounced counter Design 3Design 3
Design a count-up counter and a count-down Design a count-up counter and a count-down counter using non-debounced signalcounter using non-debounced signal
Design 4Design 4 Design a SR-latch based debounced up-counterDesign a SR-latch based debounced up-counter
Design 5Design 5 Design a sampling-based debounced up-counterDesign a sampling-based debounced up-counter
TodayToday Work on Lab 6Work on Lab 6
2 Weeks later2 Weeks later Lab 6 Post-Lab dueLab 6 Post-Lab due Lab 7 Pre-Lab due at the beginning of classLab 7 Pre-Lab due at the beginning of class
DeadlinesDeadlines