Character LCD Controller Compatibility: ST7066
The interface for Focus LCD’s standard character displays is a 4/8-bit parallel connection used to communicate with the ST7066 controller. The displays are initialized through a sequence of commands defined by the controller’s CGRAM to specify functions and characters. The commands used are a standard set seen in other character LCD IC controllers such as KS0066U, HD44780 and SED1278. The specification sheet for Focus LCD’s character displays lists the controller as “ST7066 or equivalent. This resource will discuss some of the common equivalent controllers to ST7066.
The character LCD drivers embedded in the display are configured by the same method and commands specified in the data sheet of the controller. Each of these driver IC’s communicate through 4/8-bit command and data sequences which can be interfaced with an 8-bit microcontroller. Features such as RAM, character generation, and LCD driving are internally provided by each of these controllers. The microcontroller used to communicate with these controllers can be minimal because the resources are included internally.
The commands and pin functionality are the same between controllers. Voltage ranges are compatible but should be verified for each display. The voltage is specified in ranges for operation voltage and drive voltage. Voltage maximum and minimums should be confirmed when interfacing with an equivalent controller.
The differences between each of the controllers will be minimal but are highlighted in this reference for troubleshooting purposes. These differences should not become an issue for most drop in equivalent controllers but can occur at maximum operating conditions. The errors derive from timing and delay variations and can be avoided with small adjustments to the program sequence.
Below is a review of the specifications of each of the controllers that have compatibility with the ST7066 IC. These are only a few examples of common character LCD controllers that share functionality and pin availability with the ST7066 chip but are not the only compatible drivers.
It can be seen in the specifications that each controller has the same interface, duty cycles, and memory types. The instructions sent to the display will be the same for each controller. There should be no changes in the commands used to communicate with any of the compatible controllers.
Some differences between the devices are in character size, busy flag delay times and acceptable voltage ranges. These differences are often not significant enough to cause issues when using one driver over another. The errors largely occur when operating the device at maximum recommended oscillator frequency.
These error and inconsistencies in display data can be avoided by properly timing signals and ensuring the busy flag has enough time to turn off before sending the next instruction. This can be done by adding delays or lowering oscillator frequencies at certain times in the programming sequence.
Power on Timing
When switching between compatible character ICs, it is important to consider the delay time after reset. An automatic reset occurs on power up. There is a delay to reach a specified voltage threshold and a delay for the system to run the initializing command sequence. During this time, the display sets the busy flag active and no commands can be sent. A brief delay can be added after power up to prevent this error. This will allow enough time for the initialization sequence to complete and set the busy flag low.
The controllers can vary in required delay times from after this initialization begins to when the display can accept commands. The delay after the power on sequence is determined by the input oscillator frequency and the number of clock cycles it takes to complete these commands. It is important to check the datasheet for the individual controller to confirm this delay requirement is met. A delay of 250ms at the start of the programming sequence will be sufficient for all compatible controllers and microcontroller operating frequencies.
Below is a table of the delays specified in the initialization sequence for each of the compatible controllers. During this time, the busy flag will be active, and no commands will be accepted. This can cause issues if commands are sent immediately after powering on the device. Specified delays should be added after power up and before any commands are sent to the device in order to ensure the initialization process has had enough time to complete.
If the power up initialization fails to complete, the initialization commands will need to be sent by the microcontroller to properly initialize the chip. The reset initialization will fail if the power supply conditions and the power on delay requirements are not met as specified in the datasheet of the controller.
Address Counter Increment/Decrement Timing
After execution of read or write operations into RAM, the RAM address counter is incremented or decremented by 1. This changes the position of the cursor and the location in memory in the RAM. If not executed while the busy flag is low, an error in the location of the cursor or memory may occur. The RAM address counter will only be updated after the busy flag turns off.
The time elapsed after the busy flag turns off and the address counter is updated may vary between devices. This is represented as tADD in the figure above. The busy flag status can be read at pin DB7 when RS=0 and RW=1. If the busy flag is returned as 1, it may be necessary to half the frequency of the oscillator before executing the next instruction. If the busy flag is not checked, a delay should be included to ensure the instruction has enough time to execute.
The time after writing or reading RAM data and changing the address counter for each of the controllers is listed in the data sheet of the specified controller. During this time, the busy flag will be active, and no instructions will be accepted.
If the busy flag is active during this period of changing the cursor and the address counter, you will notice that the cursor may be in the wrong position. If you notice that this occurs on your display, you should verify that the address counter increment/decrement timing requirements are met specified by the controller datasheet.
Command Descriptions and Timings
The ST7066 controller and the equivalent drivers mentioned in this resource have 11 commands that can be programmed to specify functionality of the display. These commands are the same for all of the controllers mentioned. There are slight timing differences in the execution of these commands. The command descriptions and controller timings are compared below.
The execution time for each of these commands changes as the microcontroller oscillator frequency changes. With a slower frequency oscillator these command execution times will increase. The command execution timing differences for each of the drivers typically will not cause an issue between devices.
If an instruction is sent while the busy flag is high, the overall time between the first instruction and next instruction will be longer than the initial instruction time by itself. This is why it is important to check to busy flag and meet the minimum time requirements as referenced in the table and datasheets.
Buyers and others who are developing systems that incorporate FocusLCDs products (collectively, “Designers”) understand and agree that Designers remain responsible for using their independent analysis, evaluation and judgment in designing their applications and that Designers have full and exclusive responsibility to assure the safety of Designers' applications and compliance of their applications (and of all FocusLCDs products used in or for Designers’ applications) with all applicable regulations, laws and other applicable requirements.
Designer represents that, with respect to their applications, Designer has all the necessary expertise to create and implement safeguards that:
(1) anticipate dangerous consequences of failures
(2) monitor failures and their consequences, and
(3) lessen the likelihood of failures that might cause harm and take appropriate actions.
Designer agrees that prior to using or distributing any applications that include FocusLCDs products, Designer will thoroughly test such applications and the functionality of such FocusLCDs products as used in such applications.