ورود به حساب ثبت نام جدید فراموشی کلمه عبور
برای ورود به حساب کاربری خود، نام کاربری و کلمه عبورتان را در زیر وارد کرده و روی «ورود به سایت» کلیک کنید.





اگر فرم ثبت نام برای شما نمایش داده نمی‌شود، اینجا را کلیک کنید.









اگر فرم بازیابی کلمه عبور برای شما نمایش داده نمی‌شود، اینجا را کلیک کنید.





کاربران برچسب زده شده

نمایش نتایج: از 1 به 8 از 8
  1. #1
    2011/04/05
    تهران
    61
    0

    راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    سلام به همه.
    از دوستان کسي مثال راه اندازي اين ال سي دي را با 1768 داره.فقط ميخوام ال سي دي روشن بشه و يک عکس را روش نمايش بدم.خيلي واجبه.
    پيشاپيش از راهنمايي شما ممنون
    :angry:
    راه را راهبر قرار مده،بلکه راهي ناپيموده را آغاز کن و از خود راهي بر جاي بگذار.
  2. #2
    2012/05/30
    کرمان
    793
    19

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    سلام.
    مثال برای این lcd حتی از lcd کاراکتری هم بیشتره.نمیتونی ازشون جواب بگیری؟
    8 بیتی میخاهی راه اندازی کنی یا 16 بیتی؟
    تولید کننده انواع تابلو فرمان آسانسور با تکنولوژی روز دنیا
  3. #3
    2011/04/05
    تهران
    61
    0

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    نقل قول نوشته اصلی توسط mehdi_nxp
    سلام.
    مثال براي اين lcd حتي از lcd کاراکتري هم بيشتره.نميتوني ازشون جواب بگيري؟
    8 بيتي ميخاهي راه اندازي کني يا 16 بيتي؟
    سلام،
    16 بيتي
    برنامه ها را که اجرا مي کنم فقط ال سي دي روشن ميشه و سفيد ميمونه.
    اگر امکان داره يک پروژه ساده که فقط ال سي دي روشن بشه و يک عکس را نمايش بده با شماتيک بذاريد خيلي ممنون ميشم
    راه را راهبر قرار مده،بلکه راهي ناپيموده را آغاز کن و از خود راهي بر جاي بگذار.
  4. #4
    2012/05/30
    کرمان
    793
    19

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    شما این هدر رو به پروژه اضافه کن.
    پایه های کنترلی که اول هدر مشخصه که باید به کجا وصل بشن.
    پایه های دیتا هم از پایه 14 پورت 1 شروع میشن تا 29.

    کد:
    #ifndef _TFTLCD_FUNCTIONS_H_
    #define _TFTLCD_FUNCTIONS_H_
    
    
    #define TFTLCD_RST_LOW         LPC_GPIO1->FIOCLR=1<<10;
    #define TFTLCD_RST_HIGH        LPC_GPIO1->FIOSET=1<<10;
    #define TFTLCD_RS_LOW         LPC_GPIO1->FIOCLR=1<<8;
    #define TFTLCD_RS_HIGH         LPC_GPIO1->FIOSET=1<<8;
    #define TFTLCD_CS_LOW         LPC_GPIO1->FIOCLR=1<<9;
    #define TFTLCD_CS_HIGH         LPC_GPIO1->FIOSET=1<<9;
    #define TFTLCD_RD_LOW         LPC_GPIO1->FIOCLR=1<<1;
    #define TFTLCD_RD_HIGH         LPC_GPIO1->FIOSET=1<<1;
    #define TFTLCD_WR_LOW         LPC_GPIO1->FIOCLR=1<<4;
    #define TFTLCD_WR_HIGH         LPC_GPIO1->FIOSET=1<<4;
    
    /* LCD Command Codes */
    #define TS_INS_START_OSC      0x00
    #define TS_INS_DRIV_OUT_CTRL    0x01
    #define TS_INS_DRIV_WAV_CTRL    0x02
    #define TS_INS_ENTRY_MOD      0x03
    #define TS_INS_RESIZE_CTRL     0x04
    #define TS_INS_DISP_CTRL1      0x07
    #define TS_INS_DISP_CTRL2      0x08
    #define TS_INS_DISP_CTRL3      0x09
    #define TS_INS_DISP_CTRL4      0x0A
    #define TS_INS_RGB_DISP_IF_CTRL1  0x0C
    #define TS_INS_FRM_MARKER_POS    0x0D
    #define TS_INS_RGB_DISP_IF_CTRL2  0x0F
    #define TS_INS_POW_CTRL1      0x10
    #define TS_INS_POW_CTRL2      0x11
    #define TS_INS_POW_CTRL3      0x12
    #define TS_INS_POW_CTRL4      0x13
    #define TS_INS_GRAM_HOR_AD     0x20
    #define TS_INS_GRAM_VER_AD     0x21
    #define TS_INS_RW_GRAM       0x22
    #define TS_INS_POW_CTRL7      0x29
    #define TS_INS_FRM_RATE_COL_CTRL  0x2B
    #define TS_INS_GAMMA_CTRL1     0x30
    #define TS_INS_GAMMA_CTRL2     0x31
    #define TS_INS_GAMMA_CTRL3     0x32
    #define TS_INS_GAMMA_CTRL4     0x35 
    #define TS_INS_GAMMA_CTRL5     0x36
    #define TS_INS_GAMMA_CTRL6     0x37
    #define TS_INS_GAMMA_CTRL7     0x38
    #define TS_INS_GAMMA_CTRL8     0x39
    #define TS_INS_GAMMA_CTRL9     0x3C
    #define TS_INS_GAMMA_CTRL10     0x3D
    #define TS_INS_HOR_START_AD     0x50
    #define TS_INS_HOR_END_AD      0x51
    #define TS_INS_VER_START_AD     0x52
    #define TS_INS_VER_END_AD      0x53
    #define TS_INS_GATE_SCAN_CTRL1   0x60
    #define TS_INS_GATE_SCAN_CTRL2   0x61
    #define TS_INS_GATE_SCAN_CTRL3   0x6A
    #define TS_INS_PART_IMG1_DISP_POS  0x80
    #define TS_INS_PART_IMG1_START_AD  0x81
    #define TS_INS_PART_IMG1_END_AD   0x82
    #define TS_INS_PART_IMG2_DISP_POS  0x83
    #define TS_INS_PART_IMG2_START_AD  0x84
    #define TS_INS_PART_IMG2_END_AD   0x85
    #define TS_INS_PANEL_IF_CTRL1    0x90
    #define TS_INS_PANEL_IF_CTRL2    0x92
    #define TS_INS_PANEL_IF_CTRL3    0x93
    #define TS_INS_PANEL_IF_CTRL4    0x95
    #define TS_INS_PANEL_IF_CTRL5    0x97
    #define TS_INS_PANEL_IF_CTRL6    0x98      
    
    #define TS_SIZE_X          240
    #define TS_SIZE_Y          320
    #define TS_VAL_ENTRY_MOD      0x0030
    #define TS_INS_GRAM_ADX       TS_INS_GRAM_HOR_AD
    #define TS_INS_GRAM_ADY       TS_INS_GRAM_VER_AD
    #define TS_INS_START_ADX      TS_INS_HOR_START_AD
    #define TS_INS_END_ADX       TS_INS_HOR_END_AD
    #define TS_INS_START_ADY      TS_INS_VER_START_AD
    #define TS_INS_END_ADY       TS_INS_VER_END_AD
    
    
    #define RED             0x001F
    #define GREEN            0x07E0
    #define BLUE            0xF800
    #define YELLOW           0x07FF
    #define PURPLE           0xF81F
    #define BLACK            0x0000
    #define WHITE            0xFFFF
    
    #define HIGH 1
    #define LOW 0
    
    
    //***************************************************************
    void tftlcd_write_index_register(int command)
    	{
    	TFTLCD_RS_LOW;
    	LPC_GPIO1->FIOCLR=0xffff<<14;
    	LPC_GPIO1->FIOSET=command<<14;
    	TFTLCD_CS_LOW;
    	TFTLCD_CS_HIGH;
    	LPC_GPIO1->FIOCLR=0xffff<<14;
    	TFTLCD_RS_HIGH;
    	}
    //***************************************************************
    void tftlcd_write_wdr(int data)
    	{
    	LPC_GPIO1->FIOCLR=0xffff<<14;
    	LPC_GPIO1->FIOSET=data<<14;
    	TFTLCD_CS_LOW;
      TFTLCD_CS_HIGH;
    	}
    //***************************************************************
    void tftlcd_write_command(int index,int argument)
    	{
    	tftlcd_write_index_register(index);
    	tftlcd_write_wdr(argument);
    	}
    //***************************************************************
    void tftlcd_clear(int co)
    	{
    	int counter;
    
      tftlcd_write_index_register(TS_INS_START_ADX);
      tftlcd_write_wdr(0);
      tftlcd_write_index_register(TS_INS_END_ADX);
      tftlcd_write_wdr(239);
      tftlcd_write_index_register(TS_INS_GRAM_ADX);
      tftlcd_write_wdr(0);
      tftlcd_write_index_register(TS_INS_START_ADY);
      tftlcd_write_wdr(0);
      tftlcd_write_index_register(TS_INS_END_ADY);
      tftlcd_write_wdr(319);
    	tftlcd_write_index_register(TS_INS_GRAM_ADY);
      tftlcd_write_wdr(319);
    
      tftlcd_write_index_register(TS_INS_RW_GRAM);
    
      for(counter = 0;counter < 76800;counter++)
        tftlcd_write_wdr(co);
    	}
    //***************************************************************
    void tftlcd_init(void)
    	{
    	TFTLCD_RST_HIGH;
    	TFTLCD_CS_HIGH;
    	TFTLCD_RD_HIGH;
    	TFTLCD_WR_LOW;
      // Reset LCD Chipset
      TFTLCD_RST_LOW;
      delay_ms(50);
      TFTLCD_RST_HIGH;
      delay_ms(50);
    
    		tftlcd_write_index_register(0x00E3);
    		tftlcd_write_wdr(0x3008); 					//set the internal timing
    		tftlcd_write_index_register(0x00E7);
    		tftlcd_write_wdr(0x0012); 					//set the internal timing
    		tftlcd_write_index_register(0x00EF);
    		tftlcd_write_wdr(0x1231); 					//set the internal timing
    		tftlcd_write_index_register(TS_INS_START_OSC);
    		tftlcd_write_wdr(0x0001); 					//start oscillator
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_DRIV_OUT_CTRL);
    		tftlcd_write_wdr(0x0000); 					//set SS, SM
    		tftlcd_write_index_register(TS_INS_DRIV_WAV_CTRL);
    		tftlcd_write_wdr(0x0700); 					//set 1 line inversion
    
    		tftlcd_write_index_register(TS_INS_ENTRY_MOD);
    		tftlcd_write_wdr(TS_VAL_ENTRY_MOD);			//set GRAM write direction, BGR=0
    
    		tftlcd_write_index_register(TS_INS_RESIZE_CTRL);
    		tftlcd_write_wdr(0x0000); 					//no resizing
    
    		tftlcd_write_index_register(TS_INS_DISP_CTRL2);
    		tftlcd_write_wdr(0x0202); 					//front & back porch periods = 2
    		tftlcd_write_index_register(TS_INS_DISP_CTRL3);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_DISP_CTRL4);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_RGB_DISP_IF_CTRL1);
    		tftlcd_write_wdr(0x0000); 					//select system interface
    		tftlcd_write_index_register(TS_INS_FRM_MARKER_POS);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_RGB_DISP_IF_CTRL2);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL1);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_POW_CTRL2);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_POW_CTRL3);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_POW_CTRL4);
    		tftlcd_write_wdr(0x0000);
    		delay_ms(200);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL1);
    		tftlcd_write_wdr(0x1690);
    		tftlcd_write_index_register(TS_INS_POW_CTRL2);
    		tftlcd_write_wdr(0x0227); //tftlcd_write_wdr(0x0137);
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL3);
    		tftlcd_write_wdr(0x001A); //tftlcd_write_wdr(0x013C);
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL4);
    		tftlcd_write_wdr(0x1800); //tftlcd_write_wdr(0x1400);
    		tftlcd_write_index_register(TS_INS_POW_CTRL7);
    		tftlcd_write_wdr(0x002A); //tftlcd_write_wdr(0x0007);
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_GRAM_HOR_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_GRAM_VER_AD);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL1);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL2);
    		tftlcd_write_wdr(0x0605);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL3);
    		tftlcd_write_wdr(0x0106);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL4);
    		tftlcd_write_wdr(0x0206);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL5);
    		tftlcd_write_wdr(0x0808);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL6);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL7);
    		tftlcd_write_wdr(0x0201);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL8);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL9);
    		tftlcd_write_wdr(0x0602);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL10);
    		tftlcd_write_wdr(0x0808);
    
    		tftlcd_write_index_register(TS_INS_HOR_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_HOR_END_AD);
    		tftlcd_write_wdr(0x00EF);
    		tftlcd_write_index_register(TS_INS_VER_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_VER_END_AD);
    		tftlcd_write_wdr(0x013F);
    		tftlcd_write_index_register(TS_INS_GATE_SCAN_CTRL1);
    		tftlcd_write_wdr(0xA700);
    		tftlcd_write_index_register(TS_INS_GATE_SCAN_CTRL2);
    		tftlcd_write_wdr(0x0001);
    		tftlcd_write_index_register(TS_INS_GATE_SCAN_CTRL3);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_PART_IMG1_DISP_POS);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG1_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG1_END_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG2_DISP_POS);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG2_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG2_END_AD);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL1);
    		tftlcd_write_wdr(0x0010);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL2);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL3);
    		tftlcd_write_wdr(0x0003);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL4);
    		tftlcd_write_wdr(0x0110);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL5);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL6);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_DISP_CTRL1);
    		tftlcd_write_wdr(0x0133);
    
    	tftlcd_clear(0xffff);
    	}
    //****************************************************************
    void tftlcd_write_pixel(int x,int y,int color)
      {
    	if(x < 0) x = 0;
    	if(y < 0) y = 0;
    	if(x > 239) x = 239;
    	if(y > 319) y = 319;
    
    
    	tftlcd_write_index_register(TS_INS_START_ADX);
      tftlcd_write_wdr(x);
      tftlcd_write_index_register(TS_INS_END_ADX);
      tftlcd_write_wdr(x);
      tftlcd_write_index_register(TS_INS_GRAM_ADX);
      tftlcd_write_wdr(x);
    
    	y = 319 - y;
    	y = 319 - y;
      tftlcd_write_index_register(TS_INS_START_ADY);
      tftlcd_write_wdr(y);
      tftlcd_write_index_register(TS_INS_END_ADY);
      tftlcd_write_wdr(y);
    	tftlcd_write_index_register(TS_INS_GRAM_ADY);
      tftlcd_write_wdr(y);
    
      tftlcd_write_index_register(TS_INS_RW_GRAM);
    
    	tftlcd_write_wdr(color);
      }
    
    //-----------------------------------------------------------------------
    // Show A Picture On The LCD Screen
    //-----------------------------------------------------------------------
    void tftlcd_write_pic(int x,int y,const unsigned short *pointer)
       {
    		int counter;
    
    
    
    	  tftlcd_write_index_register(TS_INS_START_ADX);
    	  tftlcd_write_wdr(0);
    	  tftlcd_write_index_register(TS_INS_END_ADX);
    	  tftlcd_write_wdr(239);
    	  tftlcd_write_index_register(TS_INS_GRAM_ADX);
    	  tftlcd_write_wdr(0);
    	  tftlcd_write_index_register(TS_INS_START_ADY);
    	  tftlcd_write_wdr(0);
    	  tftlcd_write_index_register(TS_INS_END_ADY);
    	  tftlcd_write_wdr(319);
    		tftlcd_write_index_register(TS_INS_GRAM_ADY);
    	  tftlcd_write_wdr(319);
    
    	  tftlcd_write_index_register(TS_INS_RW_GRAM);
    
    
    	  for(counter = 0;counter < 76800;counter++)
    	    tftlcd_write_wdr(pointer[counter]);
    
    
    
       }
    
    
    #endif
    فعلا قسمت عکس رو بیخیال شو و فعلا تو مین این رو بنویس.
    ببین صفحه قرمز میشه.

    کد:
    int main(void){
    
    LPC_GPIO1->FIODIR=0xffffffff;
    
    delay_ms(10);
    tftlcd_init();
     while(1) {
    	 tftlcd_clear(RED);
     }
    }
    تولید کننده انواع تابلو فرمان آسانسور با تکنولوژی روز دنیا
  5. #5
    2011/04/05
    تهران
    61
    0

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    نقل قول نوشته اصلی توسط mehdi_nxp
    شما اين هدر رو به پروژه اضافه کن.
    پايه هاي کنترلي که اول هدر مشخصه که بايد به کجا وصل بشن.
    پايه هاي ديتا هم از پايه 14 پورت 1 شروع ميشن تا 29.

    کد:
    #ifndef _TFTLCD_FUNCTIONS_H_
    #define _TFTLCD_FUNCTIONS_H_
    
    
    #define TFTLCD_RST_LOW         LPC_GPIO1->FIOCLR=1<<10;
    #define TFTLCD_RST_HIGH        LPC_GPIO1->FIOSET=1<<10;
    #define TFTLCD_RS_LOW         LPC_GPIO1->FIOCLR=1<<8;
    #define TFTLCD_RS_HIGH         LPC_GPIO1->FIOSET=1<<8;
    #define TFTLCD_CS_LOW         LPC_GPIO1->FIOCLR=1<<9;
    #define TFTLCD_CS_HIGH         LPC_GPIO1->FIOSET=1<<9;
    #define TFTLCD_RD_LOW         LPC_GPIO1->FIOCLR=1<<1;
    #define TFTLCD_RD_HIGH         LPC_GPIO1->FIOSET=1<<1;
    #define TFTLCD_WR_LOW         LPC_GPIO1->FIOCLR=1<<4;
    #define TFTLCD_WR_HIGH         LPC_GPIO1->FIOSET=1<<4;
    
    /* LCD Command Codes */
    #define TS_INS_START_OSC      0x00
    #define TS_INS_DRIV_OUT_CTRL    0x01
    #define TS_INS_DRIV_WAV_CTRL    0x02
    #define TS_INS_ENTRY_MOD      0x03
    #define TS_INS_RESIZE_CTRL     0x04
    #define TS_INS_DISP_CTRL1      0x07
    #define TS_INS_DISP_CTRL2      0x08
    #define TS_INS_DISP_CTRL3      0x09
    #define TS_INS_DISP_CTRL4      0x0A
    #define TS_INS_RGB_DISP_IF_CTRL1  0x0C
    #define TS_INS_FRM_MARKER_POS    0x0D
    #define TS_INS_RGB_DISP_IF_CTRL2  0x0F
    #define TS_INS_POW_CTRL1      0x10
    #define TS_INS_POW_CTRL2      0x11
    #define TS_INS_POW_CTRL3      0x12
    #define TS_INS_POW_CTRL4      0x13
    #define TS_INS_GRAM_HOR_AD     0x20
    #define TS_INS_GRAM_VER_AD     0x21
    #define TS_INS_RW_GRAM       0x22
    #define TS_INS_POW_CTRL7      0x29
    #define TS_INS_FRM_RATE_COL_CTRL  0x2B
    #define TS_INS_GAMMA_CTRL1     0x30
    #define TS_INS_GAMMA_CTRL2     0x31
    #define TS_INS_GAMMA_CTRL3     0x32
    #define TS_INS_GAMMA_CTRL4     0x35 
    #define TS_INS_GAMMA_CTRL5     0x36
    #define TS_INS_GAMMA_CTRL6     0x37
    #define TS_INS_GAMMA_CTRL7     0x38
    #define TS_INS_GAMMA_CTRL8     0x39
    #define TS_INS_GAMMA_CTRL9     0x3C
    #define TS_INS_GAMMA_CTRL10     0x3D
    #define TS_INS_HOR_START_AD     0x50
    #define TS_INS_HOR_END_AD      0x51
    #define TS_INS_VER_START_AD     0x52
    #define TS_INS_VER_END_AD      0x53
    #define TS_INS_GATE_SCAN_CTRL1   0x60
    #define TS_INS_GATE_SCAN_CTRL2   0x61
    #define TS_INS_GATE_SCAN_CTRL3   0x6A
    #define TS_INS_PART_IMG1_DISP_POS  0x80
    #define TS_INS_PART_IMG1_START_AD  0x81
    #define TS_INS_PART_IMG1_END_AD   0x82
    #define TS_INS_PART_IMG2_DISP_POS  0x83
    #define TS_INS_PART_IMG2_START_AD  0x84
    #define TS_INS_PART_IMG2_END_AD   0x85
    #define TS_INS_PANEL_IF_CTRL1    0x90
    #define TS_INS_PANEL_IF_CTRL2    0x92
    #define TS_INS_PANEL_IF_CTRL3    0x93
    #define TS_INS_PANEL_IF_CTRL4    0x95
    #define TS_INS_PANEL_IF_CTRL5    0x97
    #define TS_INS_PANEL_IF_CTRL6    0x98      
    
    #define TS_SIZE_X          240
    #define TS_SIZE_Y          320
    #define TS_VAL_ENTRY_MOD      0x0030
    #define TS_INS_GRAM_ADX       TS_INS_GRAM_HOR_AD
    #define TS_INS_GRAM_ADY       TS_INS_GRAM_VER_AD
    #define TS_INS_START_ADX      TS_INS_HOR_START_AD
    #define TS_INS_END_ADX       TS_INS_HOR_END_AD
    #define TS_INS_START_ADY      TS_INS_VER_START_AD
    #define TS_INS_END_ADY       TS_INS_VER_END_AD
    
    
    #define RED             0x001F
    #define GREEN            0x07E0
    #define BLUE            0xF800
    #define YELLOW           0x07FF
    #define PURPLE           0xF81F
    #define BLACK            0x0000
    #define WHITE            0xFFFF
    
    #define HIGH 1
    #define LOW 0
    
    
    //***************************************************************
    void tftlcd_write_index_register(int command)
    	{
    	TFTLCD_RS_LOW;
    	LPC_GPIO1->FIOCLR=0xffff<<14;
    	LPC_GPIO1->FIOSET=command<<14;
    	TFTLCD_CS_LOW;
    	TFTLCD_CS_HIGH;
    	LPC_GPIO1->FIOCLR=0xffff<<14;
    	TFTLCD_RS_HIGH;
    	}
    //***************************************************************
    void tftlcd_write_wdr(int data)
    	{
    	LPC_GPIO1->FIOCLR=0xffff<<14;
    	LPC_GPIO1->FIOSET=data<<14;
    	TFTLCD_CS_LOW;
      TFTLCD_CS_HIGH;
    	}
    //***************************************************************
    void tftlcd_write_command(int index,int argument)
    	{
    	tftlcd_write_index_register(index);
    	tftlcd_write_wdr(argument);
    	}
    //***************************************************************
    void tftlcd_clear(int co)
    	{
    	int counter;
    
      tftlcd_write_index_register(TS_INS_START_ADX);
      tftlcd_write_wdr(0);
      tftlcd_write_index_register(TS_INS_END_ADX);
      tftlcd_write_wdr(239);
      tftlcd_write_index_register(TS_INS_GRAM_ADX);
      tftlcd_write_wdr(0);
      tftlcd_write_index_register(TS_INS_START_ADY);
      tftlcd_write_wdr(0);
      tftlcd_write_index_register(TS_INS_END_ADY);
      tftlcd_write_wdr(319);
    	tftlcd_write_index_register(TS_INS_GRAM_ADY);
      tftlcd_write_wdr(319);
    
      tftlcd_write_index_register(TS_INS_RW_GRAM);
    
      for(counter = 0;counter < 76800;counter++)
        tftlcd_write_wdr(co);
    	}
    //***************************************************************
    void tftlcd_init(void)
    	{
    	TFTLCD_RST_HIGH;
    	TFTLCD_CS_HIGH;
    	TFTLCD_RD_HIGH;
    	TFTLCD_WR_LOW;
      // Reset LCD Chipset
      TFTLCD_RST_LOW;
      delay_ms(50);
      TFTLCD_RST_HIGH;
      delay_ms(50);
    
    		tftlcd_write_index_register(0x00E3);
    		tftlcd_write_wdr(0x3008); 					//set the internal timing
    		tftlcd_write_index_register(0x00E7);
    		tftlcd_write_wdr(0x0012); 					//set the internal timing
    		tftlcd_write_index_register(0x00EF);
    		tftlcd_write_wdr(0x1231); 					//set the internal timing
    		tftlcd_write_index_register(TS_INS_START_OSC);
    		tftlcd_write_wdr(0x0001); 					//start oscillator
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_DRIV_OUT_CTRL);
    		tftlcd_write_wdr(0x0000); 					//set SS, SM
    		tftlcd_write_index_register(TS_INS_DRIV_WAV_CTRL);
    		tftlcd_write_wdr(0x0700); 					//set 1 line inversion
    
    		tftlcd_write_index_register(TS_INS_ENTRY_MOD);
    		tftlcd_write_wdr(TS_VAL_ENTRY_MOD);			//set GRAM write direction, BGR=0
    
    		tftlcd_write_index_register(TS_INS_RESIZE_CTRL);
    		tftlcd_write_wdr(0x0000); 					//no resizing
    
    		tftlcd_write_index_register(TS_INS_DISP_CTRL2);
    		tftlcd_write_wdr(0x0202); 					//front & back porch periods = 2
    		tftlcd_write_index_register(TS_INS_DISP_CTRL3);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_DISP_CTRL4);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_RGB_DISP_IF_CTRL1);
    		tftlcd_write_wdr(0x0000); 					//select system interface
    		tftlcd_write_index_register(TS_INS_FRM_MARKER_POS);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_RGB_DISP_IF_CTRL2);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL1);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_POW_CTRL2);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_POW_CTRL3);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_POW_CTRL4);
    		tftlcd_write_wdr(0x0000);
    		delay_ms(200);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL1);
    		tftlcd_write_wdr(0x1690);
    		tftlcd_write_index_register(TS_INS_POW_CTRL2);
    		tftlcd_write_wdr(0x0227); //tftlcd_write_wdr(0x0137);
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL3);
    		tftlcd_write_wdr(0x001A); //tftlcd_write_wdr(0x013C);
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_POW_CTRL4);
    		tftlcd_write_wdr(0x1800); //tftlcd_write_wdr(0x1400);
    		tftlcd_write_index_register(TS_INS_POW_CTRL7);
    		tftlcd_write_wdr(0x002A); //tftlcd_write_wdr(0x0007);
    		delay_ms(50);
    
    		tftlcd_write_index_register(TS_INS_GRAM_HOR_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_GRAM_VER_AD);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL1);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL2);
    		tftlcd_write_wdr(0x0605);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL3);
    		tftlcd_write_wdr(0x0106);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL4);
    		tftlcd_write_wdr(0x0206);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL5);
    		tftlcd_write_wdr(0x0808);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL6);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL7);
    		tftlcd_write_wdr(0x0201);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL8);
    		tftlcd_write_wdr(0x0007);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL9);
    		tftlcd_write_wdr(0x0602);
    		tftlcd_write_index_register(TS_INS_GAMMA_CTRL10);
    		tftlcd_write_wdr(0x0808);
    
    		tftlcd_write_index_register(TS_INS_HOR_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_HOR_END_AD);
    		tftlcd_write_wdr(0x00EF);
    		tftlcd_write_index_register(TS_INS_VER_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_VER_END_AD);
    		tftlcd_write_wdr(0x013F);
    		tftlcd_write_index_register(TS_INS_GATE_SCAN_CTRL1);
    		tftlcd_write_wdr(0xA700);
    		tftlcd_write_index_register(TS_INS_GATE_SCAN_CTRL2);
    		tftlcd_write_wdr(0x0001);
    		tftlcd_write_index_register(TS_INS_GATE_SCAN_CTRL3);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_PART_IMG1_DISP_POS);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG1_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG1_END_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG2_DISP_POS);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG2_START_AD);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PART_IMG2_END_AD);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL1);
    		tftlcd_write_wdr(0x0010);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL2);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL3);
    		tftlcd_write_wdr(0x0003);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL4);
    		tftlcd_write_wdr(0x0110);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL5);
    		tftlcd_write_wdr(0x0000);
    		tftlcd_write_index_register(TS_INS_PANEL_IF_CTRL6);
    		tftlcd_write_wdr(0x0000);
    
    		tftlcd_write_index_register(TS_INS_DISP_CTRL1);
    		tftlcd_write_wdr(0x0133);
    
    	tftlcd_clear(0xffff);
    	}
    //****************************************************************
    void tftlcd_write_pixel(int x,int y,int color)
      {
    	if(x < 0) x = 0;
    	if(y < 0) y = 0;
    	if(x > 239) x = 239;
    	if(y > 319) y = 319;
    
    
    	tftlcd_write_index_register(TS_INS_START_ADX);
      tftlcd_write_wdr(x);
      tftlcd_write_index_register(TS_INS_END_ADX);
      tftlcd_write_wdr(x);
      tftlcd_write_index_register(TS_INS_GRAM_ADX);
      tftlcd_write_wdr(x);
    
    	y = 319 - y;
    	y = 319 - y;
      tftlcd_write_index_register(TS_INS_START_ADY);
      tftlcd_write_wdr(y);
      tftlcd_write_index_register(TS_INS_END_ADY);
      tftlcd_write_wdr(y);
    	tftlcd_write_index_register(TS_INS_GRAM_ADY);
      tftlcd_write_wdr(y);
    
      tftlcd_write_index_register(TS_INS_RW_GRAM);
    
    	tftlcd_write_wdr(color);
      }
    
    //-----------------------------------------------------------------------
    // Show A Picture On The LCD Screen
    //-----------------------------------------------------------------------
    void tftlcd_write_pic(int x,int y,const unsigned short *pointer)
       {
    		int counter;
    
    
    
    	  tftlcd_write_index_register(TS_INS_START_ADX);
    	  tftlcd_write_wdr(0);
    	  tftlcd_write_index_register(TS_INS_END_ADX);
    	  tftlcd_write_wdr(239);
    	  tftlcd_write_index_register(TS_INS_GRAM_ADX);
    	  tftlcd_write_wdr(0);
    	  tftlcd_write_index_register(TS_INS_START_ADY);
    	  tftlcd_write_wdr(0);
    	  tftlcd_write_index_register(TS_INS_END_ADY);
    	  tftlcd_write_wdr(319);
    		tftlcd_write_index_register(TS_INS_GRAM_ADY);
    	  tftlcd_write_wdr(319);
    
    	  tftlcd_write_index_register(TS_INS_RW_GRAM);
    
    
    	  for(counter = 0;counter < 76800;counter++)
    	    tftlcd_write_wdr(pointer[counter]);
    
    
    
       }
    
    
    #endif
    فعلا قسمت عکس رو بيخيال شو و فعلا تو مين اين رو بنويس.
    ببين صفحه قرمز ميشه.

    کد:
    int main(void){
    
    LPC_GPIO1->FIODIR=0xffffffff;
    
    delay_ms(10);
    tftlcd_init();
     while(1) {
    	 tftlcd_clear(RED);
     }
    }



    بازم خطا ميده،ميگه تابع تاخير ميلي ثانيه تعريف نشده.
    امکان داره فايل پروژه اي که خودتون اجرا کرديد را قراردهيد.مرسي
    راه را راهبر قرار مده،بلکه راهي ناپيموده را آغاز کن و از خود راهي بر جاي بگذار.
  6. #6
    2012/05/30
    کرمان
    793
    19

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    من با کمپایلر CoIDE کار میکنم.
    اگه کارتون راه میوفته که بدم.
    اون تابع میلی ثانیه هم خوب میشه این جوری دیگه.
    هرچند دقیق نیست ولی کار راه اندازه.
    کد:
    void delay_ms(int t){
     for(t=t*10000;t>0;t--);
    }
    تولید کننده انواع تابلو فرمان آسانسور با تکنولوژی روز دنیا
  7. #7
    2012/03/27
    چهارمحال و بختياري
    815
    13

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    سلام
    اين براي ال سي دي 3.2 اينچي هم جواب ميده؟
    [glow=red,2,300]برنامه هاي آموزشي تست شده براي NXP LPC1768 با توابع CMSIS[/glow]
    http://www.eca.ir/forum2/index.php?topic=76623.0
  8. #8
    2012/05/30
    کرمان
    793
    19

    پاسخ : راه اندازي ال سي دي ان 96 با ميکرو lpc1768

    نقل قول نوشته اصلی توسط Reza Sede
    سلام
    اين براي ال سي دي 3.2 اينچي هم جواب ميده؟
    سلام.
    با 3.2 اینچ تا حالا کار نکردم ولی

    مهمان عزیز شما حق دیدن لینک ها را ندارید

    عضویت

    کد براش هست.
    تولید کننده انواع تابلو فرمان آسانسور با تکنولوژی روز دنیا
نمایش نتایج: از 1 به 8 از 8

موضوعات مشابه

  1. کاليبره بودن dac ميکرو lpc1768
    توسط asadi11 در انجمن NXP
    پاسخ: 3
    آخرين نوشته: 2015/12/29, 12:49
  2. راه اندازي DMA در LPC1768
    توسط ajapyy در انجمن NXP
    پاسخ: 2
    آخرين نوشته: 2015/01/06, 10:35
  3. ارتباط ميکرو LPC1768 با کارت SD
    توسط mjsh401 در انجمن NXP
    پاسخ: 2
    آخرين نوشته: 2014/12/13, 21:10
  4. ارتباط USB ميکرو LPC1768 با PC
    توسط vivana در انجمن NXP
    پاسخ: 30
    آخرين نوشته: 2014/12/06, 19:35
  5. پاسخ: 0
    آخرين نوشته: 2013/06/23, 23:37

کلمات کلیدی این موضوع

علاقه مندي ها (Bookmarks)

علاقه مندي ها (Bookmarks)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •