Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Write data to LCD

Status
Not open for further replies.

SneaKSz

Member
Hello,

after being able to initialise my LCD, I want to send data to it. The thing that I dont understand is that , when I send data it it displayed for a short amount of time and then it's gone. If I use a loop with a delay it is being displayed but refreshed often and it gives an overlay effect.

My question is how I can make a stable view of data on the display?
View attachment LCD4.asm

Thanks in advance !
 
Hello,

after being able to initialise my LCD, I want to send data to it. The thing that I dont understand is that , when I send data it it displayed for a short amount of time and then it's gone. If I use a loop with a delay it is being displayed but refreshed often and it gives an overlay effect.

My question is how I can make a stable view of data on the display?
View attachment 45560

Thanks in advance !

hi,
The LCD has inbuilt memory, it does not require refreshing.?
If its going blank, make sure you are not going back to the origin at 0x0000 and reinitialising the LCD.
 
Hello,

Well as you can see in my modified code .
View attachment LCD4.asm


I use initlcd to set up the LCD. That works fine , after that I call "figure" , and write " sneaksz " to the output. After that I wait( loop ) .

I just see a blinking cursor on my display. If I change the infinite loop to , goto figure. Then my display is full of characters .

I don't know if my LCD has a built in memory. The datasheet is less then less.

If I send data then it's displayed for a short amount of time and then it's gone.


I also tried your modified code for my pic18f14k50( thread initialise LCD ), I can compile the code but there is no HEX file after compiling :s.


Greets
 
Last edited:
hi,
My problem is I dont have a model for your PIC type.
I'll try to figure out a solution...

EDIT:
I changed the include file in your listing to 18F452 so that I can run it.
Without any other changes I get an LCD display as shown in this image from the Simulator.
 

Attachments

  • AAesp01.gif
    AAesp01.gif
    8.1 KB · Views: 187
Last edited:
Ow , so the data that is being send , isn't stored , thats why its always just in a flash that i see the data :D.

So I have to write data to DDRAM?

hi,
The d/s you posted today, does show a 80 * 8 data RAM.
 

Attachments

  • AAesp02.gif
    AAesp02.gif
    6.7 KB · Views: 179
hi,
The d/s you posted today, does show a 80 * 8 data RAM.

I don't even know what that means . Can you tell me how to store the data into those ram addresses?

I think I have to set the DDRAM address and then move data to the datalines so the data is stored?

Thanks in advance.
 
I don't even know what that means . Can you tell me how to store the data into those ram addresses?

I think I have to set the DDRAM address and then move data to the datalines so the data is stored?

Thanks in advance.

hi,
Its a 2 line display, 1st line has 0 to 39 and second 40 to 79 RAM locations for the characters you write to the display.
Look at this clip from the d/s.

I have been checking thru your code, it looks OK. The only minor point is this.

Code:
bcf RS ; RS low
        MOVLW 0x02 ; Clear displ,,, [B]this is HOME not CLR[/B]
        movwf ctemp
        call writeLCD        
        movlw 0x01 ; 1*100µs=100µs
        movwf delay2
        call delay
 

Attachments

  • AAesp03.gif
    AAesp03.gif
    18.1 KB · Views: 163
Last edited:
Thanks for the information , I tried to apply it :

Code:
; write sneaksz to the LCD 
figure
;set  DDRAM  location 
		bcf RS ; write an instruction 
		call endelay ; this is necessary ! 
		movlw 80h ; function set DDRAM address  : " 00h , position 1" is this correct? 
		movwf ctemp		
		Call writeLCD ;write is to the LCD 
; the start of the word
		bsf RS		; send data
		call endelay
		MOVLW 53h  ; send  S
		movwf ctemp		
		Call writeLCD


EDIT 2 : Forgot a delay

Thanks in advance
 
Last edited:
hi,
Thanks for letting me know, at least you are sure the LCD is A OK.
Do you need any more help with the program.?

Hello ,
Well I can display data on the LCD now , as you said once before I need a negative voltage for the contrast. Well I found a program that creates a negative voltage from a PWM signal. I tested that and I get that negative voltage. The only thing is that the PWM pin CCP1(RC5) is for this and I use it to send data to the LCD ( I use PORTC).
PWM :

I'm going to rewrite the program for a 4 bit and use the RC5 as CCP1 supplied to the contrast input.

The only thing is that If i move data to the output , I only use 4 bits of PORT C and I don't want to use bsf/ bcf , it will take ages .

Is there some kind of trick for that? I opened another post for this .

Thanks in advance
 
Last edited:
Hello ,
Well I can display data on the LCD now , as you said once before I need a negative voltage for the contrast. Well I found a program that creates a negative voltage from a PWM signal. I tested that and I get that negative voltage. The only thing is that the PWM pin CCP1(RC5) is for this and I use it to send data to the LCD ( I use PORTC).
PWM :

I'm going to rewrite the program for a 4 bit and use the RC5 as CCP1 supplied to the contrast input.

The only thing is that If i move data to the output , I only use 4 bits of PORT C and I don't want to use bsf/ bcf , it will take ages .

Is there some kind of trick for that? I opened another post for this .

Thanks in advance

hi,
Will the final project have UART with say a MAX232.??
If yes, you can use the -9V on the MAX232 pin for the LCD.
 
hi,
You could use one of these IC's
 

Attachments

  • ICL7660-MAX1044.pdf
    121.1 KB · Views: 227
hi,
You could use one of these IC's

Thanks for the link , I've seen that IC before. I needed it once in a project ,but I used a 555 (+diodes and C's)then to make a negative voltage.

I just want to use the CCP1 pin and my LCD in 4 bit mode to reduce the cables.

Isn't it possible to send a nibble to the a port of a piece of a byte? ( without bsf/bcf)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top