LCD tester 240x128

Uporabniški avatar
Milenko
Prispevkov: 1200
Pridružen: Pe Nov 08, 2002 9:56 am
Kraj: Glavica Milenko, Maribor, tel:068/164-387
Kontakt:

LCD tester 240x128

Odgovor Napisal/-a Milenko »

Izdelava LCD(prikazovalnika) testerja. Moj je 240x128 T6963c kontroler.

Ker nisem vedel vec kam kateri prikazovalnik paše in ker so se mi pomešali stari in novi,sem bil primoran narediti tester.
S testerjem bom preveril,ce prikazovalnik deluje,kako deluje in razporeditev pinov.
-naprej sestavimo razvojno plošco (glejmo nacrt)
-sprogramiramo Anano lahko je podoben micro ali klasika 328 (oglejmo si sketch),morate imeti naložene knjižnice
-preverimo delovanje brez prikazovalnika,5V,masa,pini in izmerimo napetosti izhoda MC34063
-ce je možno preverimo po oznaki, kateri model oz tip prikazovalnika imamo,ce to ni možno, imamo jumper na pinu Anano 11 in 12
-ce imamo prikazovalnik drugih dimenzij in resolucije spremenimo v sketch-u (arduino) vrstico:
U8GLIB_T6963_240X128 u8g(10, 9, 8, 7, 6, 5, 4, 3, 2, 13, 12, 11, 1);
// 8Bit Com: D0..D7: D0, D1, D2, D3, D4, D5, D6, D7, cs=14, c/d(a0)=15, wr=17, rd=18, reset=16
-v našem primeru je to 240x128,lahko so tudi druge vrednosti,spremeniti moramo tudi funkcije glede na prikazovalnik,ker ne bo pravilno deloval
-sedaj prikljucimo prikazovalnik,ce imamo CCFL (hladno katodo) potrebujemo inverter 5V na cca 500-600V
-ce je vse pravilno sestavljeno in ce je prikazovalnik izpraven mora prikazovati vec slik (glej fotke),ce ne prestavimo jumperja WR in RD

Sam sem preizkusil 10 prikazovalnikov od tega 4 razlicne, med tem sem moral prestaviti tudi jumperja WR in RD za model HY-240128b. Ta ne potrebuje
generatorja -15V za kontrast prikozavalnika,ima svoj izhod in napetost Vee na pinu 17.

več fotk:
tukaj

video:
tukaj

Koda: Izberi vse

/*
Date :- 26 - August - 2019
Sketch By:- Milek

  ________________________________________________________________
  LMG7420PLFC-x PIN |    LCD PIN NAME  |     nano 328             |
  ________________________________________________________________|
          1         |         GND      |       GND                |
          2         |     VDD(+5V)     |       GND                |
          3         |          V0      |   10k pot trimer pin2    |
          4         |         C/D      |        13                |
          5         |          WR      |        12                |
          6         |          RD      |        11                |
          7         |         DB0      |        10                |
          8         |         DB1      |         9                |
          9         |         DB2      |         8                |
         10         |         DB3      |         7                |
         11         |         DB4      |         6                |
         12         |         DB5      |         5                |
         13         |         DB6      |         4                |
         14         |         DB7      |         3                |
         15         |       CE/CS      |         2                |
         16         |    reset RST     |         1                |
         17         |     VEE(-15V)    |   10k pot trimer pin1    |
         18         |     DISP OFF     |         -                |
         19         |         F/S      |Char font select high=    |
         20         |       reverse    |for 6x8 low= for 8x8font  |
  ________________________________________________________________|
*/
#include "U8glib.h"

U8GLIB_T6963_240X128 u8g(10, 9, 8, 7,  6,  5,  4,  3,  2, 13,  12,  11,  1);   
// 8Bit Com: D0..D7:    D0, D1, D2, D3, D4, D5, D6, D7, cs=14, c/d(a0)=15, wr=17, rd=18, reset=16

#define AL_logo_width 64
#define AL_logo_height 63
//static unsigned char u8g_logo_bits[] = {
static unsigned char AL_logo_bits[] U8G_PROGMEM = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
   0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0xc0, 0x07, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0xc0, 0x0f,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0xe0, 0x0f, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0xe0, 0x1f, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0xf0, 0x1f,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0xf0, 0x1f, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0xf0, 0x3e, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0xf8, 0x3e,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0xf8, 0x7c, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x7c, 0x7c, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x7c, 0xf8,
   0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x3e, 0xf8, 0x3e, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x3e, 0xf0, 0x3e, 0x00, 0x00, 0x10, 0x04, 0x00, 0x1e, 0xf0,
   0x3f, 0x00, 0x00, 0x10, 0x04, 0x00, 0x1f, 0xf0, 0x3f, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x0f, 0xe0, 0x3f, 0x00, 0x00, 0x10, 0x04, 0x80, 0x0f, 0xe0,
   0x3f, 0x00, 0xc0, 0x13, 0x04, 0x80, 0x0f, 0xc0, 0x3f, 0x00, 0xc0, 0x13,
   0x04, 0x80, 0x07, 0xc0, 0x3f, 0x00, 0xc0, 0x13, 0x04, 0xc0, 0x07, 0xc0,
   0x3f, 0x00, 0xc0, 0x13, 0x04, 0xc0, 0x03, 0x80, 0x3f, 0x00, 0xc0, 0x13,
   0x04, 0xe0, 0x03, 0x80, 0x3f, 0x00, 0xc0, 0x13, 0x04, 0xe0, 0x03, 0x00,
   0x3f, 0x00, 0xc0, 0x13, 0x04, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13,
   0x04, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x04, 0xf0, 0xff, 0xff,
   0xff, 0xff, 0xff, 0x13, 0x04, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13,
   0x04, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x04, 0x7c, 0x00, 0x00,
   0x78, 0x00, 0x00, 0x10, 0x04, 0x7c, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x10,
   0x04, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x10, 0x04, 0x3e, 0x00, 0x00,
   0xf0, 0x01, 0x00, 0x10, 0x04, 0x1e, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x10,
   0x04, 0x1f, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x10, 0x04, 0x0f, 0x00, 0x00,
   0xe0, 0x03, 0x00, 0x10, 0x84, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
   0x84, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x84, 0x7f, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x10, 0xc4, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
   0xc4, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xe4, 0x7f, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
   0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x10, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  };

void bitmap(void) {
  // graphic commands to redraw the complete screen should be placed here  
  u8g.drawXBMP( 88, 32, AL_logo_width, AL_logo_height, AL_logo_bits);
}

void u8g_prepare(void) {
  u8g.setFont(u8g_font_6x10);
  u8g.setFontRefHeightExtendedText();
  u8g.setDefaultForegroundColor();
  u8g.setFontPosTop();
}

void u8g_box_frame(uint8_t a) {
  u8g.drawStr( 2, 2, "drawBox");
  u8g.drawBox(105-a*15,56-a*8,30+a*30,16+a*16);

}

void u8g_frame(uint8_t a) {
  u8g.drawStr( 2, 2, "drawFrame");
  u8g.drawFrame(0,0,240,128);
}

void u8g_frame_move(uint8_t a)  {
  u8g.drawFrame(0+a*8,0+a*8,240-a*16,128-a*16);
}

void u8g_string(uint8_t a) {
  u8g.drawStr( 2, 2, "drawStringDegree");
  u8g.drawStr(120+a,64, " 0");
  u8g.drawStr90(120,64+a, " 90");
  u8g.drawStr180(120-a,64, " 180");
  u8g.drawStr270(120,64-a, " 270");
}

void u8g_line(uint8_t a) {
  u8g.drawStr( 0, 0, "drawLine");
  u8g.drawLine(7+a, 10, 30, 128);
  u8g.drawLine(7+a*2, 10, 60, 128);
  u8g.drawLine(7+a*3, 10, 90, 128);
  u8g.drawLine(7+a*4, 10, 120, 128);
}

void u8g_ascii_1() {
  char s[2] = " ";
  uint8_t x, y;
  u8g.drawStr( 0, 0, "ASCII page 1");
  for( y = 0; y < 6; y++ ) {
    for( x = 0; x < 16; x++ ) {
      s[0] = y*16 + x + 32;
      u8g.drawStr(x*7, y*10+10, s);
    }
  }
}

void u8g_ascii_2() {
  char s[2] = " ";
  uint8_t x, y;
  u8g.drawStr( 0, 0, "ASCII page 2");
  for( y = 0; y < 6; y++ ) {
    for( x = 0; x < 16; x++ ) {
      s[0] = y*16 + x + 160;
      u8g.drawStr(x*7, y*10+10, s);
    }
  }
}

void u8g_extra_page(uint8_t a)
{
  if ( u8g.getMode() == U8G_MODE_HICOLOR || u8g.getMode() == U8G_MODE_R3G3B2) {
    /* draw background (area is 128x128) */
    u8g_uint_t r, g, b;
    b = a << 5;
    for( g = 0; g < 128; g++ )
    {
      for( r = 0; r < 128; r++ )
      {
  u8g.setRGB(r<<2, g<<2, b );
  u8g.drawPixel(g, r);
      }
    }
    u8g.setRGB(255,255,255);
    u8g.drawStr( 66, 0, "Color Page");
  }
  else if ( u8g.getMode() == U8G_MODE_GRAY2BIT )
  {
    u8g.drawStr( 66, 0, "Gray Level");
    u8g.setColorIndex(1);
    u8g.drawBox(0, 4, 64, 32);    
    u8g.drawBox(70, 20, 4, 12);
    u8g.setColorIndex(2);
    u8g.drawBox(0+1*a, 4+1*a, 64-2*a, 32-2*a);
    u8g.drawBox(74, 20, 4, 12);
    u8g.setColorIndex(3);
    u8g.drawBox(0+2*a, 4+2*a, 64-4*a, 32-4*a);
    u8g.drawBox(78, 20, 4, 12);
  }
  else
  {
    u8g.setScale2x2();
    u8g.drawStr( 45, 20+a, "HELLO");
    u8g.undoScale();
  }
}

uint8_t draw_state = 0;

void draw(void) {
  u8g_prepare();
  switch(draw_state >> 3) {
    case 0: u8g_box_frame(draw_state&7); break;
    case 1: u8g_frame(draw_state&7); break;
    case 2: u8g_frame_move(draw_state&7); break;
    case 3: u8g_line(draw_state&7); break;
    case 4: u8g_ascii_1(); break;
    case 5: u8g_ascii_2(); break;
    case 6: u8g_string(draw_state&7); break;
    case 7: u8g_extra_page(draw_state&7); break;
    case 8: bitmap(); break;
  }
}

void setup(void) {

  // flip screen, if required
  //u8g.setRot180();

#if defined(ARDUINO)
  pinMode(13, OUTPUT);           
  digitalWrite(13, HIGH);  
#endif
}

void loop(void) {
  
  // picture loop  
  u8g.firstPage();  
  do {
    draw();
  } while( u8g.nextPage() );
  
  // increase the state
  draw_state++;
  if ( draw_state >= 9*8 )
    draw_state = 0;
  
  // rebuild the picture after some delay
  //delay(150);

}
Nimate dovoljenj za ogled prilog tega prispevka.
tehnologija za prihodnost.

www.algenera.com