Saturday, September 3, 2011

Serial Text LCD

Serial Text LCD module
This project connects a Text LCD display to a microcontroller or PC via a single serial transmission line (plus power).
One of the challenges of integrating a text LCD display is the number of pins to connect. A display module typically has 16 lines, with 11 for data and control. That's a lot of lines for a microprocessor to handle. One way to handle it is to get an I/O expander (I2C or SPI), another way is to use a serial protocol such as a UART. The advantage of have a UART compatible text LCD display module is that it can be controlled with just a single TX line. The downside is using up one of (or your only) microcontroller's UART transmission line, unless you can use software UARTs.

backside
Prototype with serial connections

My requirements included performing a very simple firmware implementation.  I didn't want to spend a lot of effort creating the module.  And I wanted to learn the communications with the LCD module, so limiting to just a text interface was not desired.  I ended up implementing a 6-bit raw protocol, and writing a .NET program to talk to the LCD using 4-bit mode.  I already had some firmware for my 485 monitor that I quickly adapted for use with the LCD.  Bytes are received serially on the RX line, then output to the PORTB, of which 6-bits are wired to the LCD.  After echoing the raw hex back on the TX line (for diagnostics, not necessary for operation), the data byte is strobed with bit 5 cleared to finalize communication with the LCD.  I ended up expanding on the .NET program to have a form where what is typed on the screen is efficiently updated to the LCD screen.

I want to interface with 3.3V microcontrollers, and I want the cost to be low, so I used an available PIC18F26K22 I had received as a sample from Microchip, with the circuit using 5V from USB stepped down to 3.3V with a voltage regulator for the CPU.  The LCD runs at 5V, accepting 3V logic from the CPU.  The latest version of the circuit has an added jumper to select whether the PIC runs at 3.3V or 5V, which in turn determines the I/O voltage levels of the module.  The five port socket includes 5V, 3.3V (output), Ground, TX (output), and RX.  Minimally only 5V, Ground, and TX need to be connected.  This PIC is currently configured to run at its top speed of 64MHz! (This may be overkill for just driving an LCD.)  The LED in the circuit is a heartbeat to show that the PIC is running.

.NET program and hex diagnostics 
Schematic


I plan to immediately use this module with other PIC, Arduino, and Netduino projects.  Writing the .NET program allowed me to more easily learn the LCD protocol than debugging the firmware.  I may expand the firmware to move more of the LCD protocol into the PIC18 firmware, or at least have that option.  Other possibilities are to implement I2C and/or SPI interfaces.

Update: In addition to Windows, I have had success using this module with the mbed, LPCXpresso 1769, chipKIT Max, and Arduino. 

8 comments:

  1. Interesting perspective! Taxation law connects legal theory with practical financial decision-making, making it one of the most relevant areas of study in today's business environment. Taxation Law Assignment Help can help students explore these connections more effectively.

    ReplyDelete
  2. Excellent post! I really enjoyed reading your article and found it both informative and engaging. The explanations are clear, practical, and easy to follow, making this a valuable resource for students. Anyone looking for reliable Python Assignment Help will appreciate content like this that supports learning and strengthens programming skills. Thank you for sharing your knowledge, and I look forward to reading more of your excellent posts!

    ReplyDelete
  3. Excellent point! Strong academic performance is built on careful research, logical reasoning, and clear writing. Write My Assignment can assist students in strengthening these essential skills throughout their educational journey.

    ReplyDelete
  4. Well said! Topics such as income tax, corporate taxation, GST, international taxation, and tax compliance require detailed legal research and analytical thinking. Taxation Law Assignment Help can help students strengthen these essential academic skills.

    ReplyDelete
  5. A 400 Amp electrical panel is a high-capacity power distribution system designed to meet the electrical demands of large homes, commercial buildings, industrial facilities, and properties with heavy power requirements. It provides increased electrical capacity, improved circuit organization, and enhanced safety, making it an ideal solution for properties with electric vehicle (EV) chargers, HVAC systems, workshops, solar power systems, or multiple high-powered appliances. Upgrading to a 400 Amp electrical panel helps ensure a reliable and efficient electrical system while supporting future expansion.
    400 Amp Electrical Panel in Fort Worth, TX
    400 Amp Electrical Panel in Columbus, OH

    ReplyDelete
  6. Well explained! Successful coursework requires careful planning, effective research, and a clear understanding of the subject. Coursework Help can provide academic guidance that helps students approach challenging tasks with confidence.

    ReplyDelete
  7. Looking for affordable academic support without compromising quality? Cheap thesis writing services provide students with expert guidance, well-structured research, and professionally written content tailored to university standards. Experienced writers help with topic selection, literature reviews, methodology, data analysis, and final editing. These services are ideal for students facing tight deadlines or complex research requirements. Every project is completed with attention to detail, originality, and academic integrity. Personalized assistance ensures that your thesis reflects your goals and meets institutional expectations. For reliable support and timely delivery, contact +44 7460080136 and get professional help at a budget-friendly price.

    ReplyDelete
  8. Great insight! Academic writing helps students develop research, critical-thinking, and communication skills that are valuable throughout their education. Assignment Writing Help in Australia can support learners in strengthening these essential abilities.

    ReplyDelete