Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Urgent help nedded in LCD Programming query

Status
Not open for further replies.

greentree

Member level 5
Joined
Sep 25, 2011
Messages
86
Helped
13
Reputation
26
Reaction score
13
Trophy points
1,288
Location
The center of world!
Activity points
1,739
Hi Every body
i'm going to write some characters on LCD (with using from Matrix ). but i don't know how! and i confused!
I wrote this program , see below , please:
.
.
.
int a=0;
char all[20];
DDRA=0XFF;
PORTA=0X04;
lcd_init(16);
lcd_clear ();
lcd_gotoxy(0,0);
while (1)
{
delay_ms(100);
a++;
lcd_clear();
lcd_gotoxy(0,0);
sprintf(all,"%d",a)
lcd_puts(all);
}

but don't work!!
Is it possible that you guide me , please?
Each reply appreciated.
Thanks in advance
Greentree
 

dear alexan
Hi
Thanks for your reply.
yes i use codevision.
enable pin connected to the 3rd pin of PORTA ...Rs and R/W are connected to the 1st pin and 2nd pin of that . and D4 to D7 are connected to the PORTA.4 to PORTA.7 . MY LCD is 2*16 . How can i use variative in LCD? (like clock)?
With appreciate
Greentree
 

What is variative ?
Were you able to show any character?
Have you tried something like lcd_putsf("test");
Which mcu do you have?
Also the initialization code where you define the port is not shown in your code, is that correct?
 
Again hi !
isn't enough this ? lcd_init(16); (for initialization)

yes i know lcd_putsf("test"); ...sorry i couldn't explain my mean very good8-O
my mean about variative :
for example i have a data that it changed every time and i will wrote it on lcd...

*thank you for your attention*

---------- Post added at 14:48 ---------- Previous post was at 14:47 ----------

Fall seven times, stand up eight.
Japanese Proverb
 

Yes in the new version you only see something like

// Alphanumeric LCD initialization
// Connections specified in the
// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
// RS - PORTA Bit 0
// RD - PORTA Bit 1
// EN - PORTA Bit 2
// D4 - PORTA Bit 4
// D5 - PORTA Bit 5
// D6 - PORTA Bit 6
// D7 - PORTA Bit 7
// Characters/line: 16

and the pins are not defined inside the code as in the previous version.
So your settings are as above?

After three posts I still don't know the mcu you have and I don't know if you were able to show a character in the display using any way.
All you said so far is "but don't work!!" in the first post so you are not explaining what is going wrong that is why I asked if you were you able to show any character.

lcd_putsf("test"); was a way to check if you can show character so when you tell me that you know about it doesn't help me at all understand what is going wrong.
 
1-Yes its exactly my settings.
2-I agree with you !
3-whats mcu ?:?:
4-imagine i will write a clock program (like 00:00:00) and in my program each 998 ms increased for example value of S parameter.

now i will write value of S every 998ms on lcd...how?
at first post i wrote a program ,i think its way for this goal .is it ? if isn't so how do you write a clock program ...with which way ?

5- *I thank you for your patience*
 

mcu = microcontroller (mega16, mega32, mega64, mega128....?)

why is it so hard to tell me if you were able to show any character in the screen or not, I keep asking but you don't answer to my question.
If you are not able to show characters at all then we have to look at the hardware or some setting or fusebit.
If you can show characters then we can focus on how to show the content of a variable.
 
:oops: mega16.
When i will show characters on lcd i use for example lcd_putsf ("I love electronic") ...is it your mean ?
but i don't know how to show the content of a variable.
I think finally i can say my mean !
"I will show the content of a variable."
*very thanks*

---------- Post added at 16:03 ---------- Previous post was at 16:00 ----------

"The word impossible is not in my dictionary."
Napoleon Bonaparte
 

You code works fine , it shows a number counting up in the upper left corner of the display.
Maybe it is counting too fast, have you tried with a higher delay, for example 500ms?

What exactly do you see on the screen?
Have you set the mcu frequency correctly in the compiler, it should be the same as the hardware for the delays to work correctly.
 
I will do it and say its result, certainly.
and will check the mcu frequency in the compiler.
I come back...!
*Sincerely yours*
 

hello alexan*
how are u?
my mistake was that i trusted to the proteus :-?
i use that code in mega16 and it worked as well as ...test in practical is best way my friend8-O

*thanks for your helpful guidance*
 

Then you did something wrong in proteus because when I tried it worked fine, you have either used wrong clock or wrong wiring or some other mistake
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top