Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

reading device code from ILI9320 GLCD controller

Status
Not open for further replies.

froten

New Member
hello all,

I have an LCD module Wistron Opt 145710-A but couldn't find any datasheet for it. I tried many initializing codes and fortunately it worked with a code for ILI9320 or ILI9325. I'm trying to read its device code to know weather it is 9320 or 9325 but only this part of my code is not working, I aloways get 0x0000. If any body can help on this, that will be very appreicated. my code I use to read the device code is as bellow.


//******************** LCD code ************************************
Initialize();
LCD_Reset(); // this is working when displying a picture

LCD_SetReg(0x00,0x00,0x01); // Start internal oscillator
delay_ms(50);

for (i=0;i <2;++i)
{
LCD_ReadDeviceCode(); // this never worked ???????????????????????????
Delay_ms(500);
}

LCD_Init(); // this function is working when displying a picture
LCD_FillScreen(BRIGHTGREEN); // this works also

//*****************************************************************
void LCD_ReadDeviceCode() // Expect 9325h or 9320h
{
LCDCS=0;
OutLoByte=0; // OutLoByte=PORTB
OutHiByte=0; // OutHiByte=PORTD
LCDRS=0; // Write to index reg
LCDWR=0;
delay_ms(10);
LCDWR=1;
LCDRS=1;
LCDRD=0;
delay_ms(10);

UART1_Write(OutLoByte); // try now
UART1_Write(OutHiByte);

LCDRD=1;
UART1_Write(OutLoByte); // try again
UART1_Write(OutHiByte);
LCDCS=1;
}
void Initialize()
{
ADCON1= 0x06; //Configure PORTA as Digital port
TRISA =0; // A as outputs
TRISB =0; // B as outputs
TRISD =0; // D as outputs

PORTA = 0b111111; // all are high
PORTB = 0;
PORTD = 0;

INTCON = 0b11000000; // Enable GIE, PEIE
PIE1= 0b00100000; // Enable RCIE, desable TXIE
PIE2= 0; // Desable eeprom int
PIR1 =0; // Clear all int flags
PIR2 =0; // Clear all int flags
}
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top