Home

Advertising Panel

image

Contents

1. The if statement means be in standby mode till DLY RST signal is given when it is given check for commands and data to be executed and process them and wait for them till they are done and repeat steps again As for Icd start it is just used once at the beginning waiting for the LCD to get ready else end end begin case mLCD ST 0 begin end begin end 2 begin end 3 begin end endcase mLCD lt LUT_DATA 7 0 mLCD RS lt LUT_DATA 8 mLCD Start lt 1 mLCD ST lt 1 if mLCD Done begin mLCD Start lt 0 mLCD ST lt 2 end if mDLY lt 18 h3FFFE nDLY lt mDLY l bl else begin mDLY lt 0 mLCD ST lt 3 end if LUT_INDEX lt LUT_SIZE begin nLCD ST lt 0 LUT_INDEX lt LUT_INDEX 1 1 end When the DLY_RST signal is given processing of new commands and data are given in case 0 the next available information is stored in LUT_DATA and the type of the information whether it is command or data is stored in LUT_DATA 8 mLCD_ Start is set to 1 to indicate lcd controller that it can process this information on the next DLY_RST signal as explained before Then we to case 1 in this case we wait till the Icd controller indicates that the information has been sent to LCD and that we can start the timer for information processing In case 2 the timer is started and when it is over it is going to going to next case to grab the next information on the list
2. Input iStart if iStart is 1 that means there is data or a command that needs to be passed executed if iStart is O that either means there is nothing to pass to LCD or there is a previous data or command passed to LCD and still needs time to be executed Input iRST_N this input comes from the reset delay module it comes every 2 09 ms the function of reset delay has been explained Input iRS this input indicates whether the bits in iDATA represents data or command if iRS is then the bits represent command else represent data Outputs LCD DATA LCD RW LCD EN LCD RS All these outputs are sent to the LCD LCD behaves according to the information in these variables Output oDone This output tell the main module Icdlab2 that the command or data has been sent to LCD and the main module should start a timer and wait till the execution of the command or data is printed on the LCD has finished assign LCD DATA iDATA 1 assign LCD RW 1 bO 2 assign LCD RSziRS 3 lines 1 2 and 3 are always set to the values on the right hand of their equal statements LCD RW is always 0 because whether it is data or a command LCD RW should be 0 These instructions are not executed until LCD EN is set to 1 always posedge iCLK or negedge iRST begin if iRST NH begin oDone lt 1 0 LCD EN lt 1 0 prestart lt 1 0 m3tart lt l b0 Cont lt 0 ST lt 0 else b
3. key value so we used clock instead Till now we couldn t know what s wrong with it We used if statements instead of cases in our program and it was interacting in a weird way so we had to change back to the case programming syntax CONCLUSION In this lab we learned how to use advanced DE2 board settings and how the Verilog language interacts with the board through various input and output pin assignments such as keyboard input And we gained insight on how to control LCD panel and clarify some misconception about it how to program in a case style rather than with if statements REFERENCES Loomis John Digital Labs Using the Altera DE2 Board Dr John S Loomis 18 Nov 2009 Web 6 Dec 2011 lt http www johnloomis org digitallab gt Crystalfontz America Inc LCD User Manual Web 1 Dec 2011 lt http www cse yorku ca course 3201 CFAH1602BTMCIJP 1 pdf gt Knowledge Center FPGA CPLD and ASIC from Altera Altera Web 3 Dec 2011 lt http www altera com gt
4. l bl outl5 default LUT_DATA lt 9 hl20 endcase end This is the command and data list that gives the scroll effect other effects are similar in construction with sum differences From case 04 these are commands that are sent to LCD Command at 0 9 h038 represent function set with the following options with data length DL 8 bits number of lines N 2 and font type F 5X11dots Command at 1 9 hO1c it is to set cursor moving and display shift and the direction without changing the DDRAM data it gives the scroll effect The commands from 22 are for clearing the screen and get the cursor back home every time new printing needs to be done As for the represents the column it is going to be printed at As for the rest of the effects it is similar to the above code with the change of command 1 from 9 hO1c to 9 hOOc to prevent scrolling uin case of LINE1 i this represents what s to be printed at the specified line and DIAGRAMS The following is the entire RTL view of the project a U 000000 The following is a detailed view of the RTL starting from top left and ending at bottom right timer_state oneshotipulsert LUT
5. CSE3201 Project Advertising Panel Submitted by Hassan Chehaitli 209003898 Aysar Khalid 209728866 Submitted on Tuesday Dec 20 2011 INTRODUCTION In this project we will design implement and an advertising panel The essence of the ad panel is that it will be LCD powered with the ability to apply live textual effects on the input The input is interpreted from the computer onto the LCD Secondary inputs are used to determine the type of effects to apply onto the text input this is done using SW switches The output will be displayed onto the LCD and using the input from the KEY buttons we will apply the corresponding effects onto the text input The text with the effects applied will then be displayed onto the LCD Effects applied are text scrolling horizontal sliding and text flashing Specifically the two text effects or user options are wired as follows The first option scrolling text effect is available when SW 10 is turned on When SW 10 is turned on we can either make the text scroll traverse horizontally or we can make it stable simply display text normally text scroll when SW 0 is on and stable when SW 0 is off The second option text flashing is when SW 10 is off we can make the text blink by repetitively turning on and off SW 1 OBJECTIVE The purpose of this experiment is to get used and acquainted with the design of combinational circuit and how it interacts with the DE2 board Also how to in
6. _INDEX _OUTOX CLOCK 50 LUT INDEX S 0 always2_OUTO mDLY _OUTO gt mDLY 17 0 mLCD RS mLCD ST mLCD_RS_OUTO mLCD_DATA _OUTO Decoder OUT22 Reset Delay r 0 01 mLCD Start 0 mLCD DATA 7 0 ideOr reset 48 0 UT TRTA 37 29 1 _DATA 17 LUT_DATA 25 LUT DATA 13 LUT DATA 24 MUX21 LCD Controller u ick 188 Selector iRST N 1 istat ips CD Start 1 mLCD Start SELECTOR o po DATA 12 DATA 23 o 1 DATA 11 DATA 22 o LUT_DATA 10 LUT_DATA 21 LUT DATA S 0 mLCD_Start 1 ris LU gt reset_OUTO z clock divider cdiv clock P LUT DATA CD DATA 7 0 Decoder OU DED WideOrt OUTOX wideoo ERREUR mux a DN TI LT var Equal m na t B Equal2 I to dock divider cdiv
7. egin Input Start Detect preStart if preStart iStart z2z bOl begin mStart lt 3 91 lt 1 bO The code above plays an important role to whether LCD_EN should be set 1 when it is set to 1 data or commands are passed to LCD If iRST N comes from reset delay v is 0 then that means the time for sending the new command is not over yet iRST N is important for not overloading LCD with commands every time iRST N is set to 1 that means 2 09 ms has passed Every 2 09 ms iRST_N 1 we check if we have a new command or data to be passed to LCD Whenever 2 09 ms passes it goes in the else statement block it checks if new command is available In order to prevent multiple commands to be sent to LCD we check the previous state of iStart preStart and check if the value has changed from 0 to 1 only then a new command is available If the value changes from 0 to 1 then we will prepare to send the new command to LCD by setting mStart to 1 if mStart begin case 3T 0 ST lt i if Wait Setup E begin LCD EN lt l bl ST lt 2 2 begin if Cont lt CLK Divide Cont lt Cont l bl else ST lt 3 end 3 begin LCD EN lt 1 0 start lt 1 0 lt Cont lt 0 ST 0 end endcase end end end endmodule The code above is for sending the command to LCD when there is new command In case 1 LCD N is set to 1 so
8. ewa S jJ DATA 10 11 _ 21 4 LUT DATA 2O M 0 OU H _OU TS 11 Mux2_OU TE LUT DATA 19 OUTO LUT DATA 18 OUTO r i b 1 LUT DATA 10 LUT md 4 MORES _ 20 ones hot puls 2 Y oneshotpulser2 pulse out Cs H Z ST 000000 P mer state OUTO E UEM z OUTO PmLCD DATA OUTO DR 17 0 The following is the state machine view of the main module Icdlab2 LCD_Controller u0 ST Geen a Cont 4 ImStart Trancitinne DIFFICULTIES The difficulty that faced us is the difference between the Verilog compilers As we wrote the code at home and it compiled with no errors but when compiled on the QUARAS II it gave errors Some difficulties was observed with always statement as it used to execute for no reason when there is no change in
9. o check if there is any command that needs to be executed in order to send to LCD Whenever the counter reaches the value of FFFFF the signal is generated and is sent to lcd controller The clock is executed on posedge thus the counter is incremented by 1 every 1 cycle of the clock 1 cycle Telock 1 frequency so mnz The equivalent time for this counter is FFFFF X 1048575 1 50 000 000 0 0209 2 09 ms Thus every 2 09 ms a signal will be generated in order to make the Icd controller to check if there is any command need to be send and executed on the LCD panel Lcd controller v module LCD Controller y Host Side input 7 0 1 input iRS input iStart output reg oDone ia iCLK iRST LCD Interface oa iik 7 0 LCD output LCD RW output reg LCD EN output LCD RS parameter CLK Divide 16 Internal Register reg 4 0 Cont reg 1 0 ST reg preStart mStart 1177 PPPS SS SS Only write to LCD bypass iR5 to LCD_RS assign LCD iDATA assign LCD RW l b0 assign LCD R iRS This module plays an important role in controlling LCD DATA or COMMANDS are passed to this module and this module waits for the right time to pass data or commands to LCD to be printed or performed it plays a role in preventing data or command flooding to LCD We have input iDATA this input holds data or command to be sent to LCD
10. that the LCD can start processing the command or data saved in LCD DATA and behaviour is determined by the values of LCD RW and LCD RS After LCD EN has been set to 1 in state2 a small waiting time is imposed in state 3 in order to make sure the LCD gets the information from its input values after that LCD EN is disabled since data or command has already been passed and oDone has been set 1 in state 4 and control is passed to the main module Icdlab2 v so that it stops new data or commands from being sent to LCD till command execution time is over we are going to see in details what happens in Icdlab2 module Icdlab2 v this is the main module it has 2 always loops 1 loop is to check if new command or data should be passed to Icd_controller module and wait till the command is finished execution And the other always loop is to choose the required command or data to be sent to Icd_controller 1 always loop always posedge CLOCK 50 or negedge DLY RST or posedge lcd start begin if DLY RST 109 start begin LUT INDEX lt 0 mLCD ST lt 0 nDLY lt 0 mLCD_ Start lt 0 mLCD DATA lt 0 mLCD RS lt 0 else This loop is invoked for 2 reasons 1 with CLOCK 50 the reason for this is that when there is a command or data being process the loop should be keeping track of the elapsed time As for DLY RST we need so that we can check every 2 09 ms if we have a new command or data to be sent to lcd controller
11. to be processed the timer waits for 262142 50000000 0 524 ms In case 3 the pointer of the information is incremented in order to get the next information need to be processed and thus the ou always loop is invoked 2 always loop always posedge CLOCK 50 begin if SW 10 1 begin var 50 0 varl 2 end else begin varl 50 1 var 2 end This section decides which effect to apply to text according to the switches turned off or on If SW 10 is turned on and SW 0 is off it show a stable text if SW 0 is on it shows a scrolling text If SW 10 is off and SW 1 is turned on and off the text will flash on the LCD if var 1 hegin case LUT_INDEX 0 LUT lt 9 038 1 LUT lt 9 101 LUT_DATA lt 9 h011 3 LUT lt 9 1016 4 LUT_DATA lt 9 h080 Er Line 1 LINE1 0 LUT_DATA lt l bl outO LINE1 1 LUT_DATA lt l bl outl LINE1 2 LUT_DATA lt l bl out2 LINE1 3 LUT_DATA lt l bl out3 LINE1 4 LUT_DATA lt l bl out4 LINE1 5 LUT_DATA lt fl bl out5 LINE1 6 LUT_DATA lt fl bl out6 1 7 LUT lt l bl out LINE1 8 LUT_DATA lt 1 bl out8 1 9 LUT lt l bl out9 LINE1 10 LUT_DATA lt 1 bl outl0 LINE1 11 LUT_DATA lt l bl outll LINE1 12 LUT_DATA lt 1l bl outl2 LINE1 13 LUT_DATA lt fl bl outl3 LINE1 14 LUT_DATA lt l bl outl4 LINE1 15 LUT_DATA lt
12. troduce different modules and how they are integrated with each other in a cohesive manner to output the desired result In this case an advertising panel APPARATUS e Computer e DE2 board e USB cable e DE2 board adapter DESIGN In this section we are going to discuss different modules our project is made of and what they do and how they interact together to deliver the required result The main module is Icdlab2 v this main module is made of two modules reset_delay v and Icd controller v and some code written in the main module to synchronize the interaction between the two modules for processing First we will discuss the inner modules and what they do and then we will link all the modules with the written code in order to get the required results reset delay v module Reset Delay input iCLK output reg oRESET reg 19 0 Cont always posedge iCLK begin if Cont 20 hFFFFF begin Cont lt Cont l bl ORESET lt l b0 end else oRESET lt LBL end endmodule This module plays a role as a timer This timer on regular basis checks if there is a command that is ready to be sent to LCD to be executed this module plays an important role to prevent flooding the LCD with commands and thus prevents it from crashing It is made of one input and one output In our case the input iCLK is the 50 MHz clock And the output is oRESET which is generated every constant period of time to make the lcd controller module t

Download Pdf Manuals

image

Related Search

Related Contents

  Palit NEAT6400HD41-1070F NVIDIA GeForce GT 640 2GB graphics card  Brodit ProClip 511539  Supra Manual de Usuario  Sony Ericsson 1102101-BV Cell Phone User Manual  N375581 man cdls impact driver DCF813 Euro.indd  Machining tool  

Copyright © All rights reserved.
Failed to retrieve file