Description: The 040904C version of the code has a larger UART receive buffer and supports two pushbuttons that send either an ASCII "R" ($52) or an ASCII carriage. Something to keep in mind when using AVR controllers that support 16-bit addressing (specifically, the ATTINY2313/AT90S2313 only has an 8-bit stack pointer, while some others have 16-bit stack pointers) found by Rafael A. Alcocer has been taken into account in version ATTINY2313AT90S2313 version 030929A as well as being incorporated into the ATMEGA8515/AT90S8515 version. This code should be able to run on the ATTINY2313 without modifications, as well as the other AVR controllers with appropriate modifications for things such as clock speed and I/O port assignments.
The Truly MTC-C162DPLY-2N-LCD is an inexpensive two-line LCD display and seems to be ideal as a display for some of the projects that have serial data outputs. Before building this interface, a computer was used on the workbench to serve as a terminal or run an RS-232 cable from the desk with the computer on it to the workbench. The backlit version of displays was offered for less than US$6.00.
The Truly display uses the Samsung KS0070B controller, which is reportedly compatible with the Hitachi HD44780 controller. A set of initialization and control routines was written and placed on the web by Richard Hosking, which only required a minor adjustment to get the Truly display working. Mr. Hosking's code was used in the assembler code that was originally posted and is in the ATMega8515 version. Mr. Hosking's code served as a model for the .include file driver that is used in the current AT90S2313 version.
The main minor adjustment was the addition of a second "Function Set" command needed to get the Truly displays to work. Mr. Peter Coppens reported that he had to remove the second "Function Set" operation in the initialization routine in the Truly LCD Include file. This is noted in the include file by labeling the two lines with the comment "(OMIT FOR HITACHI)". The affected code fragment is shown immediately below (some white space removed for better fit).
ldi temp,0b00101000 ;Function set 4 bit mode, 2 lines 5X7 pixels.
rcall SendCommand ;Write to display - first write sets 4 bit mode.
ldi temp,0b00101000 ;Function set 4 bit mode, 2 lines 5X7 pixels (OMIT FOR HITACHI)
rcall SendCommand ;write to display - second write to set N and F (OMIT FOR HITACHI)
With this arrangement, the Truly display has a 4-bit parallel interface. The ATTINY2313/AT90S2313 controller converts incoming serial data to the appropriate 4-bit parallel commands and data. Incoming characters are written to the bottom line of the display, and when a displayable character (that is, a character that is not a control character) is received after a line feed is received, the bottom line is copied to the top line, leaving a blank line on the bottom with the cursor set to the first column of the bottom line.
This delayed implementation of the line feed until after a displayable character is received keeps the display from scrolling at the end of a line until there is something to display on the next line, thus two lines of information are always displayed, even when using it with hardware that automatically sends a carriage return and line feed at the end of each line. This is important when there are only two lines on the display.
It should be noted that the LCD display interface code is copyrighted by Mr. Hoskin, and on his web page, it is advised to use the code for personal use only. The rest of the code is hereby placed in the public domain.
The schematic for this project would include the following key components: the ATTINY2313 microcontroller, the Truly MTC-C162DPLY-2N-LCD display, and pushbuttons for user input. The microcontroller connects to the LCD via a 4-bit data bus, with additional control lines for enabling and command/data selection. The UART interface of the microcontroller is configured to handle incoming serial data, which is processed and sent to the LCD display. The pushbuttons are wired to specific GPIO pins on the microcontroller, configured to trigger interrupts or polling routines that send the respective ASCII characters to the display. The power supply for the circuit should be adequately designed, ensuring that the microcontroller and LCD operate within their specified voltage and current limits. Proper decoupling capacitors should be included near the power pins of the microcontroller and LCD to filter out noise and stabilize the power supply.The 040904C version of the code has a larger UART receive buffer and supports two pushbuttons that send either and ASCII "R" ($52) or an ASCII carriage Something to keep in mind when using AVR controllers that support 16 bit addressing(specifically, the ATTINY2313/AT90S2313 only has an 8 bit stack pointer, while some others have 16 bit stack pointers) found by Rafael A. Alcocer has been taken into account in version ATTINY2313AT90S2313 version 030929A as well as being incorporated into the ATMEGA8515/AT90S8515 version.
This code should be able to run on the ATTINY2313 without modifications, as well as the other AVR controllers with appropriate modifications for things such as clock speed and I/O port assignments. The Truly MTC-C162DPLY-2N-LCD is an inexpensive two line LCD display and seems to be ideal as a display for some of my projects that have serial data outputs. Before building this interface, I used to either have a computer on the workbench to serve as a terminal or run an RS-232 cable from the desk with the computer on it to the workbench.
When I saw the backlit version of displays being offered for less than US$6.00, I thought "Why not?". The Truly display uses the Samsung KS0070B controller, which is (reportedly) compatible with the Hitachi HD44780 controller.
I found a set of initialization and control routines that were written and placed on the on the web by Richard Hosking which only required a minor adjustment to get the Truly display working. Mr. Hosking's code was used in the assembler code that was originally posted and is in the ATMega8515 version.
Mr. Hosking's code served as a model for the .include file driver that is used in the current AT90S2313 version. The main minor adjustment I mentioned in the paragraph above was the addition of a second "Function Set" command that was needed to get the Truly displays to work.
Mr. Peter Coppens has reported that he had to remove the second "Function Set" operation in the initialization routine in the Truly LCD Include file. This is noted in the include file by labeling the two lines with the comment "(OMIT FOR HITACHI)". the affected code fragment is shown immediately below (Some white space removed for to better fit on this page)..
ldi temp,0b00101000 ;Function set 4 bit mode, 2 lines 5X7 pixels. rcall SendCommand ;Write to display -first write sets 4 bit mode. ldi temp,0b00101000 ;Function set 4 bit mode, 2 lines 5X7 pixels (OMIT FOR HITACHI)
rcall SendCommand ;write to display -second write to set N and F (OMIT FOR HITACHI)
With this arrangement, the Truly display has a 4 bit parallel interface. TheATTINY2313/AT90S2313 controller converts incoming serial data to the appropriate 4 bit parallel commands and data.
Incoming characters are written to the bottom line of the display and when a displayable character, that is a character that is not a control character, is received after a linefeed is received, the bottom line is copied to the top line, leaving a blank line on the bottom with the cursor set to the first column of the bottom line. This delayed implementation of the linefeed until after a displayable character is received keeps the display from scrolling at the end of a line until there is something to display on the next line, thus two lines of information are always displayed, even when using it with hardware that automatically sends a carriage return and linefeed at the end of each line.
This is important when you only have two lines on the display
It should be noted that the LCD display interface code is copyrighted by Mr. Hoskin and on his web page, we are admonished to use the code for personal use only. The rest of the code is hereby placed in the public domain.
An In Circuit Programmer is a very valuable tool. Not only does it allow you to program your AVR's with ease, you can update your program without having to remove the AVR (very useful when working with surface mount devices)....
The LCD display is represented by the connector X1. It has a HD44780 compatible LCD controller and is using the 4-bit interface to send data to the LCD controller. The LEDs are multiplexed. It is possible to connect 12 LEDs...
A light computer has been developed that simulates the scanning effect seen in the KITT car from the TV series Knight Rider. The design utilizes a microcontroller, specifically the PIC16F84A, instead of the commonly used CD4017 counter IC. This choice...
This project utilizes an AVR microcontroller as the first embedded systems project since college. The programming options were C and assembly, with assembly chosen due to familiarity and robust documentation in datasheets. Assembly provides a clear understanding of the operations,...
Blinking an LED is the introductory project for programming microcontrollers. It serves as an effective method to navigate the entire development process and verify the functionality of all tools. This chapter involves connecting a light-emitting diode (LED) to an AVR...
LED displays consist of arrays of Light Emitting Diodes (LEDs) arranged in various shapes to convey specific information. The operation of LED displays is similar to that of standard LEDs, requiring straightforward connections when sufficient microcontroller pins are available. However,...
This article continues from the previous one regarding the single character LCD display using an AVR microcontroller. The prior article demonstrated how to display a single letter on an LCD. This article advances the learning process by explaining how to...
The fundamental design of this project employs an Atmel AT89S8252-24PC Microcontroller, which features 2KB of EEPROM for runtime data storage. An ADC0838CCN analog-to-digital converter will be utilized to process up to eight inputs from sensor devices, including passive infrared sensors...
The article "Creating a Line Follower Robot with AVR" serves as a continuation of a previous piece on line follower robots, focusing on the AVR ATMega8535 and the associated block diagram. In the first part of this series, titled "Creating...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more