Forum: Mikrocontroller und Digitale Elektronik LPC2478 und STN Mono Dual Scan LCD


von Frank K. (fchk)


Lesenswert?

Hallo!

Ich habe eine schlaflose Nacht hinter mir. Ich möchte ein stinknormales 
Monochrom-LCD an einem LPC2478 betreiben, aber irgendwie bekomme ich 
keine Clocks. Beispiele für TFTs gibt es genug, aber Monochrom-Displays 
scheinen aus der Mode gekommen zu sein.

Das Display ist ein Sharp 64K101 (Pollin 120 623) mit 640*480 Pixel 
Dual-Scan, das ich mit 1 Bit per Pixel (also nur rein schwarz/weiss für 
Textdarstellung) betreiben will.

Meine Initialisierung:
1
  GpioInit();
2
  // Memory Accelerator Module init
3
  MAMCR_bit.MODECTRL = 0;
4
  MAMTIM_bit.CYCLES  = 3;   // FCLK > 40 MHz
5
  MAMCR_bit.MODECTRL = 2;   // MAM functions fully enabled
6
  // Init clock
7
  InitClock();
8
9
#define C_GLCD_H_SIZE           640
10
#define C_GLCD_H_PULSE          4
11
#define C_GLCD_H_FRONT_PORCH    6
12
#define C_GLCD_H_BACK_PORCH     6
13
#define C_GLCD_V_SIZE           480
14
#define C_GLCD_V_PULSE          1
15
#define C_GLCD_V_FRONT_PORCH    1
16
#define C_GLCD_V_BACK_PORCH     1
17
#define C_GLCD_CLK_PER_LINE     (C_GLCD_H_SIZE/4 + C_GLCD_H_PULSE + C_GLCD_H_FRONT_PORCH + C_GLCD_H_BACK_PORCH)
18
#define C_GLCD_LINES_PER_FRAME  (C_GLCD_V_SIZE/2 + C_GLCD_V_PULSE + C_GLCD_V_FRONT_PORCH + C_GLCD_V_BACK_PORCH)
19
#define C_GLCD_PIX_CLK          (6500000UL)
20
#define C_GLCD_ENA_DIS_DLY      10000
21
22
#define VGAADDR_U 0x40006a00
23
#define VGAADDR_L 0x4000b500
24
25
  // Init GLCD controller
26
  PINSEL11_bit.LCDM=2;      // 4Bit Mono STN Dual
27
  PINSEL11_bit.LCDPE=1;     // LCD Enabled
28
  PCONP_bit.PCLCD = 1;      // enable LCD controller clock
29
  CRSR_CTRL_bit.CrsrOn = 0; // Disable cursor
30
  LCD_CTRL_bit.LcdEn = 0;   // disable GLCD controller
31
  LCD_CTRL_bit.LcdBpp= 0;   // 1 bpp
32
  LCD_CTRL_bit.LcdBW=  1;   // monochrome
33
  LCD_CTRL_bit.LcdTFT= 0;   // STN panel
34
  LCD_CTRL_bit.LcdMono8=0;  // 8 Bit Interface
35
  LCD_CTRL_bit.LcdDual=1;   // dual panel
36
  LCD_CTRL_bit.BGR   = 0;   // RGB order
37
  LCD_CTRL_bit.BEBO  = 0;   // little endian byte order
38
  LCD_CTRL_bit.BEPO  = 0;   // little endian pix order
39
  LCD_CTRL_bit.LcdPwr= 0;   // disable power
40
  LCD_CTRL_bit.LcdVComp=0;  // no irq
41
  LCD_CTRL_bit.WATERMARK=0;
42
43
  // init pixel clock
44
  temp=(SYS_GetFsclk() / (Int32U)C_GLCD_PIX_CLK);
45
  LCD_CFG_bit.CLKDIV =  temp;
46
  LCD_POL_bit.CLKSEL = 0;   // clock source for the LCD block is CCLK
47
  LCD_POL_bit.ACB    = 0;   // AC Bias not used
48
  LCD_POL_bit.IVS    = 0;   // LCDFP pin is active HIGH
49
  LCD_POL_bit.IHS    = 0;   // LCDLP pin is active HIGH
50
  LCD_POL_bit.IPC    = 0;   // Data is driven out into the LCD on the rising edge
51
  LCD_POL_bit.IOE    = 0;   // no Invert Output Enable
52
  LCD_POL_bit.CPL    = C_GLCD_CLK_PER_LINE-1;
53
  LCD_POL_bit.BCD    = 0;   // bypass internal clk divider
54
  LCD_POL_bit.PCD_LO = 6;   // Dual Panel Mono: /8
55
  LCD_POL_bit.PCD_HI = 0;
56
  // init Horizontal Timing
57
  LCD_TIMH_bit.HBP   =  C_GLCD_H_BACK_PORCH - 1;
58
  LCD_TIMH_bit.HFP   =  C_GLCD_H_FRONT_PORCH - 1;
59
  LCD_TIMH_bit.HSW   =  C_GLCD_H_PULSE - 1;
60
  LCD_TIMH_bit.PPL   =  (C_GLCD_H_SIZE/(16*4)) - 1;
61
  // init Vertical Timing
62
  LCD_TIMV_bit.VBP   =  C_GLCD_V_BACK_PORCH;
63
  LCD_TIMV_bit.VFP   =  C_GLCD_V_FRONT_PORCH;
64
  LCD_TIMV_bit.VSW   =  C_GLCD_V_PULSE;
65
  LCD_TIMV_bit.LPP   =  (C_GLCD_V_SIZE/2) - 1;
66
  // Frame Base Address doubleword aligned
67
  LCD_UPBASE         =  VGAADDR_U;
68
  LCD_LPBASE         =  VGAADDR_L;
69
70
  for(volatile Int32U i = C_GLCD_ENA_DIS_DLY; i; i--);
71
  LCD_CTRL_bit.LcdEn = 1;   //Enable LCD
72
  for(volatile Int32U i = C_GLCD_ENA_DIS_DLY; i; i--);
73
  LCD_CTRL_bit.LcdPwr= 1;   // enable Power
74
  for(volatile Int32U i = C_GLCD_ENA_DIS_DLY; i; i--);
75
  FIO1SET=(1<<L_EN_VLCD);   // enable VLCD -18V

Was mich stutzig macht: Wenn ich LCD_POL_bit.BCD auf 1 setze, habe ich 
meinen gewünschten Pixeltakt, aber weder HSYNC noch VSYNC. Dass die Pins 
richtig sind, habe ich dadurch festgestellt, indem ich mal in LCD_POL 
die IHS und IVS Bits gesetzt habe, wodurch sich der Pegel auf den 
entsprechenden Pins geändert hat.

CPU-Clock ist 72 MHz, erzeugt mit einem 12 MHz Quarz. Der ist 
augenscheinlich da, am Quarz messe ich jedenfalls meine 12 MHz.

Hat hier jemand eine Idee?

fchk

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.