[古董贴][求助]为什么我的12864点不亮
我使用12864液晶屏,但是奇怪的问题是,就是点不亮头文件
Display.h
#include <iom16v.h>
#include <macros.h>
char BUSY=1;
char ON_OFF=0;
char RST=1;
void Delay(int m);
void InitDisPlayDevice(void);
void DisplayOn_Off(char D);
void Set_Start_Y(char Start_Y);
void Set_X(char X);
void Set_Y(char Y);
void Write_DDRAM(char Data);
void Read_State(void);
void CS_Choose(char CS);
void InitDisplayDevice(void)
{
PORTA=0b00111110;
DDRA=0xff;
DDRB=0b00001111;
PORTC = 0b00000000;//复位
DDRC = 0b00001100;
Delay(100);
PORTC =0b00000100;
}
void DisplayOn_Off(char D)
{
//显示开关
PORTC |= 0b00001000; //E=1
PORTB &=0b11111100; //R/W=0 D/I=0
PORTA = 0b00111110 | D;
Delay(10);
PORTC &= 0b11110111; //E=0 下降沿送锁存信号
}
void Set_Start_Y(char Start_Y)
{
//设置扫描起始行
PORTC |= 0b00001000; //E=1
PORTB &=0b11111100; //R/W=0 D/I=0
PORTA = 0b11000000 | Start_Y;
Delay(10);
PORTC &= 0b11110111; //E=0 下降沿送锁存信号
}
void Set_X(char X)
{
//设置X
PORTC |= 0b00001000; //E=1
PORTB &= 0b11111100; //R/W=0 D/I=0
if (X<8)
{
CS_Choose(1);
PORTA=0b10111000 | X;
}
else
{
CS_Choose(2);
PORTA = 0b10111000 | (X-8);
}
Delay(10);
PORTC &= 0b11110111; //E=0 下降沿送锁存信号
}
void Set_Y(char Y)
{
//设置Y
PORTC |= 0b00001000; //E=1
PORTB &= 0b11111100; //R/W=0 D/I=0
PORTA = 0b01000000 | Y;
Delay(10);
PORTC &= 0b11110111; //E=0 下降沿送锁存信号
}
void Write_DDRAM(char Data)
{
//向显存送数据
PORTC |= 0b00001000; //E=1
PORTB &= 0b11111100; //R/W=0 D/I=0
PORTA=Data;
Delay(10);
PORTC &= 0b11110111; //E=0 下降沿送锁存信号
}
void CS_Choose(char CS)
{
//选择芯片
if (CS==1)
{
//选择第一芯片CS1=1;CS2=0;
PORTB |= 0b00000100;
PORTB &= 0b11110111;
}
else
{
//选择第二芯片CS1=0;CS2=1;
PORTB |= 0b00001000;
PORTB &= 0b11111011;
}
}
void Read_State(void)
{
//读取系统状态
DDRA = 0x00;
PORTB &= 0b11111100; //R/W=0 D/I=0
PORTB |= 0b00000001; //R/W=1 D/I=0
PORTC |= 0b00001000; //E=1
Delay(100);
BUSY = PINA>>7;
ON_OFF = (PINA<<2)>>7;
RST = (PINA<<3)>>7;
DDRA = 0xff;
}
void Delay(int m)
{
char a=0;
int b=0;
for (b=0;b<m;b++)
{
for (a=0;a<255;a++);
}
}
实例文件:Display.c
#include <iom16v.h>
#include <macros.h>
#include "Display.h"
#define ON 1
#define OFF 0
void main(void)
{
InitDisplayDevice();
while(1)
{
Read_State();
if (BUSY==0)
{
DisplayOn_Off(ON);
Set_Start_Y(0); //设置起始扫描行为第一行
Set_X(8); //设置坐标字节
Set_Y(32);
Write_DDRAM(0xf0);
Set_X(9);
Set_Y(32);
Write_DDRAM(0xf0);
}
}
}
硬件连接方式:
PA数据线DB0-DB7
B0R/W
B1D/I
CS1 B2
CS2 B3
E C3
RST C2 能不能调背光嘛? 资料:
PRODUCT SPECIFICATIONS
PHYSICAL DATA
EXTERNAL DIMENSIONS
BLOCK DIAGRAM
ABSOLUTE MAXIMUM RATINGS
ELECTRICAL CHARACTERISTICS
OPERATING PRINCIPLES METHODS
DISPLAY DATA RAM ADDRESS MAP
ELECTRO-OPTICAL CHARACTERISTICS
INTERFACE PIN CONNECTIONS
PART LIST
RELIABILITY
QUALITY GUARANTEE
INSPECTION CRITERIA
PRECAUTIONS FOR USING LCD MODULES
USING LCD MODULES
PHYSICAL DATA
Item Contents Unit
LCD type STN ---
LCD duty 1/64 ---
LCD bias 1/9 ---
Viewing direction 6 o’clock
Module size (WHT) 78 70 14.5MAX (3.07 2.76 0.57MAX) mm
Viewing area (WH) 62 58 (2.46 2.28) mm
Number of dots 128 64 dots
Dot size (WH) 0.39 0.55 (0.015 0.022) mm
Dot pitch (WH) 0.44 0.60 (0.017 0.024) mm
EXTERNAL DIMENSIONS
BLOCK DIAGRAM
ABSOLUTE MAXIMUM RATINGS ( Ta = 25°C )
Parameter Symbol Min Max Unit
Supply voltage for logic VDD -0.3 7.0 V
Supply voltage for LCD VDD - VO -0.3 VDD+0.3 V
Input voltage VI -0.3 VDD+0.3 V
Operating temperature TOP -20 70 C
Storage temperature TST -30 80 C
ELECTRICAL CHARACTERISTICS ( VDD = +5V5% , VSS = 0V, Ta = 25°C )
u DC Characteristics
Parameter Symbol Condition Min Typ Max Unit
Supply voltage for logic VDD --- 4.5 5.0 5.5 V
Supply current for logic IDD --- --- 2.62 4 mA
-20°C 12.1 12.6 13.1 V
Operating voltage for LCD VDD - VO 25°C 9.8 10.3 10.8 V
70°C 9.1 9.6 10.1 V
Supply voltage for back light VF --- --- 4.2 4.6 V
Supply current for back light IF VF=4.2V --- 500 840 mA
Input voltage ' H ' level VIH --- 0.7VDD --- VDD V
Input voltage ' L ' level VIL --- 0 --- 0.3VDD V
u AC Characteristics
MPU Interface
Characteristic Symbol Min Typ Max Unit
E cycle tcyc 1000 --- --- ns
E high level width twhE 450 --- --- ns
E low level width twlE 450 --- --- ns
E rise time tr --- --- 25 ns
E fall time tf --- --- 25 ns
Address set-up time tas 140 --- --- ns
Address hold time tah 10 --- --- ns
Data set-up time tdsw 200 --- --- ns
Data delay time tddr --- --- 320 ns
Data hold time(write) tdhw 10 --- --- ns
Data hold time(read) tdhr 20 --- --- ns
MPU Write Timing
MPU Read Timing
OPERATING PRINCIPLES METHODS
u I/O Buffer
Input buffer controls the status between the enable and disable of chip. Unless the CS1 or CS2 is in active mode, input or output of data and instruction do not execute. Therefore internal state is not changed. But RSTB can operate regardless of CS1 and CS2.
u Input Register
Input register is provided to interface with MPU which is different operating frequency. Input register stores the data temporarily before writing it into display data RAM.
When CS1 or CS2 is in the active mode, R/W and RS select the input register. The data from MPU is written into input register and then write it into display data RAM. Data is latched when falling of the E signal and written automatically into the display data RAM by internal operation.
u Output Register
Output register stores the data temporarily from display data RAM when CS1 or CS2 is in active mode and R/W and RS=H. Stored data in display data RAM is latched in output register. When CS1 or CS2 is in active mode and R/W=H, RS=L, status data (busy check)can be read out.
To read the contents of display data RAM, twice access of read instruction is needed. In first access, data in display data RAM is latched into output register. In second access, MPU can read data which is latched. That is, to read the data in display data RAM, it needs dummy read. But status read does not need dummy read.
RS R/W Function
0 0 Instruction
1 Status read(busy cheek)
1 0 Datawrite(from input register to display data RAM
1 Data read(from display data RAM to output register)
u Reset
System reset can be initialized by setting RSTB terminal at low level when turning power on, receiving instruction from MPU. When RSTB becomes low, following procedure is occurred.
- Display off
- Display start line register becone set by 0.(Z-address 0)
While RSTB is low level, no instruction except status read can be accepted. Reset status appears at DB4. After DB4 is low, any instruction can be accepted.
The Conditions of power supply at initial power up are shown in table 1.
Table 1. Power Supply Initial Conditions
Item Symbol Min Typ Max Unit
Reset time tRST 1.0 --- --- us
Rise time tr --- --- 200 ns
u Busy Flag
Busy flag indicates that KS0108B is operating or not operating. When busy flag is high, KS0108B is in internal operating. When busy flag is low, KS0108B can accept the data or instruction.
DB7 indicates busy flag of the KS0108B.
u Display ON/OFF Flip-Flop
The display on/off flip-flop makes on/off of the liquid crystal display. When flip-flop is reset (logical low). selective voltage or non selective voltage appears on segment output terminals. When flip-flop is set (logical high).non selective voltage appears on segment output terminals regardless of display RAM data.
The display on/off flip-flop can change status by instruction. The display data at all segment disappear while RSTB is low. The status of the flip-flop is output to DB5 by read instruction.
u X page Register
X page register designates page of the internal display data RAM. It has not count function. An address is set by instruction.
u Y Address Counter
Y address counter designates address of the internal display data RAM. An address is set by instruction and is increased by 1 automatically by read or write operations of display data.
u Display Data RAM
Display data RAM stores a display data for liquid crystal display. To express on state of dot matrix of liquid crystal display. write data 1. The other way. off state writes 0.
u Display Start Line Register
The display start line register indicates address of display data RAM to display top line of liquid crystal display. Bit data (DB<0:5>) of the display start line set instruction is latched in display start line register. It is used for scrolling of the liquid crystal display screen.
u Display Control Instruction
The display control instructions control the internal state of the KS0108B. Instruction is received fom MPU to KS0108B for the display control. The following table shows various instructions.
Instruction RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 Function
Display ON/OFF 0 0 0 0 1 1 1 1 1 0/1 Controls the display on or off. Internal status and display RAM data are not affected.
0:OFF, 1:ON
Set Address 0 0 0 1 Y address (063) Sets the Y address in the Y address counter.
Set Page
(X address) 0 0 1 0 1 1 1 Page
(07) Sets the X address at the X address register.
Display Start Line 0 0 1 1 Display start line
(063) Indicates the display data RAM displayed at the top of the screen.
Status Read 0 1 B
U
S
Y 0 O
N
/
O
F
F R
E
S
E
T 0 0 0 0 Read status.
BUSY
ON/OFF
RESET
0
1
0
1
0
1
: Ready
: In operation
: Display ON
: Display OFF
: Normal
: Reset
Write Display Data 1 0 Write Data Writes data (DB0:7) into display data RAM. After writing instruction, Y address is increased by 1 automatically.
Read Display Data 1 1 Read Data Reads data (DB0:7) from display data RAM to the data bus.
DISPLAY DATA RAM ADDRESS MAP
ELECTRO-OPTICAL CHARACTERISTICS ( VOP = 13.0V, Ta = 25°C )
Item Symbol Condition Min Typ Max Unit Remarks Note
Response time Tr --- --- 187 --- ms --- 1
Tf --- --- 90 --- ms --- 1
Contrast ratio Cr --- --- 12.7 --- --- --- 2
25 --- --- deg = 90 3
Viewing angle range Cr 2 23 --- --- deg = 270 3
30 --- --- deg = 0 3
54 --- --- deg = 180 3
Note1: Definition of response time.
Note2: Definition of contrast ratio ‘Cr’ . Note3: Definition of viewing angle range ‘’.
INTERFACE PIN CONNECTIONS
Pin No. Symbol Level Description
1 CS1 H Chip select signal for KS0108B(1)
2 CS2 H Chip select signal for KS0108B(2)
3 GND 0V Ground
4 VDD 5.0V Supply voltage for logic
5 VO --- Input voltage for LCD
6 D/I H/L H : Data signal,L : Instruction signal
7 R/W H/L H : Read mode, L : Write mode
8 E H, H L Chip enable signal
9 DB0 H/L Data bit 0
10 DB1 H/L Data bit 1
11 DB2 H/L Data bit 2
12 DB3 H/L Data bit 3
13 DB4 H/L Data bit 4
14 DB5 H/L Data bit 5
15 DB6 H/L Data bit 6
16 DB7 H/L Data bit 7
17 BLA 4.2V Back light anode
18 BLK 0V Back light cathode
PART LIST
Part Name Description Quantity
IC KS0107B.PCC 1
IC KS0108B.PCC 2
LCD TSD0063-DYFDCW 1
PCB M12864-17A1 1
Frame MG12864-5BB 1
Rubber connector 6.7x8.3x2.6mm YS 2
LED light ED-011YGU 54
RELIABILITY
Content of Reliability Test
Environmental Test
No. TestItem Content of Test Test Condition Applicable Standard
1 High temperature storage Endurance test applying the high storage temperature for a long time. 80 C
200 hrs ------
2 Low temperature storage Endurance test applying the low storage temperature for a long time. -30 C
200 hrs ------
3 High temperature operation Endurance test applying the electric stress (Voltage & Current) and the thermal stress to the element for a long time. 70 C
200 hrs
------
4 Low temperature operation Endurance test applying the electric stress under low temperature for a long time. -20 C
200 hrs ------
5 High temperature Humidity storage Endurance test applying the high temperature and high humidity storage for a long time. 80 C , 90 RH
96 hrs MIL-202E-103B
JIS-C5023
6 High temperature Humidity operation Endurance test applying the electric stress (Voltage & Current) and temperature humidity stress to the element for a long time. 70 C , 90 RH
96 hrs MIL-202E-103B
JIS-C5023
7
Temperature cycle Endurance test applying the low and hightemperature cycle.
-20C 70C
10 cycles
------
Mechanical Test
8 Vibration test Endurance test applying the vibration during transportation and using. 1022Hz 1.5mmp-p
22500Hz 1.5G
Total 0.5hrs MIL-202E-201A
JIS-C5025
JIS-C7022-A-10
9 Shock test Constructional and mechanical endurance test applying the shock during transportation. 50G half sign
wave 1l msedc
3 times of each direction MIL-202E-213B
10 Atmospheric pressure test Endurance test applying the atmospheric pressure during transportation by air. 115 mbar
40 hrs MIL-202E-105C
Others
11 Static electricity test Endurance test applying the electric stress to the terminal. VS=800V , RS=1.5 k
CS=100 pF
1 time MIL-883B-3015.1
Supply voltage for logic system = 5V. Supply voltage for LCD system = Operating voltage at 25C.
Failure Judgement Criterion
Criterion Item Test Item No. Failure Judgment Criterion
1 2 3 4 5 6 7 8 9 10 11
Basic specification Out of the Basic Specification
Electrical characteristic Out of the DC and AC Characterstic
Mechanical characterstic Out of the Mechanical Specification Color change : Out of Limit Apperance Specification
Optical characterstic Out of the Apperance Standard
QUALITY GUARANTEE
Acceptable Quality Level
Each lot should satisfy the quality level defined as follows.
- Inspection method : MIL-STD-105E LEVEL II Normal one time sampling
- AQL
Partition
AQL Definition
A: Major 0.4% Functional defective as product
B: Minor 1.5% Satisfy all functions as product but not satisfy cosmetic standard
Definition of ‘LOT’
One lot means the delivery quantity to customer at one time.
Conditions of Cosmetic Inspection
Environmental condition
The inspection should be performed at the 1m of height from the LCD module under 2 pieces of 40W white fluorescent lamps (Normal temperature 2025C and normal humidity 6015RH).
Inspection method
The visual check should be performed vertically at more than 30cm distance from the LCD panel.
Driving voltage
The VO value which the most optimal contrast can be obtained near the specified VO in the specification. (Within 0.5V of the typical value at 25C.).
INSPECTION CRITERIA
Module Cosmetic Criteria
No. Item Judgement Criterion Partition
1 Difference in Spec. None allowed Major
2 Pattern peeling No substrate pattern peeling and floating Major
3 Soldering defects No soldering missing
No soldering bridge
No cold soldering Major
Major Minor
4 Resist flaw on substrate Invisible copper foil (0.5mm or more) on substrate pattern Minor
5 Accretion of metallic Foreign matter No soldering dust
No accretion of metallic foreign matters (Not exceed 0.2mm) Minor
Minor
6 Stain No stain to spoil cosmetic badly Minor
7 Plate discoloring No plate fading, rusting and discoloring Minor
8
Solder amount
1. Lead parts a. Soldering side of PCB
Solder to form a ‘Filet’
all around the lead.
Solder should not hide the
lead form perfectly. (too much)
b. Components side
( In case of ‘Through Hole PCB’ )
Solder to reach the Components side of PCB.
Minor
2. Flat packages Either ‘toe’ (A) or ‘heal’ (B) of
the lead to be covered by ‘Filet’.
Lead form to be assume over
solder.
Minor
3. Chips (32) H h (12) H
Minor
Screen Cosmetic Criteria (Non-Operating)
No. Defect Judgement Criterion Partition
1 Spots In accordance with Screen Cosmetic Criteria (Operating) No.1. Minor
2 Lines In accordance with Screen Cosmetic Criteria (Operating) No.2. Minor
3
Bubbles in polarizer
Minor
4 Scratch In accordance with spots and lines operating cosmetic criteria. When the light reflects on the panel surface, the scratches are not to be remarkable. Minor
5 Allowable density Above defects should be separated more than 30mm each other. Minor
6 Coloration Not to be noticeable coloration in the viewing area of the LCD panels.
Back-lit type should be judged with back-lit on state only. Minor
7 Contamination Not to be noticeable. Minor
Screen Cosmetic Criteria (Operating)
No. Defect Judgement Criterion Partition
1
Spots
A) Clear
Note : Including pin holes and defective dots which must be within one pixel size.
B) Unclear
Minor
2
Lines
A) Clear
Note : ( ) - Acceptable Qty in active area
L - Length (mm)
W - Width (mm)
- Disregard
B) Unclear
Minor
‘Clear’ = The shade and size are not changed by VO.
‘Unclear’ = The shade and size are changed by VO.
Screen Cosmetic Criteria (Operating) (Continued)
No.
Defect Judgement Criterion Partition
3 Rubbing line Not to be noticeable.
4 Allowable density Above defects should be separated more than 10mm each other. Minor
5 Rainbow Not to be noticeable. Minor
6 Dot size To be 95 105 of the dot size (Typ.) in drawing.
Partial defects of each dot (ex. pin-hole) should be treated as ‘spot’.
(see Screen Cosmetic Criteria (Operating) No.1) Minor
7
Uneven brightness (only back-lit type module)
Uneven brightness must be BMAX BMIN 2
- BMAX : Max. value by measure in 5 points
- BMIN : Min. value by measure in 5 points
Divide active area into 4 vertically and horizontally.
Measure 5 points shown in the following figure. Minor
Note :
(1) Size : d = (long length short length) 2
(2) The limit samples for each item have priority.
(3) Complexed defects are defined item by item, but if the number of defects are defined in above table, the total number should not exceed 10.
(4) In case of ‘concentration’, even the spots or the lines of ‘disregarded’ size should not allowed. Following three situations should be treated as ‘concentration’.
- 7 or over defects in circle of 5mm.
- 10 or over defects in circle of 10mm.
- 20 or over defects in circle of 20mm.
PRECAUTIONS FOR USING LCD MODULES
Handing Precautions
(1) The display panel is made of glass. Do not subject it to a mechanical shock by dropping it or impact.
(2) If the display panel is damaged and the liquid crystal substance leaks out, be sure not to get any in your mouth. If the substance contacts your skin or clothes, wash it off using soap and water.
(3) Do not apply excessive force to the display surface or the adjoining areas since this may cause the color tone to vary.
(4) The polarizer covering the display surface of the LCD module is soft and easily scratched. Handle this polarizer carefully.
(5) If the display surface becomes contaminated, breathe on the surface and gently wipe it with a soft dry cloth. If it is heavily contaminated, moisten cloth with one of the following solvents :
- Isopropyl alcohol
- Ethyl alcohol
(6) Solvents other than those above-mentioned may damage the polarizer. Especially, do not use the following.
- Water
- Ketone
- Aromatic solvents
(7) Exercise care to minimize corrosion of the electrode. Corrosion of the electrodes is accelerated by water droplets, moisture condensation or a current flow in a high-humidity environment.
(8) Install the LCD Module by using the mounting holes. When mounting the LCD module make sure it is free of twisting, warping and distortion. In particular, do not forcibly pull or bend the IO cable or the backlight cable.
(9) Do not attempt to disassemble or process the LCD module.
(10) NC terminal should be open. Do not connect anything.
(11) If the logic circuit power is off, do not apply the input signals.
(12) To prevent destruction of the elements by static electricity, be careful to maintain an optimum work environment.
- Be sure to ground the body when handling the LCD modules.
- Tools required for assembling, such as soldering irons, must be properly grounded.
- To reduce the amount of static electricity generated, do not conduct assembling and other work under dry conditions.
- The LCD module is coated with a film to protect the display surface. Exercise care when peeling off this protective film since static electricity may be generated.
Storage Precautions
When storing the LCD modules, avoid exposure to direct sunlight or to the light of fluorescent lamps. Keep the modules in bags (avoid high temperature high humidity and low temperatures below 0C). Whenever possible, the LCD modules should be stored in the same conditions in which they were shipped from our company.
Others
Liquid crystals solidify under low temperature (below the storage temperature range) leading to defective orientation or the generation of air bubbles (black or white). Air bubbles may also be generated if the module is subject to a low temperature.
If the LCD modules have been operating for a long time showing the same display patterns, the display patterns may remain on the screen as ghost images and a slight contrast irregularity may also appear. A normal operating status can be regained by suspending use for some time. It should be noted that this phenomenon does not adversely affect performance reliability.
To minimize the performance degradation of the LCD modules resulting from destruction caused by static electricity etc., exercise care to avoid holding the following sections when handling the modules.
- Exposed area of the printed circuit board.
- Terminal electrode sections.
USING LCD MODULES
Liquid Crystal Display Modules
LCD is composed of glass and polarizer. Pay attention to the following items when handling.
(1) Please keep the temperature within specified range for use and storage. Polarization degradation, bubble generation or polarizer peel-off may occur with high temperature and high humidity.
(2) Do not touch, push or rub the exposed polarizers with anything harder than an HB pencil lead (glass, tweezers, etc.).
(3) N-hexane is recommended for cleaning the adhesives used to attach front/rear polarizers and reflectors made of organic substances which will be damaged by chemicals such as acetone, toluene, ethanol and isopropylalcohol.
(4) When the display surface becomes dusty, wipe gently with absorbent cotton or other soft material like chamois soaked in petroleum benzin. Do not scrub hard to avoid damaging the display surface.
(5) Wipe off saliva or water drops immediately, contact with water over a long period of time may cause deformation or color fading.
(6) Avoid contacting oil and fats.
(7) Condensation on the surface and contact with terminals due to cold will damage, stain or dirty the polarizers. After products are tested at low temperature they must be warmed up in a container before coming is contacting with room temperature air.
(8) Do not put or attach anything on the display area to avoid leaving marks on.
(9) Do not touch the display with bare hands. This will stain the display area and degradate insulation between terminals (some cosmetics are determinated to the polarizers).
(10) As glass is fragile. It tends to become or chipped during handling especially on the edges. Please avoid dropping or jarring.
Installing LCD Modules
The hole in the printed circuit board is used to fix LCM as shown in the picture below. Attend to the following items when installing the LCM.
(1) Cover the surface with a transparent protective plate to protect the polarizer and LC cell.
(2) When assembling the LCM into other equipment, the spacer to the bit between the LCM and the fitting plate should have enough height to avoid causing stress to the module surface, refer to the individual specifications for measurements. The measurement tolerance should be 0.1mm.
Precaution for Handing LCD Modules
Since LCM has been assembled and adjusted with a high degree of precision, avoid applying excessive shocks to the module or making any alterations or modifications to it.
(1) Do not alter, modify or change the the shape of the tab on the metal frame.
(2) Do not make extra holes on the printed circuit board, modify its shape or change the positions of components to be attached.
(3) Do not damage or modify the pattern writing on the printed circuit board.
(4) Absolutely do not modify the zebra rubber strip (conductive rubber) or heat seal connector.
(5) Except for soldering the interface, do not make any alterations or modifications with a soldering iron.
(6) Do not drop, bend or twist LCM.
Electro-Static Discharge Control
Since this module uses a CMOS LSI, the same careful attention should be paid to electrostatic discharge as for an ordinary CMOS IC.
(1) Make certain that you are grounded when handing LCM.
(2) Before remove LCM from its packing case or incorporating it into a set, be sure the module and your body have the same electric potential.
(3) When soldering the terminal of LCM, make certain the AC power source for the soldering iron does not leak.
(4) When using an electric screwdriver to attach LCM, the screwdriver should be of ground potentiality to minimize as much as possible any transmission of electromagnetic waves produced sparks coming from the commutator of the motor.
(5) As far as possible make the electric potential of your work clothes and that of the work bench the ground potential.
(6) To reduce the generation of static electricity be careful that the air in the work is not too dried. A relative humidity of 50%-60% is recommended.
Precaution for soldering to the LCM
(1) Observe the following when soldering lead wire, connector cable and etc. to the LCM.
- Soldering iron temperature : 280C 10C.
- Soldering time : 3-4 sec.
- Solder : eutectic solder.
If soldering flux is used, be sure to remove any remaining flux after finishing to soldering operation. (This does not apply in the case of a non-halogen type of flux.) It is recommended that you protect the LCD surface with a cover during soldering to prevent any damage dur to flux spatters.
(2) When soldering the electroluminescent panel and PC board, the panel and board should not be detached more than three times. This maximum number is determined by the temperature and time conditions mentioned above, though there may be some variance depending on the temperature of the soldering iron.
(3) When remove the electoluminescent panel from the PC board, be sure the solder has completely melted, the soldered pad on the PC board could be damaged.
Precautions for Operation
(1) Viewing angle varies with the change of liquid crystal driving voltage (VO). Adjust VO to show the best contrast.
(2) Driving the LCD in the voltage above the limit shortens its life.
(3) Response time is greatly delayed at temperature below the operating temperature range. However, this does not mean the LCD will be out of the order. It will recover when it returns to the specified temperature range.
(4) If the display area is pushed hard during operation, the display will become abnormal. However, it will return to normal if it is turned off and then back on.
(5) Condensation on terminals can cause an electrochemical reaction disrupting the terminal circuit. Therefore, it must be used under the relative condition of 40C , 50% RH.
(6) When turning the power on, input each signal after the positive/negative voltage becomes stable.
Storage
When storing LCDs as spares for some years, the following precaution are necessary.
(1) Store them in a sealed polyethylene bag. If properly sealed, there is no need for dessicant.
(2) Store them in a dark place. Do not expose to sunlight or fluorescent light, keep the temperature between 0C and 35C.
(3) The polarizer surface should not come in contact with any other objects. (We advise you to store them in the container in which they were shipped.)
(4) Environmental conditions :
- Do not leave them for more than 168hrs. at 60C.
- Should not be left for more than 48hrs. at -20C.
Safety
(1) It is recommended to crush damaged or unnecessary LCDs into pieces and wash them off with solvents such as acetone and ethanol, which should later be burned.
(2) If any liquid leakes out of a damaged glass cell and comes in contact with the hands, wash off thoroughly with soap and water.
Limited Warranty
Unless agreed between TRULY and customer, TRULY will replace or repair any of its LCD modules which are found to be functionally defective when inspected in accordance with TRULY LCD acceptance standards (copies available upon request) for a period of one year from date of shipments. Cosmetic/visual defects must be returned to TRULY within 90 days of shipment. Confirmation of such date shall be based on freight documents. The warranty liability of TRULY limited to repair and/or replacement on the terms set forth above. TRULY will not be responsible for any subsequent or consequential events.
Return LCM under warranty
No warranty can be granted if the precautions stated above have been disregarded. The typical examples of violations are :
- Broken LCD glass.
- PCB eyelet’s damaged or modified.
- PCB conductors damaged.
- Circuit modified in any way, including addition of components.
- PCB tampered with by grinding, engraving or painting varnish.
- soldering to or modifying the bezel in any manner.
Module repairs will be invoiced to the customer upon mutual agreement. Modules must be returned with sufficient description of the failures or defects. Any connectors or cable installed by the customer must be removed completely without damaging the PCB eyelet’s, conductors and terminals.
-----此内容被Gorgon Meducer于2005-01-22,12:00:06编辑过 背光没有问题的 我没用过这个屏。
你传那么大的资料上来也不一定有助于解决问题。
屏点不亮可能多方面问题,你的硬件连接确认过吗?所需的电压是否达到?你可以循环对屏点亮,那么在对应的管脚上会有稳定波形,用示波器看看是否符合要求。 我现在想通过这个论坛确认不是软件方面的原因。硬件方面应该是非常可靠的。 中文资料
点击此处打开armok0133342.pdf 谁能帮帮我,如果成功了,也算一个好的例子啊
阿莫…… 给个检查的思路:
1.硬件是不是好的? 有条件的话可与其他正常的系统互换确定.
2.连线是否正确?
3.编译环境设置是否正确?
4.单片机系统是否工作? 写个控制led闪烁的程序试一下
5.先调试单个控制命令 看是否起作用 注意第三脚vo的连接。程序中可以加入一些标志比如点亮led等,观察程序运行到哪个位置。 谁能从程序的角度看看我写的错了没。硬件我正在努力中。
程序运行以后:
R/W 高电平 1 // 读取状态
D/I 低电平 0
CS1 高电平 1
CS2 低电平 0 //选择第二片
DB0-DB7 高电平 0xff //BUSY=1(忙状态) RST=1(复位状态)ON_OFF=1(先是开状态)
E 高电平 1 //读取状态
RST 高电平 1 //正常工作状态
说明一下,我把V0接在了单片机的电源线上VCC(5v)应该可以吧
好奇怪啊
-----此内容被Gorgon Meducer于2005-01-23,11:18:56编辑过 能不能调对比度? 对比度可以调的,但是我把它固定在5.0v上了
5.0v-13.0v对应不同的对比度(VO,第三脚) 5v一般什么都看不到的,用1k电阻接到地 哦,我试试看,不过前一阵子同样的设备在连线错误的情况下有乱码显示的。试试看吧 我讨厌并行接口...
用硬件SPI实现串行通讯很方便...
今天买个12864去...应该很快搞定的...
不会再向上次的12232-9那样郁闷了!!!
郁闷原因是---4块有2块是坏的!!!其中都是3V的...所以那块3V的让我郁闷了一周时间... 哈哈...今天买了块12864,只改了几句就全部搞定了...
inline unsigned char LcdSpiObj::SetLcdDisplayPos(unsigned char row, unsigned char col)
{
row --;
col --;
if ((row < 4) && (col < 8)) {//汉字字符为4行8列(汉字必须偶数对齐)
LcdSendCommand(0x80 + (row & 1) * 16 + (row >> 1) * 8 + col
LcdRow = row;
LcdCol = col << 1;
return 1;
}
else
return 0;
}
//main程序
int main(void)
{
LcdSpi.SetLcdDisplayPos(4, 1);//定位到第4行第1个汉字列上
LcdSpi.LcdDisplay("04汉字显示演示04");//在当前位置显示汉字串
//.............................................
return 0;//正常返回操作系统(实际不可能,MCU一般也不需要)
} 我重新写了一个头文件,你帮我看看好么?
/******************************************************
函数库名称:LED_Display.h
库功能:存放了驱动12864-1液晶显示屏的基本函数
库版本:1.0
硬件平台:ATMaga16
作者:Gorgon Meducer
日期:2005年1月23日
最后修改时间:2002年1月23日
-------------------------------------------------------
端口说明:
1 vss GND
2 VDD VCC(5v)
3 V0 VCC(5v)
4 D/I PC4
5 R/W PC5
6 E PC3
7 DB0 PA0
...
14 DB7 PA7
15 CS1 PC1
16 CS2 PC2
17 RST PC0
-----------------------------------------------------*/
//命令定义:
# define OpenLCD 0b00111111
# define CloseLCD 0b00111110
# define SetStartLine 0b11000000
# define SetX 0b10111000
# define SetY 0b01000000
/*-----------------------------------------------------
函数说明:
函数名 函数说明
-----------------------------------------------------*/
void Delay(int i); //延时函数
void PortInit(void); //端口初始化
void ReadStateL(void); //读取系统状态(左)
void ReadStateR(void); //读取系统状态(右)
void LED_Nop(void); //屏幕周期延时(临时)
void WriteCommandToLeft(char Commander); //向左边屏幕送命令
void WriteCommandToRight(char Commander); //向右边屏幕送命令
void WriteDataToLeft(char Datas); //向左边写数据
void WriteDataToRight(char Datas); //向右边写数据
void LED_Init(void); //显示屏初始化
void LED_CLS(void); //显示屏清屏
void Location(char x,char y); //显示位置设置
void StartLineSet(char y); //设置起始扫描坐标
void TurnOnLCD(void); //打开显示屏
void TurnOFFLCD(void); //关闭显示屏
void SendData(char Datas); //发送数据
char BUSYL=1; //系统忙标志
char BUSYR=1;
char BUSY=1;
char ON_OFFR=0; //显示开标志
char ON_OFFL=0;
char ON_OFF=0;
char RST=1; //是否复位状态标志
char Now_X=0; //目标位置x
char Now_Y=0; //目标位置y
void Delay(int i)
{
/******************************************************
函数名:延时子函数
功能描述:延时
输入变量 int i
******************************************************/
char a=0;
int b=0;
for (b=0;b<i;b++)
{
for (a=0;a<255;a++);
}
}
void PortInit(void)
{
/******************************************************
函数名:端口初始化
功能描述:初始化端口
******************************************************/
DDRC=0xff;
PORTC=0x00;
DDRA=0xff;
PORTA=0x00;
}
void LED_Nop(void)
{
/******************************************************
函数名:屏幕周期等待函数
功能描述:延时,等待屏幕就位(临时使用)
******************************************************/
char i=0;
for (i=0;i<50;i++);
}
void ReadStateL(void)
{
/******************************************************
函数名:显示屏状态读取函数(左)
功能描述: 读取显示屏当前状态
输出变量:BUSYLON_OFFLRST
******************************************************/
BUSYL=1;
ON_OFFL=0;
RST=1;
PORTC &=0b11111101; //CS1 =0选左
PORTC |=0b00000100; //CS2 =1
{
DDRA =0x00; //读取信息DB0-DB7
PORTC |=0b00001000; //E拉高H
PORTC |=0b00100000; //R/W 拉高H
PORTC &=0b11101111; //D/I 拉低L
PORTC &=0b11110111; //E拉低L 下降沿送锁存信号
PORTC |=0b00001000; //E拉高H 度取状态
BUSYL = PINA>>7; //获得第七位数据BUSY
ON_OFFL = (PINA<<2)>>7; //获得现实状态数据ON / OFF
RST = (PINA<<3)>>7; //获取复位数据RST
DDRA = 0xff; //恢复写数据状态
}
PORTC |=0b00000010; //CS1 =1
PORTC |=0b00000100; //CS2 =1
BUSY = (BUSYL | BUSYR); //返回整个屏幕的状态
ON_OFF = (ON_OFF & ON_OFF); //返回整个屏幕的开关状态
}
void ReadStateR(void)
{
/******************************************************
函数名:显示屏状态读取函数(右)
功能描述: 读取显示屏当前状态
输出变量:BUSYRON_OFFRRST
******************************************************/
BUSYR=1;
ON_OFFR=0;
RST=1;
PORTC &=0b11111011; //CS2 =0
PORTC |=0b00000010; //CS1 =1选右
{
DDRA =0x00; //读取信息DB0-DB7
PORTC |=0b00001000; //E拉高H
PORTC |=0b00100000; //R/W 拉高H
PORTC &=0b11101111; //D/I 拉低L
PORTC &=0b11110111; //E拉低L 下降沿送锁存信号
PORTC |=0b00001000; //E拉高H 度取状态
BUSYR = PINA>>7; //获得第七位数据BUSY
ON_OFFR = (PINA<<2)>>7; //获得现实状态数据ON / OFF
RST = (PINA<<3)>>7; //获取复位数据RST
DDRA = 0xff; //恢复写数据状态
}
PORTC |=0b00000010; //CS1 =1
PORTC |=0b00000100; //CS2 =1
}
void WriteCommandToLeft(char Commander)
{
/******************************************************
函数名:屏幕控制函数(左)
功能描述:向左边屏幕写命令
输入变量 Commander
******************************************************/
PORTC &=0b11111101; //CS1 =0选左
PORTC |=0b00000100; //CS2 =1
LED_Nop();
{
PORTC &=0b11101111; //D/I拉低L 0
PORTC |=0b00001000; //E 拉高H 1
LED_Nop();
PORTC &=0b11011111; //R/W 拉低L 0
PORTA =Commander; //写命令
PORTC |=0b00001000; //E 拉高H 1
PORTC &=0b11110111; //E 跳变L 0
}
PORTC |=0b00000010; //CS1 =1
PORTC |=0b00000100; //CS2 =1
}
void WriteCommandToRight(char Commander)
{
/******************************************************
函数名:屏幕控制函数(右)
功能描述:向右边屏幕写命令
输入变量 Commander
******************************************************/
PORTC &=0b11111011; //CS2 =0
PORTC |=0b00000010; //CS1 =1选右
LED_Nop();
{
PORTC &=0b11101111; //D/I拉低L 0
PORTC |=0b00001000; //E 拉高H 1
LED_Nop();
PORTC &=0b11011111; //R/W 拉低L 0
PORTA =Commander; //写命令
PORTC |=0b00001000; //E 拉高H 1
PORTC &=0b11110111; //E 跳变L 0
}
PORTC |=0b00000010; //CS1 =1
PORTC |=0b00000100; //CS2 =1
}
void WriteDataToLeft(char Datas)
{
/******************************************************
函数名:屏幕显示函数(左)
功能描述:向左边屏幕写数据
输入变量 Datas
******************************************************/
PORTC &=0b11111101; //CS1 =0选左
PORTC |=0b00000100; //CS2 =1
LED_Nop();
{
PORTC &=0b11101111; //D/I拉低L 0
PORTC |=0b00001000; //E 拉高H 1
LED_Nop();
PORTC |=0b00010000; //D/I 拉高 1
PORTC &=0b11011111; //R/W 拉低L 0
PORTA =Datas; //发送数据
PORTC |=0b00001000; //E 拉高H 1
PORTC &=0b11110111; //E 跳变L 0
}
PORTC |=0b00000010; //CS1 =1
PORTC |=0b00000100; //CS2 =1
}
void WriteDataToRight(char Datas)
{
/******************************************************
函数名:屏幕显示函数(右)
功能描述:向右边屏幕写数据
输入变量 Datas
******************************************************/
PORTC &=0b11111011; //CS2 =0
PORTC |=0b00000010; //CS1 =1选右
LED_Nop();
{
PORTC &=0b11101111; //D/I拉低L 0
PORTC |=0b00001000; //E 拉高H 1
LED_Nop();
PORTC |=0b00010000; //D/I 拉高 1
PORTC &=0b11011111; //R/W 拉低L 0
PORTA =Datas; //发送数据
PORTC |=0b00001000; //E 拉高H 1
PORTC &=0b11110111; //E 跳变L 0
}
PORTC |=0b00000010; //CS1 =1
PORTC |=0b00000100; //CS2 =1
}
void LED_Init(void)
{
/******************************************************
函数名:屏幕初始化函数
功能描述:初始化屏幕状态
(关闭显示、清屏,设置第一行为扫描行)
******************************************************/
PortInit(); //端口初始化
TurnOFFLCD(); //关闭显示
TurnOnLCD(); //打开显示
StartLineSet(0); //设置起始行为0
BUSYL=1;
BUSYR=1;
BUSY=1;
ON_OFFL=0;
ON_OFFR=0;
ON_OFF=0;
RST=0;
Now_X=0;
Now_Y=0;
}
void LED_CLS(void)
{
/******************************************************
函数名:清屏
功能描述:清屏
******************************************************/
char a=0;
char b=0;
for (a=0;a<8;a++)
{
WriteCommandToLeft(SetX | a); //设置x坐标(页)
WriteCommandToLeft(SetStartLine); //设置起始行为0(y)
WriteCommandToRight(SetX | a); //设置x坐标(页)
WriteCommandToRight(SetStartLine); //设置起始行为0(y)
for (b=0;b<64;b++) //行寄存器自动增加
{
WriteDataToLeft(0x00); //清屏(左)
WriteDataToRight(0x00); //清屏(右)
}
}
}
void Location(char x,char y)
{
/******************************************************
函数名:显示定位函数
功能描述:根据输入的坐标,设置相应的寄存器
输入变量 x y
******************************************************/
Now_X=x; //获取工作坐标
Now_Y=y;
if (x>7) //片选判断
{ //选择右边
WriteCommandToRight(SetX | (x-8));
WriteCommandToRight(SetY | y);
}
else
{ //选择左边
WriteCommandToLeft(SetX | x);
WriteCommandToLeft(SetY | y);
}
}
void StartLineSet(char y)
{
/******************************************************
函数名:设置起始扫描行
功能描述:根据输入的y坐标,设置相应的寄存器
输入变量 y
******************************************************/
WriteCommandToLeft(SetStartLine | y);
WriteCommandToRight(SetStartLine | y);
}
void TurnOnLCD(void)
{
/******************************************************
函数名:打开显示
功能描述:显示使能
******************************************************/
WriteCommandToLeft(OpenLCD);
WriteCommandToRight(OpenLCD);
}
void TurnOFFLCD(void)
{
/******************************************************
函数名:关闭显示
功能描述:关闭显示
******************************************************/
WriteCommandToLeft(CloseLCD);
WriteCommandToRight(CloseLCD);
}
void SendData(char Datas)
{
/******************************************************
函数名:发送显示信息函数
功能描述:根据当前的目标位置,设置寄存器,发送数据
输入变量 Datas
******************************************************/
if (Now_X>7) //片选判断
{
WriteDataToRight(Datas); //写右边数据
}
else
{
WriteDataToLeft(Datas); //写左边数据
}
}
-----此内容被Gorgon Meducer于2005-01-27,14:50:17编辑过 Gorgon Meducer 傻孩子:
比较长的源代码请以附件形式贴上,只需把重要的部分向大家描述清楚就行了。
你要明白-----看懂别人写的源代码比自己重新写一个更费时间。
请掌握提问的技巧,这样的流水帐是没几个人有耐心去看完的。 谢谢楼上的。
主要是,这里的函数已经是最基本的函数了,而且是头文件,是翻译的方式描述PDF中提到的指令。所以,我直接贴上来了。以后我注意哈。(其实我还是注意了书写格式的,并且写了大量的注释。) 写的不错,全收下了。 我想学你的程序书写方法.能介绍吗. Gorgon Meducer
你还在吗 ?
我遇到的问题 跟你一样的 !
你的问题 解决了吗 ?
V0 得接地 这是不是 问题的关键啊 ?
怎么跟你联系 Gorgon Meducer
你还在吗 ?
我遇到的问题 跟你一样的 !
你的问题 解决了吗 ?
V0 得接地 这是不是 问题的关键啊 ?
怎么跟你联系 我的问题很早就解决了。接地不是关键。关键是当时我调试屏幕的时候,那块屏幕是坏的^_^ 好幽默呀!!!!!!!!!!! 你的问题我觉得与我的差不多,
我昨天也是VO引脚通过一个5K电阻接电源,
而VEE通过一个10K的电阻也接地,结果液晶总是不亮,
我今天把VO和VEE应该通过一个10K电位器接地,而且VEE到地一定要地10K,
然后上电后调节电位器,液晶就可以了。
不知道能否帮到你。
页:
[1]