Sunday, January 18, 2015

ELEC&ELTEK CMBG12864G Controllerless Graphic LCD

Update 1/23/2016
assembly code bug fix (다른글 소스코드에 반영)


Working with unusual LCD modules from Local Surplus
ELEC&ELTEK CMBG12864G
재미있는 LCD 모듈입니다.
QVGA(320x240) Mono LCD나 TFT LCD에서는 Non-Controller 제품을 어렵지 않게 볼 수 있지만, 128x64 해상도의 작은 크기에서 Non-Controller 제품은 처음 보는거라 호기심이 발동하였습니다. 

내부 구성은,
KS0086(S6B0086) 80CH COMMON / SEGMENT DRIVER(3EA),
NJU7660 Voltage Converter(2EA)가 사용되었으며, 구동방식은 QVGA Graphic LCD와 같은 구조입니다.




Feature

  1. Resolution : 128 x 64
  2. Power : DC +3.3V ~+5V for Logic
  3. KS0086(S6B0086) 80CH COMMON / SEGMENT DRIVER x 3
  4. NJU7660 Voltage Converter x 2
  5. 4-Bits Parallel Interface.
  6. Backlight : Yellow Green LED Backlight (14EA, 100mA)
  7. Non Controller (Controller less)
  8. 처음엔 2,000원에 판매되었으나 지금은 부품용으로 2개에 1000원으로  판매

Interface

  1. 동작 전압은 DC +3.3V ~ +5V, 사용전압에 따른 VO, LED Backlight 설정은 Schematic을 참고하세요. 
  2. 13핀 FFC 리본케이블은 1mm Pitch입니다.
PIN
Symbol
Level
Function
1
V0
 
Operating voltage for LCD (contrast adjusting)
2
VDD
DC +3.3V
 ~ +5V
Power supply for logic
3
VSS
GND
 
4
M
 
External M signal input for AC driving.
5
FLM
H->L
First Line Mark or Scan start-up pulse
FLM does have several different names, FLM, YD, FRAME, EIOx,FRP.
6
D0
H/L
Display Data bus
7
D1
8
D2
9
D3
10
CL2
H->L
Bidirectional shift register shift clock
* This is responsible for the HORIZONTAL
11
CL1
H->L
Display data latch clock.
CL1 does have several different names,  LP, LOAD, LIP, Y-Drive, Latch Pulse, Vertical clock.
* This is responsible for the VERTICAL
12
A
+3.3V ~ +5V
Power supply for LED backlight  (LED x 14, 100mA)
13
K
GND
Power supply for LED backlight
Backplane
1mm Pitch 13P FFC Ribbon Cable 
Homemade 2.54-Pitch Converter Adapter Board

Dummy Write

LCD Controller가  하는일을 들여다 볼수 있는 아주 특수한 현미경이 있다면 Shift/Latch동작을 무한 반복한다는걸 알 수있습니다.
Character, Mono/Color Graphic LCD등 모든 LCD의 기본 동작은 동일합니다.
구현된 기능도 MCU Timer의 CTC 모드를 이용 일정주기(LCD_FPS, 1초에 70번) 마다 화면을 끊임없이 갱신합니다.
필요 Memory 산정, Bandwidth산정(데이터를 출력하기 위해 필요한 처리속도),
Timer 주기등은 산술 연산이므로 계산방법은 Source Code의 Comment를 참고하세요. 

여기서는 한가지 특이한 점인 Dummy Write의 필요성에 대해 기술합니다.
128x64 해상도 표현을 위해,
KS0086(S6B0086) 80CH COMMON / SEGMENT DRIVER가 총 3개 사용 되었습니다.
64 Row를 U1이 Common Mode로 사용 ,
128 Column을 Segment Mode로 U2, U3가 담당합니다.
Segment Mode(Column)  첫번째 U2는 80CH를 전부 사용,
두번째 U3는 80CH중 48CH만 사용합니다. 여기서 눈여겨봐야 할 곳이 바로 U3입니다.
만약 U3의 실제로 사용하지 않는 32CH를  그냥 둔다면 화면이 정상적으로 동작하지 않습니다.
반드시,  4 Byte(32 CH/8Bit)를 DB0..DB3 Data Port에 Write해주어야 합니다.
짧은지식과 표현력의 한계로  말로 표현하는건 한계가 있습니다
아래그림과 같이 보시면 조금이나마 도움이 될거 같습니다 (32 Dummy Write)

Construnction and Working of an Display

Why assembly language?

128x64 해상도에서는 1024 Byte의 Memory, 1초에 100KByte의 데이터 전송만으로 충분히구현 가능합니다.
동영상에서도 3.3V, 8MHz 속도로 동작하고 있습니다.
만약 320x240 해상도라면 ? 해상도가 커지고, 여기에 Color 속성까지 더해진다면 데이터의 처리량은 급격히 증가하므로 이때, C 언어보다는 Assembly어가 빠른 성능을 보여줍니다.
Source Code 디렉토리의 asm 폴더는 C 언어로 작성된 내용 그대로 assembly어로 구현 되어있습니다.
* 실용적인 면에서는 Assembly어 보다는 빠른 MCU/CPU와 C언어가 여러모로 유리합니다.
assembly 코드에 오류가 여러곳 발견되었습니다, 변경된 코드는 아래 링크를 참고하세요
I  found some errors in assembly code & Fix.
Refer to Link Source code for details

Schematic

  1. DC +3,3V시, Backlight는 10R 저항사용, 1번핀 VO는 N.C
  2. DC +5V 사용시, Backlight는 30R 저항사용, 1번핀 VO는 5K~10KOhm 반고정저항사용
  • Contrast 조정시 화면 변화를 관찰하며 부드럽게 조정하세요, 급격히 조정하시면 과전압이 흘러 LCD에 무리를 줍니다.
Atmega328p 8MHz  3.3V

Downloads 

To Do 

1-Bit Serial Interface.
 If you have any questions, please feel free to ask. Enjoy!

12 comments:

  1. Hello,

    Do you also have a version for the arduino dev 1.0.5 of higher? I would like to use it for the ITM-400160K1-02.
    Datasheet: http://www.datasheetarchive.com/dl/Datasheets-UD1/DSAUD009076.pdf

    Hoop to hear soon.

    ReplyDelete
    Replies
    1. Hi,
      Using of the Atmel AVR is only example,
      You can easy adopt the avr-gcc code for Arduino
      Good news, your LCD module is the same construction, and You do not need dummy write(80Ch x 5 = 400)

      Delete
  2. Hello,
    I would like to have it in arduino development environment.
    Do you know where I should place the files to get this working with a atmega168p.
    I thought I could use the same connections as yours.

    But I will connect it like this: your at the left side from = and my display on the right.
    DB0 = DB1 pin 3
    DB1 = DB2 pin14
    DB2 = DB3 pin 4
    DB3 = DB4 pin 15
    CL1 = CL1 pin 10
    CL2 = CL2 pin5
    ELM = DISPOFF
    M = M pin 17
    VCC = VDD pin 2 will be my 5V because my display can hold 7V max
    VSS = VSS pin 1 also pin12
    V0 = VEE pin 13 will be connected to a 10K potmeter
    A = A pin 11
    K = K pin 22 with a resistor of 220ohm

    Do you have maybe a sketch or ino file for me to test it and where I should place the files in the library.

    Already thank you for your help.

    Hoop to hear soon.

    Also nice blog about this.

    ReplyDelete
    Replies
    1. Hi,
      I don't have a Arduino, Where is Pin#6 "DI" ?
      Make sure the "DI" connection is correct( other things, too)
      This signal indicating the beginning of each display cycle, for the rest looking good.

      Your LCD Module Pin#6 "DI" is equivalent to FLM(First Line Mark)
      See the Interface above.

      Delete
    2. Thanks for your reply. Yes your right! I was reading from your schematic it was ELM but is should be FLM = DI pin6.

      To bad I am really searching for a version for the Arduino Development environment.A sketch file or ino file will help. because I couldn't find one. Do you know who provide one ??

      Delete
    3. nope
      Anyway, I Don't know how to help you, Can you put the your code here?
      * I am not sure that it is possible to Driving your LCD(400x160) on the Arduino

      Delete
  3. I have Ampire lcd 320x240 without driver .all the flm cp lp and 4 bit parallel data is available.how i can implement your code .please give me a replay

    ReplyDelete
    Replies
    1. Hello, rathish gopi
      Yes, it is quite possible

      Please verify sfficient memory available Your Microcontroller before Working
      You need sufficient memory Memory for Framebuffer, accurately 9.6Kbytes
      Atmel Atmega128 has 4K SRAM - this means need External SRAM Module
      *Freescale Kinetis KL46 has 32K SRAM- ideal conditions

      refer below(fix assembly code )
      http://kimboricha.blogspot.kr/2016/01/ocular-og16801-controllerless-graphic.html

      Come few days later, i will posting 320x240
      https://flic.kr/s/aHsk7j3VuC
      DMA vs GPIO
      https://www.flickr.com/photos/boricha/24214904979/in/album-72157650043165408/

      Delete
  4. I have Ampire lcd 320x240 without driver .all the flm cp lp and 4 bit parallel data is available.how i can implement your code .please give me a replay

    ReplyDelete
  5. Hello Mark
    I love your blog, it's very helpful. Unfortunately, for now, I think you are the only one who can help me.
    Some month ago, I've bought 5 glcd (EDT EW50094FLY) for a very low price, but controlerless.
    After contacting the manufacturer, they can't share any spec because it's a custom design.
    Browsing through the web, i found it's a 128*64 wow, big news.
    I've found data sheets for the driver (S6B2086, the same of the ELEC&ELTEK CMBG12864G) and the voltage converter.

    Today, I know a part of the interface, but not everything :

    pin 1 = K
    pin 2 = A
    pin 3 = ? (VDD ?)
    pin 4 = DISP OFF
    pin 5 = D3
    pin 6 = D2
    pin 7 = D1
    pin 8 = D0
    pin 9 = CL2
    pin 10 = CL1
    pin 11 = M
    pin 12 = ? (FLM ?)
    pin 13 = ?
    pin 14 = VSS
    pin 15 = ?

    With the good interface, I can adapt your code to use it with Arduino UNO and PIC32. I will be very glad if you can help me with that. I can also send you one of them if you want to play with it.

    Regards,
    Ludovic

    https://www.dropbox.com/s/1qaz2xkcz4sjvlx/IMG_20160125_092022.jpg?dl=0
    https://www.dropbox.com/s/61f704jgqqutedp/IMG_20160125_092040.jpg?dl=0
    https://www.dropbox.com/s/zvjnm6n51yqpn89/S6B2086.pdf?dl=0
    https://www.dropbox.com/s/m45wniuvoaj30a1/AIC1660.pdf?dl=0

    ReplyDelete
    Replies
    1. Hello Ludovic Borgnat

      Custom Model is difficult to get Datasheet
      They are must protect client's property, It's their "duty"
      Try not to feel too bad about it

      BTW, I checked out the your photo, You could check.

      pin 3 if S6B2086 = Pin#63 then VDD
      pin 12 if S6B2086 = Pin#66 then FLM
      pin 13 = V0 (AIC1660 Pin#5)
      pin 15 = VL- (probably Frame Ground? )

      This will help You
      http://kimboricha.blogspot.kr/2013/03/reverse-engineering-data-image-py32201.html

      Me, too I just can’t pass up a good deal ^^;

      Delete
    2. Thank you for your help, I will try this as soon as possible. I don't feel bad about the datasheet, it's just a bad news. I keep you in touch about it and about my modification of your code for arduino uno.

      Delete