LCDInfo.com
http://forum.lcdinfo.com/

T6963C LCD + C8051F410 Need HELP! ='(
http://forum.lcdinfo.com/viewtopic.php?f=9&t=8709
Page 1 of 1

Author:  get-man [ Thu May 05, 2011 15:22 ]
Post subject:  T6963C LCD + C8051F410 Need HELP! ='(

Hello,
I have a MC SiLabs C8051F410 and display NHD-240128WG-BYGH-VZ000C (T6963C controller), connected to it. Scheme of connection I can provide.

And I have such a problem: I want to display any letter or number, but I can see only one line on my display, that blinking with a frequency, depending on a frequency of MC kernel.

I've read a lot of information and try a lot of variants of code, but I've not found any solution of this problem. I'll be more than happy, if somebody help me to solve this problem!

There is my code:

#include <c8051f410.h> // SFR declarations
#include <stdio.h>
#include <string.h>

sbit D0 = P1^0;
sbit D1 = P1^1;
sbit D2 = P1^2;
sbit D3 = P1^3;
sbit D4 = P1^4;
sbit D5 = P1^5;
sbit D6 = P1^6;
sbit D7 = P1^7;
sbit CD = P2^0;
sbit RD = P2^1;
sbit WR = P2^2;
sbit CE = P2^3;
sbit RS = P2^4;
sbit MD = P2^5;
sbit FS = P2^6;

void oscillatorInit (void);
void portInit (void);
void delay (int);
void writeLcdData (char);
void writeLcdCommand (char);
int readLcdStatus (void);
void lcdInit (void);

int i,j;

void main (void)
{
PCA0MD &= ~0x40; // WDTE = 0 (clear watchdog timer enable)
portInit(); // Initialize Port I/O
oscillatorInit (); // Initialize Oscillator
lcdInit (); // Initialize LCD

if (!readLcdStatus ()) return;

writeLcdCommand(0x80); //set display mode (OR mode)

if (!readLcdStatus ()) return;
writeLcdData(0x00);
if (!readLcdStatus ()) return;
writeLcdData(0x17); //text home address = 1700h
if (!readLcdStatus ()) return;
writeLcdCommand(0x40); //text home address set

if (!readLcdStatus ()) return;
writeLcdData(0x28);
if (!readLcdStatus ()) return;
writeLcdData(0x00); //text area address = 0028h
if (!readLcdStatus ()) return;
writeLcdCommand(0x41); //text area control set

if (!readLcdStatus ()) return;
writeLcdData(0x00);
if (!readLcdStatus ()) return;
writeLcdData(0x00); //graphic home address = 0000h
if (!readLcdStatus ()) return;
writeLcdCommand(0x42); //graphic home address set

if (!readLcdStatus ()) return;
writeLcdData(0x28);
if (!readLcdStatus ()) return;
writeLcdData(0x00); //graphic area = 0028h
if (!readLcdStatus ()) return;
writeLcdCommand(0x43); //graphic area control set

if (!readLcdStatus ()) return;
writeLcdCommand(0x9C); //text ON graph ON
//writeLcdCommand(0x98); //text OFF graph ON
//writeLcdCommand(0x94); //text ON graphic OFF

writeLcdData(0x7A);
if (!readLcdStatus ()) return;
writeLcdData(0x17); //text area address = 177Ah
if (!readLcdStatus ()) return;
writeLcdCommand(0x24); //set address pointer

if (!readLcdStatus ()) return;
writeLcdData(0x15); //any data ('5')
if (!readLcdStatus ()) return;
writeLcdCommand(0xC0); //data write and inc ADP
}

void lcdInit(void)
{
RS = 0;
delay(100);
RS = 1;
}

void writeLcdData (char valueData)
{
while (!readLcdStatus());
CD = 0;
delay (100);
WR = 0;
CE = 0;
P1 = valueData;
delay (100);
WR = 1;
CE = 1;
CD = 0;
P1 = 0xFF;
}

void writeLcdCommand (char valueCommand)
{
while (!readLcdStatus());
CD = 1;
delay (100);
WR = 0;
CE = 0;
P1 = valueCommand;
delay (100);
WR = 1;
CE = 1;
CD = 0;
P1 = 0xFF;
}

int readLcdStatus (void)
{
CD = 1;
RD = 0;
WR = 1;
CE = 0;
delay (100);
P1 |= 0xFF;
delay(100);

if (D0 != 1 && D1 !=1)
return 0;
else
return 1;
}

void delay (int tmp)
{
for (i = tmp; i > 0; i--);
return;
}

void oscillatorInit (void)
{
OSCICN |= 0x85; //Configure internal oscillator for
// 24.5/4 Mhz (~6 Mhz)
}

void portInit (void)
{
P1MDIN |= 0xFF; // Make switch pins digital
P2MDIN |= 0xFF;

P1MDOUT |= 0x00; // Make switch pins open-drain
P2MDOUT |= 0x00;

XBR1 = 0x40; // Enable crossbar and enable
}

Author:  get-man [ Fri May 13, 2011 17:55 ]
Post subject:  Re: T6963C LCD + C8051F410 Need HELP! ='(

I have found the topic with the same proble, as mine.
viewtopic.php?f=9&t=1333

And no one solve this problem.
Please help me!

Author:  Bryon [ Mon May 23, 2011 12:07 ]
Post subject:  Re: T6963C LCD + C8051F410 Need HELP! ='(

still waiting for updates...
streaming tv

Page 1 of 1 All times are UTC + 2 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/