The Godfather talking
You think I am funny guy huh?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 09, 2016, 10:15:28 22:15


Login with username, password and session length


Pages: [1]
Print
Author Topic: OSD020AMQCIF-C OLED Display problem?  (Read 1610 times)
0 Members and 1 Guest are viewing this topic.
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« on: April 05, 2010, 04:49:58 04:49 »

do'not any display?help me.
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//   CPU   :LPC2214
//    Model Number:OSD020AMQCIF-C    
//    Dot Matrix: 176RGB*220
//    Driver IC : S6E63D6  
//    Interface : 18-bit 80XX Parallel
//    Revision  :
//    Date      : 2010/03/20
//    Author    :
//    Editor    :
//
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#include "config.h"
#include "picture.h"

//#define GLCD_MODE_6800    // 18-bit 68XX Parallel
          //   SPB=0; ID_MIB=1
#define OLCD_MODE_8080     // 18-bit 80XX Parallel
         //   SPB=0; ID_MIB=0
//#define SPI       // 4-wire SPI
         //   SPB=1; ID_MIB=X

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//  Pin Definition
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#define xData IO2SET //P2     Parallel Data Input/Output

#define LED           1<<29 //P0.29  LED
#define OLED_RES  1<<15 //P0.15  Reset
#define Flash_CS      1<<0            //P1.0
#define SRAM_CS       1<<26           //P3.26
#define OLED_HVEN  1<<24 //P0.24  

#define OLED_CS     1<<25 //P3.25  Chip Select
#define OLED_DC     1<<2 //P3.2   A0 Data/Command Control
#define OLED_WR     1<<27 //P3.27  Read/Write Select
#define OLED_RD     1<<1 //P1.1   E Select

//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//  Delay Time
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void uDelay(unsigned char l)
{
while(l--);
}
void Delay(unsigned char n)
{
unsigned char i,j,k;

for(k=0;k<n;k++)
{
for(i=0;i<131;i++)
{
for(j=0;j<15;j++)
{
uDelay(203);
}
}
}
}

void Write_Command(unsigned short Data)
{
  #ifdef OLCD_MODE_8080
           IO1SET=OLED_RD;   //RD=E=1               RD high for writing
IO3CLR=OLED_DC;   //A0=RS=DD/C=OLED/C=0  setup for command
IO3CLR=OLED_CS;   //CS=0
IO3CLR=OLED_WR;   //RW=WRB=0             write low starts write sequence
IO2PIN=Data;      //xData=Data;
uDelay(250);
IO3SET=OLED_WR;   //WR=1                 de-assert write
IO3SET=OLED_CS;   //CS=1
IO3SET=OLED_DC;   //A0=RS=DD/C=OLED/C=1
IO1SET=OLED_RD;   //E=1                  RD high for writing
uDelay(250);


  #elif OLCD_MODE_6800  
IO3CLR=OLED_DC;   //DC=0;A0
IO3CLR=OLED_CS;   //CS=0;
IO3CLR=OLED_WR;   //RW=0;
IO1SET=OLED_RD;   //E=1;
IO2PIN=Data;      //xData=Data;
uDelay(300);
IO1CLR=OLED_RD;   //E=0;
IO3SET=OLED_CS;   //CS=1;
IO3CLR=OLED_WR;   //RW=0;
IO3SET=OLED_DC;   //DC=1;
uDelay(300);
  #endif
}

void Write_Data(unsigned long Data)
{  
  #ifdef OLCD_MODE_8080

           IO1SET=OLED_RD;   //E=1                   RD high for writing
IO3SET=OLED_DC;   //A0=RS=DD/C=OLED/C=1   setup for Data
IO3CLR=OLED_CS;   //CS=0
IO3CLR=OLED_WR;   //WR=0                  write low starts write sequence
IO2PIN=Data;      //xData=Data;
uDelay(300);
IO3SET=OLED_WR;   //WR=1                  de-assert write
IO3SET=OLED_CS;   //CS=1
IO3SET=OLED_DC;   //A0=RS=DD/C=OLED/C=1
IO1SET=OLED_RD;   //E=1                   RD high for writing
uDelay(300);

  #elif OLCD_MODE_6800
IO3SET=OLED_DC;   //DC=1;A0=RS  setup for Data
IO3CLR=OLED_CS;   //CS=0;
IO3CLR=OLED_WR;   //RW=0;
IO1SET=OLED_RD;   //E=1;
IO2PIN=Data;      //xData=Data;
uDelay(300);
IO1CLR=OLED_RD;   //E=0;
IO3SET=OLED_CS;   //CS=1;
IO3CLR=OLED_WR;   //RW=0;
IO3SET=OLED_DC;   //DC=1;
uDelay(300);

  #endif
    
}
  
 /********************************************************/  
void OLED_display_picture(uint8 const picture[])  
{  unsigned short H_start_address,H_end_address,Temp;
uint8 j;  
uint8 I;  
  
          H_start_address=0x20;
          H_end_address=0xAF + H_start_address;
          Temp = (H_start_address << Cool | H_end_address;

Write_Command(0x0035);
Write_Data(0x0000); // V_start_address

Write_Command(0x0036);
Write_Data(0x00DB); // V_end_address

Write_Command(0x0037);
Write_Data(Temp); //  

Write_Command(0x0020);
Write_Data(H_start_address); // H_start_address

Write_Command(0x0021);  
Write_Data(0x0000); //  

           Write_Command(0x0022);
for(I=0;I<176*220;I++)  // 176*rgb*220 image data
           {
   uDelay(30);
   Write_Data(0x3F000); // red display    
   }
// for(i=0;i<100;i++)     //
//    for(j=0;j<220;j++)  
// {  
//  uDelay(5);
 //Temp=((picture[j+(i*220)]<<Cool+(picture[j++ +(i*220)]));
//  Write_Data(0x3F000);  
// }      
}  


void OLED_Init(void)
{
   unsigned short H_start_address,H_end_address,Temp,I;

Write_Command(0x0023);
//Write_Data(0x0000); //  
Write_Command(0x0002);
Write_Data(0x0000); //  

Write_Command(0x0003);
Write_Data(0x8130); // 18bit mode

Write_Command(0x0010);
Write_Data(0x0000); // IC stand by off

Write_Command(0x0070);
Write_Data(0x3300); //
  
Write_Command(0x0071);
Write_Data(0x3900); //  

Write_Command(0x0072);
Write_Data(0x3800); //  

Write_Command(0x0073);
Write_Data(0x2924); //  

Write_Command(0x0074);
Write_Data(0x261C); //  

Write_Command(0x0075);
Write_Data(0x3125); //

Write_Command(0x0076);  
Write_Data(0x271C); //  

Write_Command(0x0077);
Write_Data(0x352A); //  

Write_Command(0x0078);
Write_Data(0x2A1E); //

Write_Command(0x0018);
Write_Data(0x0028); // Frame Rate=80Hz

Write_Command(0x00f8);
Write_Data(0x000F); // VGH=+5V

Write_Command(0x000f9);
Write_Data(0x0019); // VGL=-7V
  //*****************************************************
H_start_address=0x20;
           H_end_address=0xAF + H_start_address;
           Temp = (H_start_address << Cool | H_end_address;

Write_Command(0x0035);
Write_Data(0x0000);     // V_start_address

Write_Command(0x0036);
Write_Data(0x00DB);     // V_end_address

Write_Command(0x0037);
Write_Data(Temp);       //  

Write_Command(0x0020);
Write_Data(H_start_address); // H_start_address

Write_Command(0x0021);  
Write_Data(0x0000);     //  

           Write_Command(0x0022);
for(I=0;I<176*220;I++)  // 176*rgb*220 image data
           {
   uDelay(30);
   Write_Data(0x00000); // rgb image datra 18bit    
   }

Write_Command(0x0005);
Write_Data(0x0001);     // Display On  

 }
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//  Main Program
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
int main()
  {
PINSEL0=0x00000005;  
PINSEL1=0x00000000;
PINSEL2=0x00000030;
           IO0DIR =0xffffffff;
IO1DIR =0xffffffff;

IO2DIR =0xffffffff;
IO3DIR =0xffffffff;
Delay(50);
IO0SET =LED;
IO0SET =OLED_HVEN;    
IO1SET =Flash_CS;
IO3SET =SRAM_CS;    
IO3SET=OLED_CS;

IO1SET=OLED_RD;  //E=0;
IO3SET=OLED_WR;  //RW=1;
IO3SET=OLED_CS;  //CS=1;
IO3SET=OLED_DC;  //DC=A0=1;
      
OLED_Init();

while(1)
{
  OLED_display_picture(Bmp001); //temp test use
  Delay(10);
 }
}
« Last Edit: April 06, 2010, 06:01:41 06:01 by xzb » Logged
xzb
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 16
-Receive: 5


« Reply #1 on: April 09, 2010, 04:19:41 04:19 »

ok,new no problem.
data bus no map.
Logged
bobcat1
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 1126
-Receive: 29


« Reply #2 on: April 10, 2010, 12:37:23 12:37 »

Hi

from my experience OLED display are a slow device - so use a lot of delay

Check interface by writing and reading from a scrap register (a register taht can be written and read )

All the best

Bobi 
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC