Computers and modern gadgets

Despite the widespread use of modern color displays, there are a large number of devices in which the use of black and white LCD indicators remains in high demand. For such applications, it is usually the most important to obtain low consumption and low cost. This article assesses the prospects of sharing LCD indicators And STM8L microcontrollers production with an integrated LCD controller to create low-power and low-cost devices.

Modern electronics has a huge number of means of displaying information: from elementary LEDs to complex TFT panels. It would seem that the time of monochrome LCD indicators (LCD) is a thing of the past, but this is far from being the case. There are a large number of applications in which LCDs remain in demand. Microcontrollers of the low-power STM8L family with an integrated LCD driver (LCD module) allow you to realize all the advantages of this type of display.

Areas of application for black and white LCD displays

In order to understand why black-and-white LCDs hold their positions, it is necessary to emphasize their main competitive advantages: low power consumption, low cost, high visibility.

Black and white LCDs using reflected light have minimal power consumption. In fact, this consumption is determined only by dynamic losses during the recharging of the capacitance of the LC cells. The lower the frequency of the screen, the lower the consumption.

The issue of low cost may not be so obvious at first glance. But if you mean standard LCDs without an integrated controller or custom displays produced in large quantities, then the cost of the screen will be very low (less than $ 1).

High visibility should be understood as follows: in specialized and custom-made LCD displays, the display segments are made in the form of graphic images. Screens of tonometers can become a striking example. In addition to numbers, it will contain specialized icons (“heart” as an indicator of heart rate measurement mode, battery charge indicator, inscriptions). Such images are intuitive to the user, and this is very important. Obviously, the creation of similar LED indicators is possible, but difficult due to a number of technological reasons.

It is not difficult to identify those applications in which the positions of black and white LCD displays remain quite confident.

  • Portable medical devices (glucometers, blood pressure monitors, thermometers, etc.). These are battery-powered devices, for which the power consumption factor is extremely important. For example, for a person with diabetes, the glucometer should have a minimum battery consumption in order to be always ready, especially during long trips. An important factor is the visibility of the display of instrument readings, since the users are mainly elderly people.
  • Alarm systems and household measuring instruments (gas meters, electricity and water consumption meters). These devices are battery powered and should work for a long time without changing the battery.
  • Household appliances (washing machines, refrigerators, microwave ovens, coffee machines, watches, etc.). These devices require low consumption and, at the same time, low cost indicators.
  • Industry. LCD indicators are ideal for portable measuring instruments (multimeters, impedance meters).
  • Automotive applications. Common devices that use LCD displays include car clocks, radios, battery charging indicators, etc.

It is important to understand that not only the LCD display determines the cost and economy of the final product. To control the LCD display, a special controller and a control microcontroller are required. If they are chosen poorly, then all the advantages of the LCD will not matter.

This article is devoted to the joint use of STM8L microcontrollers and LCD indicators. Why STM8L? These controllers have an integrated LCD controller (LCD module), very low consumption and cost. That is, precisely those qualities that help to further emphasize the advantages of the LCD. In addition, using STM8L, we get a powerful processor with advanced peripherals, access to debugging tools in the form of ready-made evaluation kits and free software.

However, in order to draw conclusions about the prospects for joint use, it is necessary to sequentially consider the characteristics of the LCD, the features of STM8L microcontrollers with an integrated LCD controller, and the features of the LCD controller itself.

General characteristics of the operation of LCD indicators

Consider the structure of a monochrome LC cell using the example of TN (Twisted Nematic) (Figure 1). A layer of "liquid crystals" is located between two glass bases. Transparent electrodes and polarizing layers (polarizing filters) are deposited on these bases. The rear glass base has a mirror finish.

Guides are formed on the glass surface, which align the LC molecules parallel to the glass surface. Spatially, the molecules are twisted into a spiral (Figure 2).

Polarizing filters are located on the outer side of the bases. The polarization directions of the upper and lower filters are perpendicular. Obviously, if there were no LC molecules, the screen would appear black.

In the absence of an external electric field, the cell remains transparent (Figure 2a). Indeed, unpolarized light, passing through the upper polarizer, turns out to be polarized (for example, along the X axis). Moving in a spiral of LC molecules, due to reflections, light changes the direction of polarization by 90 degrees. Therefore, it passes through the lower polarizer without absorption.

Table 1. Characteristics of STM8L microcontrollers with LCD module

Name Frame Operating frequency (max), MHz Flash, kByte RAM, KB EEPROM, bytes 12-bit ADC, number of channels 12-bit DAC Interfaces Upit, V Ipotr (RUN mode), µA/MHz LCD
LQFP48 16 32 2 256 25 SPI I2C; USART (IrDA, ISO 7816) 1,8…3,6 180 4×28
LQFP64 64 4 256 28 200 4×28/8×24
LQFP 48 UFQFPN 48 16 2 1024 25 1 1,65…3,6 195 4×28
LQFP 48 UFQFPN 48 32 2 1024 25 1 180 4×28
LQFP 48 UFQFPN 48 64 4 2048 28 2 200 4×32/8×28
LQFP 32 UFQFPN 32 16 2 1024 21 1 180 4×17
LQFP 32 UFQFPN 32 32 2 1024 21 1 180 4×17
LQFP80 64 4 2048 28 2 200 4×44/8×40
LQFP64 32 2 1024 28 2 200 4×40/8×36
LQFP64 64 4 2048 28 2 200 4×40/8×36
LQFP80 64 4 2048 28 2 200 4×44/8×40
LQFP64 64 4 2048 28 2 200 4×44/8×40

Table 2. LCD controllers in STM8L microcontrollers of various degrees of integration

Name Number of pixels Multiplexing modes (duty) Bias Modes RAM
4×28 static;
1/2; 1/3; 1/4
1/2; 1/3 up to 14 x 8-bit
4×28
4×28
4×28
4×28
4×17
4×17
4×28/8×24 static;
1/2; 1/3; 1/4; 1/8
1/2; 1/3; 1/4 up to 18 x 8-bit
4×32/8×28 static;
1/2; 1/3; 1/4; 1/8
1/2; 1/3; 1/4 up to 22 x 8-bit
4×44/8×40
4×40/8×36
4×40/8×36
4×44/8×40
4×44/8×40

If an external electric field is applied to such a cell using applied electrodes, then the crystal molecules will begin to orient themselves along the field, and the helical structure will be broken. As a result, light will pass through the layer of LC molecules without changing the direction of polarization and will be absorbed by the lower polarization filter (Figure 2b). The cell will appear dark.

An important indicator of the LCD screen is the contrast, which is determined by the difference in the degree of transparency between light and dark cells.

It is not difficult to guess that the degree of transparency of the cell varies depending on the magnitude of the applied field (voltage). Accordingly, transparency can be controlled by PWM of the applied voltage or by changing the signal amplitude.

There is another important feature. When a constant voltage is applied, the structure of the crystals degrades. Therefore, it is necessary to form control signals in such a way as to avoid the constant voltage component. A DC offset value greater than 100 mV is not allowed.

To determine at what frequency it is worth making a polarity change, consider the equivalent electrical circuit of an LCD cell (Figure 3). It is a serial R-C chain. The resistance R limits the capacitance recharge rate and, accordingly, the maximum frequency of the control signal. If the signal amplitude is increased, the recharge rate will increase and, as a result, the frequency can be increased.

On the other hand, it can be seen that such a scheme implies only dynamic power consumption. Accordingly, the higher the operating frequency, the higher the consumption.

Having dealt with the features of individual cells, we will consider the features of controlling LCD displays consisting of many cells.

There are several varieties of LCD displays that differ in the type of connection of the control electrodes. In the simplest case, each segment is connected to a common (COM) and individual (SEG) control electrodes. Such a scheme is called static without multiplexing. It is simple to control, but has one drawback - the number of control outputs is large and equal to (N + 1), where N is the number of cells.

To reduce the number of pins, various matrix connection schemes are used. So for a circuit with two common COM pins, only (N / 2) + 2 control lines will be required (Figure 4). However, the shape of the control signals will become more complex as the degree of multiplexing increases (1/2, 1/3, 1/4, 1/8).

In this example (Figure 4), segments S00 and S11 will be dark, and segments S01 and S10 will be transparent.

Analysis of control signals shows that there are several features:

  • an alternating voltage is applied to all segments without a constant component;
  • the signal period is divided into parts. The first part of the period (odd frame) for the COM pins is characterized by an active low voltage level, and for SEGn it is high. During the second half-cycle (even frame) - vice versa;
  • the signals have different voltage levels (different offsets). This example uses a 1/2 bias with three voltage levels VLCD, VLCD/2, VSS.

The conclusion of this section is the requirements for the LCD controller. It must form the necessary time intervals (including for LCDs with several COM lines), generate the necessary voltage levels, and have the required number of control outputs. All these requirements are met by the integrated STM8L LCD microcontroller module.

Brief overview of STM8L microcontrollers with built-in LCD controller

The low-power STM8L family includes four lines of microcontrollers with an LCD controller (LCD module) (Figure 5, Table 1). In the STM8L05 line, at the moment, the LCD module is present only in the STM8L052C6 and STM8L052R8 controllers (table 1).

STM8L152x line- This is the very first line of the STM8L family. It has high performance and rich peripherals:

  • 12-bit ADC 1 Msps up to 28 channels;
  • two 12-bit DACs with output buffer;
  • LCD controller module;
  • DMA on four channels for DAC, ADC, SPI, I2C, USART, timers, one channel for transfer from memory to memory;
  • two low power comparators;
  • three 16-bit dual-channel timers with a quadrature encoder;
  • one 16-bit timer with complementary outputs for motor control;
  • one 8-bit timer with 7-bit frequency divider;
  • one independent watchdog timer (IWDT);
  • generation unit for external sound devices (for example, piezoelectric elements) at 1.2 and 4 kHz;
  • many communication interfaces: SPI, I2C, USART;
  • up to 67 general purpose I/Os;
  • up to 16 channels for connecting touch buttons;
  • 96-bit unique number.

STM8L162x- a productive line that has an integrated AES cryptography unit that allows you to encrypt and decrypt data using the AES algorithm.

STM8L052x "Value Line" is a budget version of the STM8L. This range is intended for applications where price and power consumption are a determining factor. The composition of the periphery and the amount of memory is reduced relative to the above lines. However, FLASH up to 64 Kbytes and RAM up to 2 Kbytes make it possible to implement quite complex programs.

One of the main features of the presented lines is low consumption and the presence of an integrated LCD module.

Features of the integrated LCD controller

To clarify, it is worth noting that there are several varieties of LCD modules for STM8L microcontrollers of varying degrees of integration (Table 2).

Table 2 shows that LCD controllers of STM8L152xx/STM8L162xx microcontrollers with a high degree of integration have the most advanced capabilities. Consider their structure in more detail (Figure 6). It contains three main blocks: a clock generator, LCD drivers, a contrast control unit.

Clock pulse generator. As the name implies, the main task of this block is the formation of clock pulses. The input signal for the generator is a clock pulse, the frequency of which is equal to the frequency of the real time clock (RTC) divided by 2, and must be within the range of 16.384…500 kHz. Two dividers are used to obtain lower frequencies. 16-bit divider with a division factor of 1...65535 and, if smooth adjustment is required, an additional divider (the division factor is 16...31).

Table 3. STM8L Low Power Modes

* - Current consumption is given for STM8L052x in the case of disabled peripherals and a program executed from FLASH, unless otherwise indicated.

The received clock signal fLCD determines the fundamental frequency of frames, taking into account the degree of multiplexing (duty): fLCD = fLCD x duty. As noted above, it makes sense to choose a frequency from the range of 30...100 Hz. At a higher frequency, the consumption will be significant, and the image quality will remain unchanged.

The LCD module makes it possible to organize hardware blinking; for this, the generator has a special block for forming the blinking frequency of 0.5 Hz, 1 Hz, 2 Hz, 4 Hz.

LCD drivers. Two LCD drivers are used to create the COMn and SEGn signals. The block contains the timing circuits necessary to form the required time intervals.

In addition, the block incorporates an integrated RAM, which stores information about which of the pixels should be active.

Contrast control unit. This block plays a key role. It manages the contrast by finding a compromise between power consumption and the value of the contrast itself.

As mentioned above, the contrast depends on the supply voltage of the VLCD. This voltage can be generated either by an integrated converter or by an external source. When using an integrated converter, it is possible to programmatically adjust the VLCD voltage value. For microcontrollers with an average degree of integration (table 2), the adjustment range is 2.6 ... 3.3 V. For microcontrollers with a higher degree of integration, the range is 2.6 ... 3.5 V.

It is possible to adjust the contrast using the hardware formation of "dead time" in the control signals. During the dead time, the COMn and SEGn signals are pulled to ground, and the consumption in this case is minimal.

Another task of the block is the formation of voltage levels of control signals. So, for example, in the mode with a shift of 1/4, it is necessary to generate signals of five voltage levels: 0, VLCD /4, VLCD /2, VLCD /4 and VLCD.

To solve this problem, two resistive dividers are implemented (Figure 7). One of them, low-resistance, is used to increase the switching speed when recharging the capacitance of the LCD cell. Once the switchover has taken place, this divider can be disabled to reduce consumption. The second divider remains on - high-resistance, it maintains the voltage level during the rest of the pulse phase.

From a circuit point of view, the internal converter is ideal for use, as it has a lot of control capabilities, while it requires only one external capacitor.

As a conclusion to this section, we will name the advantages and features of the integrated LCD module in STM8L:

  • The module is capable of driving LCDs with a large number of pixels, with different levels of multiplexing and different levels of offsets (Table 2).
  • The LCD controller has an integrated RAM for display pixels.
  • The integrated converter allows you to generate all the necessary voltage levels and programmatically regulate the VLCD supply voltage, requiring only one external capacitor.
  • Ability to use the hardware effect of flashing with a frequency of 0.5 Hz, 1 Hz, 2 Hz, 4 Hz.

Considering the features of STM8L and LCD, you can evaluate the benefits of their combined use in terms of reducing power consumption.

Optimizing power consumption when using STM8L and LCD together

If the price and the integrated controller are the undeniable advantages of the STM8L + LCD system, then the issue of consumption needs to be considered more carefully. To do this, we will determine the main ways to reduce power consumption.

Rice. 7. Formation of voltage levels
driver output signals

Optimization of LCD consumption. As described above, the main LCD is the dynamic power consumption. You can reduce it in several ways. First, reduce the pixel refresh rate. In this case, the lower threshold will be about 30 Hz. As the frequency decreases further, flickering will be noticeable. Secondly, if the LCD parameters allow, then you can reduce the supply voltage.

The integrated LCD module gives you more flexibility in power management by adding more ways to reduce power. Firstly, the LCD controller allows you to programmatically control the voltage value. Secondly, it becomes possible to use "dead time" in the phases of control signals. Thirdly, the controller controls the use time of the resistive master dividers (Figure 4). By reducing the time of use of the low-resistance divider, the consumption can be reduced.

Once again, it should be emphasized that, unfortunately, the listed methods have disadvantages - they lead to a decrease in contrast or make flickering noticeable. Therefore, it makes sense to talk not about a simple reduction in consumption, but about finding a compromise between the power consumption and the comfort of the indication for the user.

An extremely important advantage of the integrated LCD module is its full compatibility with STM8L low power modes (Table 3). Since the LCD module is clocked by the same signal as the real time clock, LCD control is possible in all modes except HALT mode.

STM8L Power Consumption Optimization. STM8L microcontrollers can dynamically change the amount of power consumption and achieve ultra-low consumption through the use of their features:

  • the flexible power supply system incorporates two voltage regulators and can operate at supply voltages up to 1.65 V (1.8 V for STM8L052x);
  • A flexible clocking system allows using a wide range of clock signal sources, performing frequency division, and individually clocking integrated peripherals. At the right time, the microcontroller can increase its own frequency to solve a problem, and then reduce it to an acceptable minimum;
  • there are low consumption modes.

In addition to low consumption, devices based on a combination of LCD + STM8L have the prospect of rapid development. This is possible due to the availability of evaluation kits and free software, traditional for microcontrollers manufactured by ST Microelectronics.

Evaluation kits and software for STM8L

In order to quickly master the STM8L, you can use the evaluation kits manufactured by ST Microelectronics. There are a lot of them: STM8L-Discovery, STM8L1526-EVAL, STM8L1528-EVAL, STM8L15LPBOARD, STM8L101-EVAL. Their main feature is that they all include an LCD display and a set of free software. The kits differ in the type of microcontroller, the installed external peripherals and the type of LCD display.

The STM8L-Discovery evaluation kit (Figure 8) is perfect for both getting acquainted with STM8L and mastering work in conjunction with STM8L + LCD.

The STM8L-Discovery kit is USB powered and has the following features:

  • microcontroller STM8L152C6T6 (32 KB FLASH, 2 KB RAM, 1 KB EEPROM, 48-pin LQFP package);
  • built-in ST-LINK USB debugger;
  • custom LEDs and buttons;
  • consumption current measurement circuit;
  • all 48 controller legs are brought to contact pads;
  • SPI LCD display (122×32 pixels) with built-in controller;
  • alphanumeric character-synthesizing LCD display (24×4 segments).

LCD features:

  • 24×4 segments;
  • control method: multiplexing 1/4, offset 1/3;
  • supply voltage: 3 V;
  • operating temperature: 0…50°C.

Each kit comes with free stsw-stm8008 software. This software set contains two folders.

In the Library folder is STM8L Peripheral Standard Library, which contains header files (for example, stm8l15x_lcd.h - the header file for the LCD module) and implementation files (for example, stm8l15x_lcd.c) for each integrated peripheral unit. It allows you to work with peripherals without the need for thorough familiarization with the control registers.

So, instead of remembering which bits to set in the registers to initialize the LCD controller, it will be enough to use the LCD_Init function (stm8l15x_lcd.c), filling in all the required fields:

LCD_Prescaler_TypeDef LCD_Prescaler, //divide input frequency by 16-bit divider

LCD_Divider_TypeDef LCD_Divider, //dividing the input frequency by an additional divider

LCD_Duty_TypeDef LCD_Duty, //define frame duration

LCD_Bias_TypeDef LCD_Bias, //offset definition

LCD_VoltageSource_TypeDef LCD_VoltageSource //Voltage source selection.

Valid parameter values ​​are described in stm8l15x_lcd.h. For example, the duration of a frame is specified using the LCD_Duty_TypeDef enum:

LCD_Duty_Static = (uint8_t)0x00, /*!< Static duty */

LCD_Duty_1_2 = (uint8_t)0x02, /*!<1/2 duty */

LCD_Duty_1_3 = (uint8_t)0x04, /*!<1/3 duty */

LCD_Duty_1_4 = (uint8_t)0x06, /*!<1/4 duty */

LCD_Duty_1_8 = (uint8_t)0x20 /*!<1/8 duty */

LCD_Duty_TypeDef;

Working with this library greatly simplifies the development of your own software.

The Project Project_template folder contains a template for creating projects based on STM8L in the EWSTM8 and STVD environments.

Sample projects are located in the same place - in the Project folder. Two projects are presented: Discovery and WavesGenerator. The purpose of these examples is to show the capabilities of the STM8L board itself. However, the header files describing the platform (inc folder) - stm8l_discovery_lcd.h, stm8l-discovery.h, discover_board.h, as well as their corresponding C-implementations (src folder) can also be useful in your own applications.

Conclusion

STM8L microcontrollers have the widest possibilities for optimizing the power consumption / performance ratio, while having a rich set of peripherals and maintaining a low cost.

The integrated LCD module is capable of driving LCDs with up to 320 pixels using eight common lines. The built-in voltage converter requires only one external capacitor.

The combination of LCD displays and STM8L microcontrollers with an integrated LCD module is promising in creating low-budget, low-power devices with a very friendly interface, thanks to the ability to use ready-made evaluation kits and free proprietary software from ST Microelectronics, it will take little time to develop such devices.

Literature

  1. RM0031. Reference manual STM8L05xx, STM8L15xx, STM8L162x, STM8AL31xx and STM8AL3Lxx microcontroller family. Rev 10. ST Microelectronics, 2012.
  2. AN3114. application note. How to use the STM8AL3Lxx, STM8L152xx and STM8L162xx LCD controllers. Rev 3. ST Microelectronics, 2012.
  3. UM0684. User manual STM8L1526-EVAL evaluation board. Rev 1. ST Microelectronics, 2010.
  4. UM1037. User manual STM8L1528-EVAL evaluation board. Rev 1. ST Microelectronics, 2010.
  5. UM0970. User Manual STM8L-DISCOVERY. Rev 2. ST Microelectronics, 2011.
  6. Documentation for microcontrollers and software.

STMicroelectronics has launched a new line of low-power microcontrollers STM8L05x "Value Line" on the market. The main distinguishing feature of the line compared to older representatives is the ratio of price and functionality. The low cost STM8L051F3P6 microcontroller for less than $0.5 provides the developer with 16 MIPS processing power (16 MHz) and a complete set of peripherals - from a 12-bit ADC (10 lines) to a four-channel DMA for easy interaction with SPI, I2C and USART serial interfaces or for fast access to the ADC at speeds up to 1 Msps.

The computing power of the microcontroller is enough to solve a variety of tasks - the instruction set includes 8-bit multiplication and 16-bit division, and a common linear address space simplifies writing "fast" code. The current consumption in stop mode with the real time clock running is 1.3 µA or less; when operating at a low clock frequency - 5.1 μA; at the maximum clock frequency of 16 MHz, the core consumes less than 5 mA (the code is executed from Flash memory with the peripherals turned off). An additional node (PVD) controls the power supply and informs the main program about the decrease in battery voltage to a predetermined threshold (seven levels 1.85 ... 3.05 V). The periphery of the STM8L051F3P6 microcontroller has almost the same structure as that of the STM32 line, which greatly facilitates the subsequent transition to the 32-bit family of microcontrollers.

Features of STM8L05x "Value Line":

  • External quartz from 1…16 MHz; 32 kHz;
  • Up to 64 KB Flash, up to 1 KB RAM, 256 bytes EEPROM;
  • 5 low power modes, 400nA in STANDBY mode;
  • Built-in 16 MHz and 38 kHz oscillators;
  • Calendar (RTC) accurate to ± 0.5 ppm;
  • Timers 2×16-bit + 1×8-bit; quadrature encoder.

Once I got the idea to connect an external LCD display from a mobile phone Motorola V-180 to the microcontroller. I did not find ready-made libraries for working with it on the network. But it is very good to have such a display in your arsenal for circuit development. It was decided to write them myself, since there is already some experience in this direction. This experience is. The entire library is sharpened to work in AVR Studio 6- recently switched to it.

In general, the impressions are different. Writing there is a little harder than codevision, but the code turns out to be more compact in terms of the amount of memory occupied. The main thing here is to understand what you need to take from where, well, you have to work more closely with the datasheet. Who needs libraries codevision, he can turn to the forum. At the moment, it has not been completed yet - you need to add a line output function.

Let's get back to the display. It can be purchased, or plucked from the phone in the form of a cable with two displays. For now, put the color aside. Perhaps we will return to it later. We are interested in an external monochrome screen with a distribution of 32 by 96 pixels. Unfortunately, there is no built-in backlight. The pinout of the display outputs can be seen in the diagram.

The capacitor is on the cable, its capacity is 1 microfarad.

The CS pin is connected to 0. It is responsible for turning on the display controller. In theory, you can control multiple displays in parallel, just connect the CS pin to separate MK legs. Depending on the status of the CS output of the display, you can switch between them.

Let's take a look at the library itself. In file MOTOV180.h you can assign a port for work, and port output numbers for the display. You don't need to configure the output pins separately. The library has it all.

  • void MOTOV180_send_byte(int8_t mode, uint8_t d); you can send a byte of data, or a command, to the display.
  • void MOTOV180_init(void); - function to initialize the display.
  • void MOTOV180_clear(void); - function to clear the display.
  • void MOTOV180_gotoxy(int8_t x,int8_t y); - With this function, you can go to the specified coordinate point.
  • void MOTOV180_Putc(uint8_t c); function to output one variable from program memory.
  • void MOTOV180_Print(char* message); - used to output a string.

The timing controller, also known as T-con or matrix controller, is a device independent of commands from the central processor for converting video data transmitted from the main board into signals understandable to the television LCD matrix. As a result of its work, we observe the image we need on the TV screen. Violation of color reproduction, integrity, brilliance and naturalness of the picture, ripples and blurring on the screen may be the result of a defect in this unit.

T-con block diagram

Timing controller includes

  • Processor to process input LVDS data pipelines into independent R, G, B pipelines and clock signals for horizontal and vertical matrix drivers. The processor communicates with RAM and Eeprom ROM. A fixed 5 or 12 volt supply voltage supplied from the motherboard is converted into several secondary voltages required by the controller using DC/DC converters.
  • Reference voltage generator for DAC drivers that provide the necessary curvature of the image histogram. Otherwise, this process is called gamma correction.
  • A voltage generation unit for powering drivers, usually made on a PWM controller and a key field effect transistor.

Diagnostics and repair of T-con

Diagnosing a malfunction in a timing controller can sometimes be extremely difficult. The fact is that the connection of this block with main board and the LCD matrix is ​​so large that it is sometimes not possible to visually determine what is the source of the defect. Only measurements at the T-con control points can indirectly indicate its inoperability. When repairing the matrix controller yourself, you must have a large amount of information that, with a careful and painstaking search, the Internet can provide. The controller itself is considered an integral part of the LCD panel, and manufacturers do not provide wiring diagrams for this unit. This situation makes the telemaster, when repairing this unit, be guided primarily by his professional instinct and experience in such repairs.

If your TV began to show a low-contrast, negative, whitish image with moiré patterns of various shades in the light or dark areas of the picture, it is likely that the matrix controller unit is not working correctly. To exclude the influence of the motherboard and to carry out diagnostics, many manufacturers of LCD matrices provide for the inclusion of T-con in offline mode. In this case, the cable connecting these boards is removed, only the supply voltage is supplied to the controller, and by closing the service contacts, the panel is put into test mode. If the LCD panel and the timing of the controller are in good condition, the self-diagnosis of the panel is observed on the screen in the form of alternating colored fields and stripes, as from a test television signal generator. Each name of the LCD panel has its own method of entering the test mode.

To eliminate the influence of the LCD panel on the matrix controller when measuring the supply voltage of the drivers or the reference voltages for the DAC drivers, a short-term disconnection of the loops, one or two, on the LCD panel is used. By the nature of the change in instrument readings and the visual perception of the image on the screen, certain conclusions can be drawn about the causes of the malfunction. For reliable control of the unit's performance during measurements, it is necessary to control the presence, shape, amplitude, frequency and duty cycle of pulses, which can be carried out using an oscilloscope. The presence of an oscilloscope facilitates the search for a defect and is always used for diagnostics in a stationary service center.

In some cases, it is necessary to doubt the health of the matrix controller in the absence of an image with a dark or very light (white) monitor screen. It is necessary to control the passage of the supply voltage from the main board and the formation of secondary voltages by DC / DC converters in the block itself. Sometimes problems with the timing controller, and even with the matrix itself, can arise due to the fault of the owner who is too careful, wiping the TV screen with a too damp cloth, or, conversely, sloppy, spilling liquid on the LCD panel or inside the device. If moisture gets on the matrix, irreparable consequences can occur in the form of destruction of conductive loops, their corrosion, short circuiting of drivers and failure of the matrix controller due to a critical violation of its operation mode.

Repair of the timing controller is not provided by the manufacturer of LCD matrices, only its replacement. Therefore, technical information on the restoration of the block is not provided and there are no diagrams for it. However, in our workshop we use Rating 4.33 /5 (20 Votes)

And its analogues, for example, such as S6A0069, KS0066, etc. These LCD indicators are textual and can display text and pseudographic symbols. Their familiarity size is 5x8 pixels, LCD indicators come in different sizes and with different resolutions, for example: 8 characters per 2 lines - 8x2, 16x2, 20x2, 40x2, 16x4, 20x4, etc.

In this lesson, we will consider a 4-bit connection of an LCD indicator to an AVR microcontroller, and writing a program in the .

Such LCD indicators have conclusions:
VSS - Gnd (Power Minus)
VDD - Vcc (Plus 5v supply)
VO - Setting the contrast of the LCD matrix
RS - RS control line
RW (Read/Write) – RW control line
E (Enable) - E control line
D0 - Data line D0 (Not used in 4 bit mode)
D1 - Data line D1 (Not used in 4-bit mode)
D2 - Data line D2 (Not used in 4 bit mode)
D3 - Data line D3 (Not used in 4 bit mode)
D4 - Data line D4
D5 - Data line D5
D6 - Data line D6
D7 - Data line D7
A - Display backlight LED anode
K - Cathode of the display backlight LED

Attention! Different LCD indicators have their own pin arrangement, you can find out the exact pin arrangement in the technical documentation (Datasheet) for your LCD indicator.

The LCD indicator pin VO controls the contrast of the LCD matrix depending on the supply voltage applied to this pin. The RW output, if it is not necessary to read information from the display, is connected to the power minus.

An example of a 4-bit connection of an LCD indicator to an Attiny2313 microcontroller:

Trimmer resistor RV1 adjusts the brightness of the LCD display.
In BASCOM-AVR, before the LCD indicator works, you must specify which display pins are connected to which ports of the microcontroller, for this there is a Config Lcdpin command, an example of using this command: Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.3 , Rs = Portb.2 and also specify the resolution of the LCD indicator with the Config Lcd command, example: Config Lcd = 16 * 2 and initialize the LCD indicator with the Initlcd command, after that The LCD indicator will be ready for operation.

Here is a list of commands for working with the LCD indicator in BASCOM-AVR:
configlcdpin– Setting the configuration of the outputs of the LCD indicator and the microcontroller
Config Lcd– Setting the resolution of the LCD display
initlcd– LCD initialization
lcd– Text output on LCD, example: Lcd ”Hello”
Cls– Cleaning the LCD display
Locatey,x– Set cursor to x, y position
lowerline– Move the cursor to the bottom line
upperline- Move cursor to top line
Shift LCD Right– Move the LCD display image to the right by one character
Shift LCD Left– Move the LCD display image to the left by one character
Cursor Off- Disable cursor
Cursor On- Enable cursor
Cursor On Blink– Enable blinking cursor
Cursor On Noblink- Disable blinking cursor

Attention! When using an 8x2 LCD on the BASCOM-AVR, configure it as 16x2 as there is no configuration for an 8x2 LCD on the BASCOM-AVR.

An example program in BASCOM-AVR for the above scheme:

$regfile = "attiny2313.dat" $crystal = 8000000 Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.3 , Rs = Portb .2 Config Lcd = 16 * 2 Initlcd Cls Locate 1 , 1 Lcd "Hello," Lowerline Lcd "world!" End

Here's how it all works with the 8x2 LCD:

Fuse bits for firmware:

You can download files for the lesson (project in , source, firmware) below

If you notice an error, select a piece of text and press Ctrl + Enter
SHARE:
Computers and modern gadgets