Forums

Graphic LCD to LPC2106

Started by sp_1972 November 2, 2006
Hi all,

I am using graphic LCD with ARM LPC2106. I have written initialisation
code for lcd. but i am facing the problem that sometimes it is getting
initialised and some times it is not. Can anyone help in this regard? A
sample code to use graphic lcd with LPC will be helpful.

Thanks in advance.

An Engineer's Guide to the LPC2100 Series

Hi,



Which LCD are you using?





_____

From: l... [mailto:l...] On Behalf Of
sp_1972
Sent: , 2 2006 9:36
To: l...
Subject: [lpc2000] Graphic LCD to LPC2106



Hi all,

I am using graphic LCD with ARM LPC2106. I have written initialisation
code for lcd. but i am facing the problem that sometimes it is getting
initialised and some times it is not. Can anyone help in this regard? A
sample code to use graphic lcd with LPC will be helpful.

Thanks in advance.







> Hi all,
>
> I am using graphic LCD with ARM LPC2106. I have written initialisation
> code for lcd. but i am facing the problem that sometimes it is getting
> initialised and some times it is not. Can anyone help in this regard? A
> sample code to use graphic lcd with LPC will be helpful.
>

Search in 'file' section, you will find two sample code for KS107/108 and
T6396, take your pick.
Warm Regards,
Mukund Deshmukh,
Beta Computronics Pvt Ltd,
10/1 IT Park, Nagpur.
Cell 9422113746
Hello ,
I would like to ask you once you talk about LCD's .......do you know any TFT colour screen about 1-2,5 inch with I2C interface?

Ioannis Mourtsiadis : Hi,



Which LCD are you using?





_____

From: l... [mailto:l...] On Behalf Of
sp_1972
Sent: , 2 2006 9:36
To: l...
Subject: [lpc2000] Graphic LCD to LPC2106



Hi all,

I am using graphic LCD with ARM LPC2106. I have written initialisation
code for lcd. but i am facing the problem that sometimes it is getting
initialised and some times it is not. Can anyone help in this regard? A
sample code to use graphic lcd with LPC will be helpful.

Thanks in advance.







I am not using any LCD at the moment but I would like to use one in compination with an LPC2106.And I am searching for an LCD TFT 1,5-2inch that would have an I2C port so to connect it to the LPC

John Ypatidis : Hello ,
I would like to ask you once you talk about LCD's .......do you know any TFT colour screen about 1-2,5 inch with I2C interface?

Ioannis Mourtsiadis : Hi,



Which LCD are you using?





_____

From: l... [mailto:l...] On Behalf Of
sp_1972
Sent: , 2 2006 9:36
To: l...
Subject: [lpc2000] Graphic LCD to LPC2106



Hi all,

I am using graphic LCD with ARM LPC2106. I have written initialisation
code for lcd. but i am facing the problem that sometimes it is getting
initialised and some times it is not. Can anyone help in this regard? A
sample code to use graphic lcd with LPC will be helpful.

Thanks in advance.







I am using Okaya RE12864 COG

On 11/2/06, Ioannis Mourtsiadis wrote:
>
> Hi,
>
> Which LCD are you using?
>
> _____
>
> From: l... [mailto:l...] On Behalf
> Of
> sp_1972
> Sent: , 2 2006 9:36
> To: l...
> Subject: [lpc2000] Graphic LCD to LPC2106
>
> Hi all,
>
> I am using graphic LCD with ARM LPC2106. I have written initialisation
> code for lcd. but i am facing the problem that sometimes it is getting
> initialised and some times it is not. Can anyone help in this regard? A
> sample code to use graphic lcd with LPC will be helpful.
>
> Thanks in advance.
>
>
>
I am using Okaya RE12864 COG

>

What is driver chipset?

Warm Regards,
Mukund Deshmukh,
Beta Computronics Pvt Ltd,
10/1 IT Park, Nagpur.
Cell 9422113746
--- In l..., Mukund Deshmukh
wrote:
>
> I am using Okaya RE12864 COG
>
> > What is driver chipset?
>
> Warm Regards,
> Mukund Deshmukh,
> Beta Computronics Pvt Ltd,
> 10/1 IT Park, Nagpur.
> Cell 9422113746
>

The driver is ST7565S
>
> The driver is ST7565S
>

I have recently written a driver for serial access to the ST7565S
(on a powertip PE12864LRF-001-HC1 display though). As far as I know,
the configuration is the same if You use parallel interface. As I
use SPI there is no read-back ability so I have a shadow of the
display in ram. Note that the specific settings of Bios, V5 and
electronic volume should be set according to the lcd requirements.
Here is a snippet of what I do to get it up and running - I hope it
helps.

Regards

Thomas Augustinus

#define defXCollumns 128
#define defYPixels 64
#define defYPages 8
#define defXBytes 16

//single byte command definitions
#define defCmdDisplayOnOff 0xae
#define defCmdDisplayStartLineSet 0x40
#define defCmdPageAddressSet 0xb0
#define defCmdCollumnAddressSetHigh 0x10
#define defCmdCollumnAddressSetLow 0x00
#define defCmdADCSelect 0xa0
#define defCmdDisplayNormalReverse 0xa6
#define defCmdDisplayAllPointsOnOff 0xa4
#define defCmdLcdBiasSetLowHigh 0xa2
#define defCmdReset 0xe2
#define defCmdV5VoltageRegulatorInternalResistorRatioSet 0x20
#define defCmdPowerControllerSet 0x28
#define defCmdNOP 0xe3
//dual byte command definitions
#define defCmdCommonOutputModeSelect 0xc0
#define defCmdBoosterRatioSelectModeSet 0xf8
#define defCmdElectronicVolumeModeSet 0x81
#define defCmdStaticIndicatorModeSet 0xad

static unsigned char auchDisplayRam[defYPixels]
[defXBytes]; //display memory

void LCDDRIVERstart()
{
WriteByteCmd(defCmdDisplayOnOff,0); //display off

WriteByteCmd(defCmdLcdBiasSetLowHigh,0); // 1/9 bios
WriteByteCmd(defCmdADCSelect,0x00); //adc normal
WriteByteCmd(defCmdCommonOutputModeSelect,0); //normal
common ouput select

WriteByteCmd
(defCmdV5VoltageRegulatorInternalResistorRatioSet,4); //v5 ratio = 4
WriteWordCmd(defCmdElectronicVolumeModeSet,32); //default
elec vol2
WriteWordCmd(defCmdBoosterRatioSelectModeSet,0); //booster
ratio = 1/3
WriteByteCmd(defCmdPowerControllerSet,0x07); //all psus
enable

WriteByteCmd(defCmdDisplayNormalReverse,0); //reverse disable
WriteByteCmd(defCmdDisplayAllPointsOnOff,0); //all points on
disable

LCDDRIVERrefresh();

}

void WriteByteCmd( unsigned char uchCmd, unsigned char uchValue )
{
//A0 = 0 - command
SetAddr(0);

SetCS(TRUE);
SPIDRIVERtx8Bit(&stSpiCfg,uchCmd | uchValue); //tx cmd
SetCS(FALSE);
}
void WriteWordCmd( unsigned char uchCmd, unsigned char uchValue )
{

//A0 = 0 - command
SetAddr(0);

SetCS(TRUE);
SPIDRIVERtx8Bit(&stSpiCfg,uchCmd); //tx mode set cmd
SPIDRIVERtx8Bit(&stSpiCfg,uchValue); //tx value
SetCS(FALSE);
}

void LCDDRIVERrefresh( )
{
int iCollumn;
int iPage;
unsigned char uchYByte;
unsigned char uchBit;
unsigned short int usiBitCnt;
unsigned char uchTmp;

//Display start line select
WriteByteCmd(defCmdDisplayStartLineSet, 0);

for (iPage=0;iPage {
//Set page number
WriteByteCmd(defCmdPageAddressSet, iPage);

//Reset collumn number to zero
WriteByteCmd(defCmdCollumnAddressSetHigh, 0);
WriteByteCmd(defCmdCollumnAddressSetLow, 0);

//Prepare for display data write (A0=1)
SetAddr(1);
SetCS(TRUE);

for (iCollumn=0; iCollumn {
uchBit = 7-(iCollumn & 0x7); //lower bits
indicate which bit to use. MSB to the left

uchYByte = 0;

for (usiBitCnt=0; usiBitCnt<8; usiBitCnt++)
{
uchTmp = auchDisplayRam[(defYPages-
iPage-1)*8+7-usiBitCnt][iCollumn>>3] & (1< if (usiBitCnt < uchBit)
uchYByte |= uchTmp >>
(uchBit-usiBitCnt);
else
uchYByte |= uchTmp <<
(usiBitCnt-uchBit);
}

//Write byte to the display
SPIDRIVERtx8Bit(&stSpiCfg,uchYByte);
}

SetCS(FALSE);
}
}
Hi thomas,

thanks for reply.

I am also using serial i/f to LCD. Is it needed to settle the port pins when
u set or clear it, means is it required to have delay after each set or
clear of port pin as there is no bit manipulation? what happens in your
SETCS, CLRCS code? can u please clarify more?

thanks in advance
On 11/3/06, thomas_augustinus wrote:
>
> >
> > The driver is ST7565S
> > I have recently written a driver for serial access to the ST7565S
> (on a powertip PE12864LRF-001-HC1 display though). As far as I know,
> the configuration is the same if You use parallel interface. As I
> use SPI there is no read-back ability so I have a shadow of the
> display in ram. Note that the specific settings of Bios, V5 and
> electronic volume should be set according to the lcd requirements.
> Here is a snippet of what I do to get it up and running - I hope it
> helps.
>
> Regards
>
> Thomas Augustinus
>
> #define defXCollumns 128
> #define defYPixels 64
> #define defYPages 8
> #define defXBytes 16
>
> //single byte command definitions
> #define defCmdDisplayOnOff 0xae
> #define defCmdDisplayStartLineSet 0x40
> #define defCmdPageAddressSet 0xb0
> #define defCmdCollumnAddressSetHigh 0x10
> #define defCmdCollumnAddressSetLow 0x00
> #define defCmdADCSelect 0xa0
> #define defCmdDisplayNormalReverse 0xa6
> #define defCmdDisplayAllPointsOnOff 0xa4
> #define defCmdLcdBiasSetLowHigh 0xa2
> #define defCmdReset 0xe2
> #define defCmdV5VoltageRegulatorInternalResistorRatioSet 0x20
> #define defCmdPowerControllerSet 0x28
> #define defCmdNOP 0xe3
> //dual byte command definitions
> #define defCmdCommonOutputModeSelect 0xc0
> #define defCmdBoosterRatioSelectModeSet 0xf8
> #define defCmdElectronicVolumeModeSet 0x81
> #define defCmdStaticIndicatorModeSet 0xad
>
> static unsigned char auchDisplayRam[defYPixels]
> [defXBytes]; //display memory
>
> void LCDDRIVERstart()
> {
> WriteByteCmd(defCmdDisplayOnOff,0); //display off
>
> WriteByteCmd(defCmdLcdBiasSetLowHigh,0); // 1/9 bios
> WriteByteCmd(defCmdADCSelect,0x00); //adc normal
> WriteByteCmd(defCmdCommonOutputModeSelect,0); //normal
> common ouput select
>
> WriteByteCmd
> (defCmdV5VoltageRegulatorInternalResistorRatioSet,4); //v5 ratio = 4
> WriteWordCmd(defCmdElectronicVolumeModeSet,32); //default
> elec vol2
> WriteWordCmd(defCmdBoosterRatioSelectModeSet,0); //booster
> ratio = 1/3
> WriteByteCmd(defCmdPowerControllerSet,0x07); //all psus
> enable
>
> WriteByteCmd(defCmdDisplayNormalReverse,0); //reverse disable
> WriteByteCmd(defCmdDisplayAllPointsOnOff,0); //all points on
> disable
>
> LCDDRIVERrefresh();
>
> }
>
> void WriteByteCmd( unsigned char uchCmd, unsigned char uchValue )
> {
> //A0 = 0 - command
> SetAddr(0);
>
> SetCS(TRUE);
> SPIDRIVERtx8Bit(&stSpiCfg,uchCmd | uchValue); //tx cmd
> SetCS(FALSE);
> }
> void WriteWordCmd( unsigned char uchCmd, unsigned char uchValue )
> {
>
> //A0 = 0 - command
> SetAddr(0);
>
> SetCS(TRUE);
> SPIDRIVERtx8Bit(&stSpiCfg,uchCmd); //tx mode set cmd
> SPIDRIVERtx8Bit(&stSpiCfg,uchValue); //tx value
> SetCS(FALSE);
> }
>
> void LCDDRIVERrefresh( )
> {
> int iCollumn;
> int iPage;
> unsigned char uchYByte;
> unsigned char uchBit;
> unsigned short int usiBitCnt;
> unsigned char uchTmp;
>
> //Display start line select
> WriteByteCmd(defCmdDisplayStartLineSet, 0);
>
> for (iPage=0;iPage > {
> //Set page number
> WriteByteCmd(defCmdPageAddressSet, iPage);
>
> //Reset collumn number to zero
> WriteByteCmd(defCmdCollumnAddressSetHigh, 0);
> WriteByteCmd(defCmdCollumnAddressSetLow, 0);
>
> //Prepare for display data write (A0=1)
> SetAddr(1);
> SetCS(TRUE);
>
> for (iCollumn=0; iCollumn > {
> uchBit = 7-(iCollumn & 0x7); //lower bits
> indicate which bit to use. MSB to the left
>
> uchYByte = 0;
>
> for (usiBitCnt=0; usiBitCnt<8; usiBitCnt++)
> {
> uchTmp = auchDisplayRam[(defYPages-
> iPage-1)*8+7-usiBitCnt][iCollumn>>3] & (1< > if (usiBitCnt < uchBit)
> uchYByte |= uchTmp >>
> (uchBit-usiBitCnt);
> else
> uchYByte |= uchTmp <<
> (usiBitCnt-uchBit);
> }
>
> //Write byte to the display
> SPIDRIVERtx8Bit(&stSpiCfg,uchYByte);
> }
>
> SetCS(FALSE);
> }
> }
>