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. 🔗 External reference
This post presents the implementation of a free-running counter using the C programming language for the PIC16F84A microcontroller. The code is structured to...
The PIC16F84A microcontroller is a widely used device in various embedded applications, characterized by its 8-bit architecture...
The intention is to utilize this code in future projects involving 7-segment displays. For those interested in learning more about 7-segment displays, additional information can be found in a related post.
7-segment displays are widely used in electronic devices for...
The DAC0832 is depicted in Figure 27-13 as a single-phase circuit connected to the 8086 CPU. The internal 8-bit data input of the DAC0832 must be interfaced with the CPU and the D/A converter interface circuits for data transmission,...
To operate the old Optrex DMC50264N LCD module, a bias voltage of +24V is required. If only low voltage options of 3V to 5V are available, a small DC/DC converter can be constructed, as the LCD module consumes very...
The HS-3182 is a monolithic dielectrically isolated bipolar differential line driver designed to meet the specifications of ARINC 429. This device is intended to be used with a companion chip, the HS-3282 CMOS ARINC Bus Interface Circuit, which provides...
An LCD (liquid crystal display) is an electronically modulated optical device composed of multiple pixels filled with liquid crystals, arranged in front of a light source (backlight) or reflector to generate images in either color or monochrome. The block...
Warning: include(partials/cookie-banner.php): Failed to open stream: Permission denied in /var/www/html/nextgr/view-circuit.php on line 713
Warning: include(): Failed opening 'partials/cookie-banner.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/nextgr/view-circuit.php on line 713