RAiO RA8806 Two Layers Character/Graphic LCD Controller FAQ Preliminary Version 1.0 June 24, 2009 RAiO Technology Inc. ©Copyright RAiO Technology Inc. 2009 RAiO TECHNOLOGY INC. 1/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller Update History Version 1.0 Date June 24, 2009 RAiO TECHNOLOGY INC. Description Preliminary Version 2/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Chapter Two Layers Character/Graphic LCD Controller Contents Page 1. General Functions .................................................................................... 5 1-1 Basic Functions Introduction.............................................................................. 5 1-2 How to Design RA8806 Application Circuit on LCM ? ...................................... 6 1-3 Fail to Display on by RA8806 .............................................................................. 7 1-4 How to Display Text on LCD ? ............................................................................ 8 1-5 How to Use 「Continuous-Data-Writing」Function ? ....................................... 8 1-6 How to Adjust the Frame Rate ? ....................................................................... 10 1-7 Frame Rate Setting Between Gray Scale Mode and Monochrom Mode ........ 10 1-8 Contrast Adjustment to Improve the Display Quality ..................................... 10 2. Eliminating Flicker Mode ....................................................................... 11 2-1 What is “Flicker”? .............................................................................................. 11 2-2 The Limits in Eliminating Flicker Mode ............................................................ 11 2-3 The Recommendations when Using Eliminating Flicker Mode...................... 11 3. Touch Panel Mode.................................................................................. 12 3-1 How to Use RA8806 Embedded Touch Panel Controller ? ............................. 12 3-2 The Difference between Manual Mode and Auto Mode................................... 13 3-3 How to Detect Touch Event ?............................................................................ 13 3-4 The Settings with Flowchart in Auto Mode ...................................................... 13 3-5 The Settings with Flowchart in Manual Mode.................................................. 15 4. Gray Scale Mode .................................................................................... 18 4-1 RA8806 Gray Scale Application and Characteristic ........................................ 18 4-2 The Required Memory in 320x240 Gray Scale Image...................................... 18 4-3 How to Display a 320x240 Gray Scale Image?................................................. 18 4-4 How to Display a 240x160 Gray Scale Image at Coordinate (5,5) ? ............... 18 4-5 How to Display Text or Symbol in Gray Scale Mode?..................................... 19 5. Other Technical Questions.................................................................... 20 5-1 Missing Display Dot when Display Text or Image ........................................... 20 5-2 Text Shift or Image Shift .................................................................................... 20 5-3 How to Prevent the Crash Occurred ?.............................................................. 20 5-4 How to Prevent the IC Damage ? ...................................................................... 21 RAiO TECHNOLOGY INC. 3/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 5-5 Display Performance with“Crosstalk”or Bad Quality ..................................... 21 RAiO TECHNOLOGY INC. 4/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 1. General Functions 1-1 Basic Functions Introduction RA8806 is a strong and easy to use STN LCD controller.Additionally, excepting the STN LCD display functions, it also contains the function of BIG5 (or GB) and ASCII font ROM、smart ADC touch controller and smart key-scan controller. Users can save lots of time and cost on system hardware and software development. The system block diagram of RA8806 as below for the reference: LCD LCD Driver Driver Font ROM Display RAM CPU CPU 1 2 3 4 5 6 7 8 9 * 0 # LCD LCD Panel Panel LCD LCD Driver Driver LCD Controller (128x64 (128x64 ~~ 640x240) 640x240) Touch Panel ADC Key-Scan Touch Controller RA8806 Figure 1-1 Basically RA8806 accepts commands from MCU then send the data that what RA8806 received from MCU to LCD driver and via the connection between LCD drivers and STN LCD to display texts or images on the screen. Therefore, RA8806 is the control IC between MCU and LCD driver. There are two modes in real application:One is designed RA8806 on LCD modules that become LCD modules are embedded with RA8806 controller and please refer the block diagram as below: LCD 模組 其他元件 其他元件 升壓電路 升壓電路 LCD LCD Driver Driver LCD LCD Controller Controller CPU CPU LCD LCD Driver Driver LCD LCD Panel Panel (128x64 (128x64 ~~ 640x240) 640x240) RA8806 Figure 1-2 Another one is designed RA8806 on the system side to collocate various LCD modules that without controllers and please refer the block diagram as below: LCD 模組 其他元件 其他元件 CPU CPU 升壓電路 升壓電路 LCD LCD Driver Driver LCD LCD Driver Driver LCD LCD Controller Controller LCD LCD Panel Panel (128x64 (128x64 ~~ 640x240) 640x240) RA8806 Figure 1-3 RAiO TECHNOLOGY INC. 5/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 1-2 -2 How to Design RA8806 Application Circuit on LCM ? If you were LCM suppliers and who wants to designed RA8806 on LCD modules with LCD controller, please download the latest RA8806 datasheet first. For the complete RA8806 datasheet, you could contact with our agent or directly log on to our website ((www.raio.com.tw). www.raio.com.tw). Before you designing your application circuit, please refer RA8806 datasheet pin definition、description of LCD driver interface in section 6-2 and the reference application circuit in appendix A. We especially highlight some common oversight points as below to be noticed: There is a bit different application circuit design between 3V LCM and 5V LCM, please refer to section 6-7 of RA8806 datasheet. When RA8806 is operating in 5V system, users must connect capacitor 1µF and 0.1µF between VDD to the ground for the VDD stability. The reference figure as below or refer to section 6-7-3 of RA8806 datasheet. 5V MCU RA8806 5V VDDP VDD ~3V VDD VDDH 0.47uH AVDD GNDP (Option) 10u 0.1u 1u 0.1u GND 0.1u AGND GND I/O MCU I/F Figure 1-4 RA8806 oscillator circuit is generated by external crystal and two capacitors which are between XG and XD pins. We suggest the crystal range is from 4MHz to 12MHz (even though RA8806 is pin to pin compatible with RA8803/RA8822 but the crystal of RA8803/RA8822 is fixed to 32768Hz, totally different with RA8806). The reference figure as below: RA8806 XG 15pF X’tal XD 15pF (4~12MHz) Figure 1-5 RA8806 supports 8080 and 6800 interface modes and pin “MI” defines which interface is going to use (MI:0 Æ 8080 interface;MI:1 Æ 6800 interface). User’s software protocol must follow the hardware setting to make sure RA8806 receive correct commands from MCU. Due to it is unpredictable what environment the system developer is using in, so we strongly recommend the users to connect a capacitor 50~150pF between ZCS1、 ZRD and ZWR to the ground. Please refer the figure below or figure 6-1、6-2 of RA8806 datasheet. RAiO TECHNOLOGY INC. 6/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 8080 MPU RA8806 A0 A1-A7 IORQ RS ZCS1 Decoder CS2 MI D0-D3(D0 -D7) DATA0-3(DATA0-7) RD ZRD WR ZWR RES ZRST Figure 1-6 To use touch panel function, users except connect XL、XR、YU and YD to RA8806 who still need to connect capacitor 0.01µF with these 4 wires to the ground and a pull-high resistor 39Kohm to pin YU. Please refer the figure below or figure 6-18 of RA8806 datasheet. VDD RA8806 39Kohm X1 Touch Panel XL X2 XR Y1 YU Y2 YD 0.01μF x 4 Figure 1-7 Besides RA8806, LCM designers must make sure other devices and circuits correct, like booster circuit、OP bias circuit and LCD driver circuit. For LCM designers or system developers, it is available to refer our sample program and download directly from RAiO website (www.raio.com.tw). We provide two sample programs of 320x240 and which are RA8806_320x240-EX1.rar and RA8806_320x240-EX2.rar. 1-3 Fail to Display on by RA8806 If you were LCM suppliers, below are the debug and analyze steps when fail to display on LCD by RA8806 : 1. Make sure the power(3V or 5V) is correct supplying to RA8806、booster circuit、OP bias circuit and LCD driver circuit. 2. Make sure VLCD (which is generated by booster circuit) and V0~V4(which are generated by OP bias circuit) are correct supplying to LCD driver. 3. Make sure RA8806 oscillator circuit is operating correctly. Users could measure pin XD and pin XG by oscilloscope to check the oscillating is happened or not. 4. Make sure RA8806 ZRST receive the reset signal from MCU during the power on. After reset, ZRST should keep at Hi level. 5. Make sure RA8806 hardware connection and pin definition are correctly connecting with MCU. RAiO TECHNOLOGY INC. 7/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 6. Make sure the timing is generated from MCU that matches with RA8806 requirement and hardware settings are the same with RA8806 modules. Please refer to figure 6-3、 6-4 of RA8806 datasheet. 7. Make sure the commands are generated from MCU that match with RA8806 setting steps and requirement. 8. Make sure the signals (YD、FR、LP、XCK、LD[3:0]) to LCD driver are generated correctly. Assume the signals to LCD driver are generated correctly, the LCD should be displayed on. If the LCD fails to display on, normally reason is the booster circuit. It is either no VLCD generating by booster circuit or V0~V4 from OP bias circuit are not correctly supplying to LCD driver. If you were system developers, the modules you get that usually after the test by LCM suppliers. So if users fail to display on by RA8806, normally reasons are as item 5~7 above. If users design RA8806 on the system side to collocate various LCD modules that without controllers, then must check straight item 3~8 as above. 1-4 How to Display Text on LCD ? For writing data into Display Memory to display texts or images on LCD screen, users need to send memory write command (0xB0) first before the display data write to avoid the failure display. The register [00h] bit-3 is defined which mode is in using : 1Æ text mode ; 0 Æ graphic mode. For example : show letter A on LCD screen LCD_Text(); LCD_CmdWrite(0xB0); LCD_DataWrite(0x41); // set the Register [00h] Bit3 to 1 // Character Code of A (Font Code) is 41h 1-5 How to Use 「Continuous-Data-Writing」Function ? RA8806 supports “Continuous-data-writing” function. Users can continuous write text-data or image-data into memory after the coordinate and memory write command (0xB0) set. For example : show letters ABC on LCD screen LCD_Text(); LCD_SetXY(5,10); LCD_CmdWrite(0xB0); LCD_DataWrite(0x41); LCD_DataWrite(0x42); LCD_DataWrite(0x43); // set the Register [00h] Bit3 to 1 // set address X = 5,Y = 10 // Font Code A : 41h // Font Code B : 42h // Font Code C : 43h Please note that the memory write command (0xB0) must re-send when other commands are executing during the continuous data writing. Users usually forget to re-send memory write command (0xB0) after setting display data in another coordinate. And it will cause the afterward display data fail to display. RAiO TECHNOLOGY INC. 8/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller For example: show letters ABCDE at coordinate(0,0) on LCD screen ABCDE ABCDE Figure 1-8 Common incorrect setting : LCD_Text(); // set the Register [00h] Bit3 to 1 LCD_SetXY(0,0); // set address X = 0,Y = 0 LCD_CmdWrite(0xB0); for(i = 0 ; i < 5 ; i++) { LCD_DataWrite(0 x 41 + i);// data write : ABCDE } LCD_SetXY(0,16); // set address X = 0,Y = 16 for(i = 0 ; i < 5 ; i++) { LCD_DataWrite(0 x 41 + i);// data write : ABCDE } The incorrect setting above will cause the second line ABCDE fail to display. As the memory write command (0xB0) re-send after the coordinate set, the situation is solved. Correct setting : LCD_Text(); // set the Register [00h] Bit3 to 1 LCD_SetXY(0,16); // set address X = 0,Y = 16 LCD_CmdWrite(0xB0); for(i = 0 ; i < 5 ; i++) { LCD_DataWrite(0x41 + i); // continue write ABCDE } RAiO TECHNOLOGY INC. 9/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 1-6 How to Adjust the Frame Rate ? RA8806 provides a register ITCR (Idle Time Counter Register) for users adjusting the frame rate.The ITCR is used to determine every LCD COM scan time.Please refer the figure below : XCLK LP COM_SCAN ITCR T_COM Figure 1-9 Assume the panel resolution is 320x240 and driver data bus is 4-Bit, the formulate between the frame rate and ITCR as below : Frame Rate = System Freq. ( ITCR +320 / 4 ) × 240 For example:what ITCR will be if the system clock is 4 MHz and frame rate is 70Hz ? ITCR = 4 × 10 6 240 × 70 − 80 = 158 1-7 Frame Rate Setting Between Gray Scale Mode and Monochrom Mode The frame rate is different in gray scale mode and monochrom mode. For the best display performance, we suggest the frame rate is set to 70Hz in monochrom mode and 120Hz ~ 140Hz in gray scale mode to avoid the flickering. 1-8 Contrast Adjustment to Improve the Display Quality After the contrast adjustment,the display quality is still poor and dark.It usually related to the frame rate.When the frame rate > 90Hz in monochrom mode,the display quality is getting worst. For the similar issues, users must adjust the frame rate between 70Hz ~ 80Hz. Regarding to the frame rate in different system clock, users could refer appendix B of RA8806 datasheet. RAiO TECHNOLOGY INC. 10/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 2. Eliminating Flicker Mode 2-1 What is “Flicker”? The flicker means when RA8806 internal logic circuit is doing the scan task, at the meantime MPU is doing the data access to RA8806 DDRAM.The error will be occurred by the interfering scan data and it will cause unexpected flicker. RA8806 embedded eliminating flicker function, users only need to set the register MISC [01h] bit-7 to 1 to enable this function. 2-2 The Limits in Eliminating Flicker Mode The eliminating flicker function is not available in text mode and memory clear mode. It is available only in graphic mode. Memory clear means the data is going to be set (ex : to clear the screen is set to 0x00) into the register PNTR[E0h], enable this function and the screen will be automatically clear by hardware. While switching the text/graphic mode, users must beware of the eliminating flicker function is active or not, because it will effect the display performance. 2-3 The Recommendations when Using Eliminating Flicker Mode Users could have the better display performance who is following recommendations when using eliminating flicker mode. Disable eliminating flicker function in text mode. Enable eliminating flicker function in graphic mode. Disable eliminating flicker function before to active memory clear function and enable eliminating flicker function after the screen clear is done by memory clear function. RAiO TECHNOLOGY INC. 11/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 3. Touch Panel Mode 3-1 How to Use RA8806 Embedded Touch Panel Controller ? Hardware control : Users only need to connect the touch panel control pins – XL、XR、YU and YD to RA8806. For the stable signal output, we suggest to connect capacitor 0.01uF between each control pins (XL、XR、YU and YD) and ground. Please refer the figure below : VDD RA8806 39Kohm Touch Panel X1 XL X2 XR Y1 YU Y2 YD 0.01μF x 4 Figure 3-1 Software control : Register TPCR1 [C0h] bit-7 to enable touch panel function then users could depend on what application you need to choose the related functions : Table 3-1 Reg. Bit_Num Description Reference TPCR1 Bit 7 Enable Touch Panel function REG[C0h] Bit 7 “Auto-Mode” or “Manual Mode” selection bit Bit 1~0 Mode selection for TP manual mode Bit 4 Touch Panel Hardware Interrupt enable bit. TPCR2 INTR Bit 3 Touch event detect bit ( use in Manual Mode only). REG[C4h] REG[0Fh] Bit 0 Touch Panel Detect Status bit TPXR Bit 7~0 Touch Panel X Data Bit [9:2] (Segment) REG[C1h] TPYR Bit 7~0 Touch Panel Y Data Bit [9:2] (Common) REG[C2h] Bit 3~2 Touch Panel Y Data Bit [1:0]. (Common) Bit 1~0 Touch Panel X Data Bit [1:0]. (Segment) TPZR RAiO TECHNOLOGY INC. 12/21 REG[C3h] www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 3-2 The Difference between Manual Mode and Auto Mode The manual mode means that whole process from detect touch event to latch X、Y data and read X、Y coordinate is finished by software engineer in manual mode. When enable touch panel function in auto mode, users do not need to do anything till the touch event happen and the X、Y coordinate will be automatically read. The advantage of auto mode is easy to use and manual mode is much flexible for users. 3-3 How to Detect Touch Event ? Users could detect the touch event by external interrupt or polling touch status. Description as below : (一) Detect by external interrupt : By hardware, users must connect RA8806 interrupt pin to MCU interrupt input pin. By software, users must enable register INTR[0Fh] bit-4 to detect the touch event happen. When detect the touch event happen, RA8806 will send interrupt signal to MCU. The program will jump to ISR(interrupt service routine). Executing corresponding functions. (二) Detect by polling touch status : Polling touch status means that keep checking register INTR[0Fh] bit-0 to detect there is touch event happened or not. When detect touch event happen, register INTR[0Fh] bit-0 will be set to 1 and after XY coordinate read、corresponding functions are finished, users must clear this bit to 0 to detect the next touch event happen. 3-4 The Settings with Flowchart in Auto Mode (一) The required settings in auto mode as following table (symbol * means required settings, others are depend on applications) Table 3-2 Reg. Bit_Num Bit 7 TPCR1 TPCR2 INTR Description Reg._Num Enable Touch Panel function Bit 6~4 Touch scan sampling time adjust bit Bit 2~0 Touch scan frequency conversion speed bit Bit 7 “Auto Mode” or “Manual Mode” selection bit Bit 4 Touch Panel Hardware Interrupt bit Bit 0 Touch Panel Detect Status bit * REG[C0h] * * REG[C4h] * REG[0Fh] Note: For detail descriptions, please refer to page 18 、27、28 of RA8806 datasheet. RAiO TECHNOLOGY INC. 13/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller In above table, there is the specific rule between touch scan sampling time and touch scan frequency conversion speed from register TPCR1[C0h]. For the stable ADC output coordinate, please follow the recommendations as the table below : Table 3-3 System CLK 4 MHz 6 MHz 8 MHz 10 MHz 12 MHz ADC Conversion Clock Control REG[C0][2:0] 000 001 010 000 001 010 011 100 000 001 010 011 100 000 001 010 011 100 000 001 010 011 100 Conversion Frequency (KHz) 1000 500 250 1500 750 375 188 94 2000 1000 500 250 125 2500 1250 625 313 156 3000 1500 750 375 188 Touch scan Sampling wait time REG[C0][6:4] 000 000 000 000 000 000 001 010 000 000 000 001 010 000 000 000 001 010 000 000 000 001 010 Sampling wait time REG[C0] Suggested data 50 50 50 50 50 50 100 200 50 50 50 50 100 50 50 50 50 100 50 50 50 50 100 0x80 0x81 0x82 0x80 0x81 0x82 0x93 0xA4 0x80 0x81 0x82 0x83 0x94 0x80 0x81 0x82 0x83 0x94 0x80 0x81 0x82 0x83 0x94 Note: The above recommendations are not 100% guarantee users will get the stable ADC output coordinate under the different touch panel modules or indefinite touch status (ex: tap). And this is still needed the users to enhance by the program. (一) There are three steps to be followed in auto mode (1) Define the parameters(included choosing auto mode、enable touch panel function、touch scan sampling time、touch scan frequency conversion speed and other settings) (2) Detect touch event (included external interrupt and polling touch status, please refer to FAQ item 3-3 description) (3) Read X,Y coordinate (there are 10-bit each of X 、 Y and which is separate in register[C1h]、[C2h] and [C3h], please refer to FAQ item 3-1 description) RAiO TECHNOLOGY INC. 14/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller The flowchart as below is using external interrupt in auto mode : Start Enable Touch Panel ISR ( REG[C0h] B7 = 1 ) Set Auto Mode Check INT Status ( REG[C4h] B7 = 0 ) 0 ( REG[0Fh] B0 = ? ) 1 Enable TP INT Mask ( REG[0Fh] B4 = 1 ) Read X, Y-axis ( Read REG[C1h], Ext. INT Event REG[C2h], REG[C3h] ) Execute Function Other Functions Clear TP INT Status ( REG[0Fh] B0 = 0 ) ISR Termination Figure 3-2 3-5 The Settings with Flowchart in Manual Mode The required settings in manual mode as following table (symbol * means required settings, others are depend on applications) Table 3-4 Reg. Bit_Num Bit 7 TPCR1 TPCR2 Touch scan sampling time adjust bit Bit 2~0 Touch scan frequency conversion speed bit Bit 7 Bit 1~0 Bit 3 Bit 0 Reference Enable Touch Panel function Bit 6~4 Bit 4 INTR Description TP Manual mode enable Mode selection for TP manual mode * REG[C0h] REG[C4h] * * Touch Panel Interrupt Mask Touch Panel Detect Status bit (use in manual mode only). REG[0Fh] Touch Panel Detect status bit Note: For detail descriptions, please refer to page 18 、27、28 of RA8806 datasheet. RAiO TECHNOLOGY INC. 15/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller There are six steps to be followed by polling touch status in manual mode : (1) Define the parameters (included choosing manual mode、enable touch panel function and other settings). (2) Set register TPCR2[C4h] bit[1:0]=01 to wait touch event. (3) Check the touch event is the valid touch or not (it will be treated as the valid touch if register INTR[0Fh] bit-3 always equal the same value in enough checking times).Latch X data in manual mode (it means set register TPCR2[1:0]=10b and wait enough time for the stable data latch).(*) (4) Latch Y data in manual mode (it means set register TPCR2[1:0]=11b and wait enough time for the stable data latch).(*) (5) Read X,Y coordinate (there are 10-bit each of X 、 Y and which is separate in register[C1h]、[C2h] and [C3h], please refer to FAQ item 3-1 description) (*)We suggest the waiting time at least equal to 50 ADC clock and ADC clock conversion speed is depend on register TPCR1[C0h] bit[2:0]. Now we assume system clock is 4MHz and there is the reference table as below of register TPCR1[C0h] bit[2:0] with the different settings Table 3-5 REG[C0h][2:0] ADC clock conversion speed ADC clock cycle suggested wait time (50 ADC Clock) 000 1 MHz 1 μs 50 μs 001 500 KHz 2 μs 100 μs 010 250 KHz 4 μs 200 μs 011 125 KHz 8 μs 400 μs RAiO TECHNOLOGY INC. 16/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller The flowchart as below is using polling touch status in manual mode : Start Enable Touch Panel Latch X Data ( REG[C0h] B7 = 1 ) ( REG[C4h][1:0] = 10 ) Set Auto Mode Delay enough time ( REG[C4h] B7 = 1 ) Latch Y Data Wait for TP event Mode ( REG[C4h][1:0] = 11 ) ( REG[C4h][1:0] = 01 ) Delay enough time Check TP Event 0 Read X, Y-axis ( REG[0Fh] B3 = ? ) ( Read REG[C1h], 1 REG[C2h], REG[C3h] ) Check TP Event valid Execute Function 100 times ? invalid Clear TP INT Status ( REG[0Fh] B0 = 0 ) Other Function Figure 3-3 RAiO TECHNOLOGY INC. 17/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 4. Gray Scale Mode 4-1 RA8806 Gray Scale Application and Characteristic RA8806 supports 4-gray-scale display. To perform the gray scale that the users only need to set register MAMR[12h] bit[6:4] to 000b. RA8806 supports 4-gray-scale function in images display and texts display. Regarding the texts display, please refer to FAQ item 4-5 description. 4-2 The Required Memory in 320x240 Gray Scale Image In gray scale mode, each display pixel needs 2 bits memory space to save into. For example: How many display memory spaces are going to use if the display image is 320x240 ? 320 x 240 x 2 = 153600 bits = 19200 bytes (about 19K bytes) 4-3 How to Display a 320x240 Gray Scale Image? Users must enable gray scale mode first (it means to set register MAMR[12h] bit[6:4] to 000b) then write the image data into display memory from coordinate(0,0). Below is the sample program for the reference : LCD_GrayScale_Mode(); // enable gray scale function // set coordinate at X = 0,Y = 0 LCD_SetXY(0,0); // memory write command LCD_CmdWrite(0xB0); for(i = 0 ; i < 19200 ; i ++) // write data 19200 bytes { LCD_DataWrite(320x240_Gray_pic[ i ]); } 4-4 How to Display a 240x160 Gray Scale Image at Coordinate (5,5) ? Now if the active window is setting to 320x240;users need to write total 160 rows and 60 bytes per row(240*2/8) data into display memory by the program in double loop method. Due to it is unable to change row automatically, users must re-send coordinate before per row starting to write data. Sample program as below for the reference : for(i = 0 ; i < 160 ; i ++) // 160 rows { LCD_SetXY(5, 5 + i); // set coordinate at X = 5,Y = 5 // memory write command LCD_CmdWrite(0xB0); for(j = 0 ; j < 60 ; j ++) // 60 bytes per row data { LCD_DataWrite(240x160_Gray_pic[ j + i * 60 ]); } } RAiO TECHNOLOGY INC. 18/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 4-5 How to Display Text or Symbol in Gray Scale Mode? We provide two program codes for customer reference and which are rotate 90 degrees display and normal(non-rotate) display applications. If the users want to perform the GB/BIG-5 fonts under the gray scale mode, all you need is only to set related parameters in what program code you are using of two program codes. XX : X coordinate value of the text who want to display, the data length is 8 bits. YY : Y coordinate value of the text who want to display, the data length is 8 bits. *ptr : text strings pointer address, the data length is 8 bits. gray_level : define the text gray scale. font_inverse : font inverse function. Users must note that there are two steps need to set befor using the program code : Switch the display mode into gray scale mode. Set Register WCCR[10h] bit-3 to 1 in rotate 90 degrees display application. Sub-routine for displaying font in the gray-scale mode Main Program Start Reset LCD Initialize LCD Setup Display Page1 Turn on LCD Enable character mode Clear display memory Rotate 90° on the screen Setup RA8806 to access Page1 Write a full-size font on the specified coordinate Setup RA8806 to display Page1 Setup graphic input mode Enable graphic mode Read 32 byte display data from RA8806 Enable gray-scale mode Enable gray-scale mode Enable Eliminating flicker mode Transfer the 32 byte read back data and write them into the display memory of RA8806 Display 4-grayscale image Show font on grayscale image End No Is it the 32nd data ? Yes No Is it the last font ? End RAiO TECHNOLOGY INC. 19/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 5. Other Technical Questions 5-1 Missing Display Dot when Display Text or Image There are two possibilities: 1. Unstable DC-DC from RA8806 Æ When RA8806 operates in 5V system (VDDP=5V), VDD should connect a capacitor >1µF to the ground. Please refer section 6-7-3 of RA8806 datasheet. 2. MCU data access is too faster than RA8806 data process Æ Please add Delay into the program or by check Busy to make sure RA8806 has already finished processing the last data. 5-2 Text Shift or Image Shift Here are four possibilities: 1. RA8806 display window setting and active window setting are different with LCD resolution. The table below is listing the common LCD resolution with the related register settings for the reference: Table 5-1 Panel Resolution Segment Common REG[21h] DWWR REG[31h] DWHR 160*80 160 80 13h 4Fh 160*128 160 128 13h 7Fh 160*160 160 160 13h 9Fh 240*64 240 64 1Dh 3Fh 240*128 240 128 1Dh 7Fh 240*160 240 160 1Dh 9Fh 320*240 320 240 27h EFh 2. MCU data transfer is too faster than RA8806 data process Æ Please add Delay into the program or by check Busy to make sure RA8806 has already finished processing the last data. 3. The timing is generated from MCU that not matches RA8806 requirement Æ To avoid insufficient Set-up time or Hold time, please refer to figure 6-3、6-4 of RA8806 datasheet. 4. The text shift or image shift phenomenon could be caused by the bad system environment 、serious noise effect or the long connection between module and system Æ Even though RA8806 is using Schmitt Trigger on MCU input interface to avoid the noise effect, but RA8806 still might work incorrectly by the serious noise effect. To reduce connections between MCU and RA8806 effect or system environment effect, users could connect a capacitor 50~150pF between ZCS1 、 ZRD and ZWR to the ground. If it is caused by the MCU weak signal or the heavy loading, users could connect a pull-high resistor 1K~4.7Kohm on ZCS1、ZRD 、ZWR and DATA[7:0]. 5-3 How to Prevent the Crash Occurred ? The possible reasons are because the bad system environment and serious noise effect Æ Please refer to item 4 of the previous section 5-2. Besides, please avoid the long connection between module and system. RAiO TECHNOLOGY INC. 20/21 www.raio.com.tw RA8806 Preliminary Version 1.0 Two Layers Character/Graphic LCD Controller 5-4 How to Prevent the IC Damage ? RA8806 ESD protection could reach to ±8KV, it is much higher than industrial standard 4KV requirement. But users still must especially notice the PCB layout and add the protection devices to avoid the IC damage for the special and bad system environment usage. And the too high sudden power pulse or supply over 5.5V voltage for a long time will cause the IC damage as well Æ Users could connect a capacitor 470µF or the surge absorber between VDD to the ground to avoid the IC or LCM damage. Power LCD Module 7V VDD 6V 5V Driver 470uF Driver Driver RA8806 Driver Driver GND t Time Figure 5-1 Another reason will cause the IC damage is because the EOS(Electrically Over Stress). The better way to avoid it is to reduce the cable length as short as possible or connect a resistor 200ohm~1Kohm between the system and LCMs. System Board LCD Module MCU : : : Driver Driver Driver RA8806 Driver Driver Figure 5-2 5-5 Display Performance with“Crosstalk”or Bad Quality There are four possibilities: 1. LC quality or polarizer is poor. 2. Booster ability (VLCD) or driving ability is insufficient. 3. Incorrect bias (V0~V4). RA8806 frame rate setting is too high to cause the crosstalk or bad display quality. Please refer to frame rate setting table in appendix B of RA8806 datasheet. The ITCR[90h] setting is defined by what LCD resolution in using and system clock. Too high frame rate will cause the driver with the high power consumption and then effect the booster ability (VLCD) or driving ability is insufficient. RAiO TECHNOLOGY INC. 21/21 www.raio.com.tw