sábado, 5 de janeiro de 2013

pro59801 lcd module hack

Currently I´m designing a power supply based on the well known  LM317 voltage regulator and needed a lcd module to show the voltage and current values. Some time ago, a friend give me some PRO59801 pinpad lcd modules which is a module based on the KS0713 controller. The problem is, that this module, has an 8bit parallel interface and I´m using a low pin count pic micro. After reading the KS0713 datasheet, I fount that this controller has a serial interface that can be selected via HW pin, also the controller is on a flex cable that connects the pcb to the glass, a search took me to an BP12864C lcd/controller solution again reading the datasheet found the pin that selects the serial/parallel interface. 

The module with the original connection

1 - GND
2 - VCC
3 - NC
4  - /RST
5  - /CS1
6  - RS
7  - RW_WR
8  - E_RD
9-14  DB0-DB5
DB6 - CLK
DB7 - SID
17 - led+
18 - led-


Originaly the PS pin is connected to VDD by the track marked by the red circule, just needed to cut it and connect the PS pin to GND, luckily the next pin was already conected to GND so only had to make the connection marked by the yellow circule.



Here is the final work

The power supply still is in development this is a test version, todo is the current adjustment and dummy load

5 comentários:

  1. Tsingtek, established since 2002,Tsingtek has extensive experience in custom OLED Display . click here

    ResponderEliminar
  2. Hello ,

    What is the supply voltage to this LCD .. 3V/5V?
    Is it possible to share code ?

    ResponderEliminar
    Respostas
    1. hi,
      it works with both 3v and 5y, currently I'm using this code:



      /*
      * KS0713 library
      * Hugo Reis 2013
      *
      * This software is free you can edit modify or redistribute it, under the
      * terms of General Public License
      *
      * This software is distributed WITHOUT ANY WARRANTY
      */

      #ifndef _KS0713
      #define _KS0713
      /*******************************************
      * Board - pro59801
      * Controller - KS0713(S6B1713)
      * LCD - BP12864A
      * Mode - serial
      *
      * 1 GND
      * 2 VCC
      * 3 NC
      * 4 /RSTB - RST
      * 5 /CS1 - GND
      * 6 RS
      * 7 RW_WR - GND
      * 8 E_RD - GND
      * 9-14 DB0-DB5
      * 15 DB6 <- SCL
      * 16 DB7 <- SDA
      * 17 led+
      * 18 led-
      *******************************************/

      #define RESET 0xE2
      #define DISP 0xAE // display on/off
      #define INTL 0x40 // initial display line
      #define RMODE 0x81 // set reference mode
      #define PASET 0xB0
      #define CASET 0x10 // MSB
      #define ADCSEL 0xA0 //
      #define REV 0xA6
      #define EON 0xA4

      #define LCD_W 128
      #define LCD_H 64

      #if !defined(LCDSDI) || !defined(LCDCLK) || !defined(LCDRS) || !defined(LCDRST)
      #error "define LCDSDI, LCDCLK, LCDRS, LCDRST"
      #endif

      #define LCDSDI0 LCDSDI = 0;
      #define LCDSDI1 LCDSDI = 1;
      #define LCDCLK0 LCDCLK = 0;
      #define LCDCLK1 LCDCLK = 1;
      #define LCDRS0 LCDRS = 0;
      #define LCDRS1 LCDRS = 1;
      #define LCDRST0 LCDRST = 0;
      #define LCDRST1 LCDRST = 1;

      void lcdInit(void);
      void lcdcmd(char c);
      void lcddata(char d);
      #endif



      /*
      * KS0713 library
      * Hugo Reis 2013
      *
      * This software is free you can edit modify or redistribute it, under the
      * terms of General Public License
      *
      * This software is distributed WITHOUT ANY WARRANTY
      */


      #include
      #include "ks0713.h"

      void shiftout(char bits)
      {
      LCDCLK0 if ((bits&128)) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&64 )) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&32 )) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&16 )) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&8 )) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&4 )) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&2 )) LCDSDI1 else LCDSDI0 LCDCLK1
      LCDCLK0 if ((bits&1 )) LCDSDI1 else LCDSDI0 LCDCLK1
      }
      //-----------------------------------------------
      //
      //-----------------------------------------------
      void lcdcmd(char c)
      {
      LCDRS0
      shiftout(c);
      }
      //-----------------------------------------------
      //
      //-----------------------------------------------
      void lcddata(char d)
      {
      LCDRS1
      shiftout(d);
      }
      //-----------------------------------------------
      //
      //-----------------------------------------------
      void setPos(char x, char y)
      {
      lcdcmd(0x10 | (x>>4));
      lcdcmd(x&0x0f);
      lcdcmd(0xB0 + y);
      }
      //-----------------------------------------------
      //
      //-----------------------------------------------
      void lcdInit(void)
      {
      unsigned w,h;

      LCDCLK0
      LCDRST0
      DelayMs(250);
      DelayMs(250);
      DelayMs(250);
      DelayMs(250);
      LCDRST1

      lcdcmd(RESET);
      lcdcmd(0xA0); // ADC select
      lcdcmd(0xC8); // SHL Select
      lcdcmd(0xA3); // select bias

      lcdcmd(0x2C); // voltage converter on
      DelayMs(2);
      lcdcmd(0x2E); // voltage regulator on
      DelayMs(2);
      lcdcmd(0x2F); // voltage follower on

      lcdcmd(0x27); // regulator resistor
      lcdcmd(0x81); // set reference voltage
      lcdcmd(0x26); // reference voltage value (contraste)

      lcdcmd(0xAF); // DiSP ON

      lcdcmd(0xA5); // all on
      for(h=0;h<8;h++)
      {
      setPos(0,h);
      for(w=0;w<LCD_W;w++)
      lcddata(0x0);
      }

      lcdcmd(0xA4); // all off
      }

      Eliminar
  3. Este comentário foi removido pelo autor.

    ResponderEliminar
  4. We are LCD module manufacturer in China and we are supplying Graphic LCD display Module & Character LCD display Module, Dot Matrix LCD display Module etc.

    ResponderEliminar