LCDInfo.com

http://www.lcdinfo.com
It is currently Thu Nov 21, 2024 23:35

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu May 05, 2011 15:22 
Offline

Joined: Thu May 05, 2011 14:47
Posts: 2
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
}


Top
 Profile  
 
PostPosted: Fri May 13, 2011 17:55 
Offline

Joined: Thu May 05, 2011 14:47
Posts: 2
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!


Top
 Profile  
 
PostPosted: Mon May 23, 2011 12:07 
Offline

Joined: Fri May 20, 2011 12:19
Posts: 2
still waiting for updates...
streaming tv


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group