advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the Code for this Article
Partners & Affiliates
advertisement
advertisement
Average Rating: 4/5 | Rate this item | 1 user has rated this item.
 Print Print
 
Discover a New Frontier for .NET Development: Program an LCD Display
Personal computers aren't the only place where applications can run. As we look toward the future, the possibilities are limitless for creating applications that manipulate other types of displays. Get started with this sample .NET application that controls an LCD display.  

advertisement
ne of the most fascinating aspects of programming is making things work. And that is not limited to just what you can do with your computer; a much more exciting world exists outside of the computer. In this article I will show you how to add a cool and interesting secondary display to your computer. In particular, you will learn how to connect to a LCD display and use .NET to display information on it.


For this article, I will use the 4x20 Serial LCD (model LK204-25; this LCD is manufactured by Matrix Orbital and sold by Parallax) with Keypad Interface from Parallax ($99.95; see Figure 1). LCD displays have been used in a wide variety of electronic devices. The next time you use your credit card at the shopping mall, take a good look at the terminal (see left of Figure 2); you'll almost certainly find that it is LCD. Besides being embedded in electronic devices, LCD screens are increasingly getting the attention of modders, who like to embed them in drive bays and use them to display system information (see right of Figure 2).

Most LCD screens in the market mainly come in two types of interfaces: parallel and serial. Technically, all LCD screens use parallel interfaces. However, due to the complexity of wiring and programming, some manufacturers add circuits to convert the parallel interface into a serial one. The end result is fewer wires to connect and a much simpler way of programming.


Figure 1. Parallax's 4x20 Serial LCD with Keypad Interface is the target device for the examples in this article.
 
Figure 2. LCD screens are used in credit card terminals and drive bays.

For this article, I used the serial version of the LCD with the new SerialPort class available in .NET 2.0. This makes programming an application much simpler and allows me to concentrate on exploring the features of the LCD.

Setting Up the LCD Display
The first step is to connect the LCD display to your PC. In order to do so, you need to perform a TTL-to-RS-232 level shifting so that the data can be read via a serial port. One way is to connect the LCD display to Parallax's RS-232 DCE AppMod (http://www.parallax.com/detail.asp?product_id=29120; $29; see Figure 3).

For this project, however, I chose to use the Javelin Demo Board ($119; see Figure 4) to connect to the LCD display.


Figure 3. The RS-232 DCE AppMod is an economical option to perform the level shift to a serial port.
 
Figure 4. The Javelin Demo Board is shown.

Tip: Either board will work well. The advantage of the Javelin Demo Board is that you can connect a 5-volt DC supply to the board and the LCD display can draw the voltage directly from the board. However, it is the more expensive option. If you are a modder, you can wire up the reader yourself using an RS232 level shifting integrated circuit. Also, check out the Basic Stamp 1 Serial Adapter.

Figure 5 shows the wiring on the back of the LCD display. Be careful not to reverse the connection of the +5V and Ground connectors. The Rx connector allows data/instructions to be sent to the LCD display while the Tx connector allows data to be read from the LCD display. In most cases, you can simply connect only the Rx connector since all you want is to send data to the LCD.


Figure 5. The connections on the back of the LCD display are shown.
 
Figure 6. The Javelin Demo Board connections are shown.

Figure 6 shows the connections on the Javelin Demo Board. Remember to use a straight serial cable to connect your PC to the board. As shown in the figure, line 3 of the serial port is connected to the Rx connector of the LCD. Line 2, which connects to Tx, is optional.

  Next Page: Testing the Connections


Page 1: IntroductionPage 3: Clear the Display
Page 2: Testing the Connections 
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES