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.

[PIC] Interfacing graphical LCD with pic18f4550

Status
Not open for further replies.

Khalidinho

Newbie level 5
Joined
May 21, 2016
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
74
Hello, I am new with pic18

I am following this tutorial to interface GLCD with pic18f4550
https://sites.google.com/site/coolembeddedlaboratory/home/pic18f4550/tutorial-list/graphical-lcd
everything is ok
but until it's said
As this tutorial is based on PIC18F4550 and PORTB is also used, so please make sure that Analog To Digital Converter is disabled in Configuration Setting of PIC18F4550, otherwise the program will compile without error, but nothing will appear on Graphical Lcd.

how can I disable ADC?
 

Go to project and then Edit project and then disable PORTB Analog to Digital Converter.

Solution.png
 

thank you very much. it's working
 

Variables in Graphical LCD

Hi, I am programming in pic18f4550 using mikroc pro.

for example let's say I have temperature sensor. Receiving the data is succeed.
Now I want to display the result in Graphical LCD jhd12864e.
I searched in GLCD library but there is no direct command to display Variables like this command
Code:
LCD_Chr(1, 15, 48 + (Temp % 10));
in 16x2 lcd.

I found methods to convert these values into string. but the string is 7 bit size and I want to display the temperture only in 2 digits XX ْC.

so please provide me all possible methods.

Thank you.
 
Last edited by a moderator:

Re: Variables in Graphical LCD

hello


but the string is 7 bit size

a charactere is a byte ..8 bits
an empty string=1 byte set to zero value
a not empty string is one char minimum + 0 value (string terminator) .. minimum length 2 bytes

in the case of displayng on LCD,we can use 2 individual charactere

with 0<= Temp <= 99

Code:
LCD_Chr(1, 14, 48 + (Temp/10));
LCD_Chr(1, 15, 48 + (Temp % 10));

nota: a 16x2 lcd. is not a graphical LCD .. texte oriented LCD.

 
Last edited:

a 16x2 lcd. is not a graphical LCD .. text oriented LCD.
Yes, but jhd12864e is 64x128 pixel monochrome graphic display. GLCD library allows to display single characters or strings.
 

Yes there is a library to display characters in jhd12864e. but these are constants such as:
Code:
Glcd_Write_Text("Temperature:", 1, 0, 0);
will only display Temperature.

I want to display variables such as Temperature value which is keep refreshing.
 

Havd you seen this function

Glcd_Write_Char
I think you can also use
Glcd_Write_Text by creating a buffer and putting temperature values as a string in it.
 

I have tried Glcd_Write_Char also but does't work.
Can you show me how and an example for creating buffer and put it in string.
 

Look up the 'itoa' (and similar) functions which take an integer and converts it to a character string in a buffer that you provide.
Susan
 

okay, this is a good start
I used IntToStr but the problem with string size is 8 bit

Untitled.jpg
 

As has been pointed out before, the general case is for the characters of a string to be 8-bit.
Do you mean that the string is 8 BYTES long with a leading spaces? If so, then you need to learn some of the common string handling functions so (in this case) find the index of the first character that is not a space (perhaps using strrchr) and use that as the start of the string passed to the display function.
Susan
 

hello,

post all your code or explain more ...

if your value of temperature is on 8 bits ( 1 byte => value 0 to 255 )

Code:
#define Byte unsigned char
byte t=225;
char Texte[4];



ByteToStr(t,Texte); 
Glcd_Write_Text("Temperature:", 1,0, 0);
Glcd_Write_Text(Texte,1,13,0);

you will diplay
Temperature: 225

nota: not tested ..i have no GLCD ...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top