Connecting an LCD with 16F628A

Status
Not open for further replies.
what's that LPH7779-7376-7677 and i can't even find the databook?!
is what the site describes the only way to show text on my lcd?

i'm very new (2-3 days..) on microcontrollers so the easiest way is the most convenient for me.
 
lol... it was my screen's IC alternative name?

ok now what should i do so i can connect it to my pic? the site has
an 16F84... so i guess i must modify the code and the circuit.

although i don't know much.. i guess i have to shut down the comparators of my pic, remove the 4MHz crystal from the circuit and select RC I/O, do i have to do anything else other than that?? I also see a special power supply for the screen... can i use a 3V zener to power the screen?


btw what exactly the code from that site does? i think the photo only shows few black lines...
 
Last edited:
Yep you are right.But the PIC16F628A GP registers starts from 20h.
So the count values must start from 20h onwards.

Note: I haven't built this one so no guarantee if it not works.
 
i guess i can try it...

but as i said few days ago i started with microcontrollers so any help appriciated very much! because i don't know what changes to make about those GP registers, also my idea of using a 3V zener instead of the power supply the site shows for the display is possible or not?
 
GPR's are the RAM in a PIC, and their start address varies from device to device, you need to set your variables accordingly.
 
Nigel or anybody else... please give me directions on what to do so i can make the display work with my microcontroller.

i think i don't have to repeat that i play with PICs only few days and i don't understand what i should do with these GPs or GPRs....

thanks!
 
I would suggest you google for PIC and Nokia LCD, I seem to recall there are a number of projects about them?. Never used one myself though.
 
i couldn't find better than the link Gayan Soyza posted....

https://sandiding.tripod.com/lcd.html

so i guess i don't have an alternative...

1) I need to know what exactly the code from that site does! prints something on the screen? (from the photo the site has i only see black lines!)

2)Other than changing the fuses and selecting internal oscillator and correct PIC model, i'm also going to make the following modifications to the code so it can work with the 16F628A.

MOVLW 7
MOVWF CMCON
CBLOCK 0x20


Is this the correct order for the code? where do i have to place it? before "org 0" or after?

3) My display has 1K resistors with 3V zenner diodes connected to each of the display pins so it can work with the parallel port, do i have to adjust those resistors so it can work with the PIC?
 
i got problems migrating the code of this site

https://sandiding.tripod.com/lcd.html

from 16F84>16F628A... i'm getting errors from the compiler!


i tried to change the microcontroller identification, shut off the comparators adding the "Cblock 0x20" opcode and sellecting the 16f628A internal oscillator... but i'm getting a big list of error when i'm trying to compile the code!

then is something else too! i don't know what exactly i'm expecting this code to do!!! print some words? or just showing few black lines as the photo on the site shows?



heeeeeelp!
 
To get this working on a 628 you need to change the start of the code to this,

Code:
;=======LCD_Nokia nse1,nse3,nsm1 / Version 1.0====================21/12/02==
;     cod LPH7366-1, LPH7779, LPH7677 / driver PCD8544
;     rb6,rb7     sclock,sdata
;     ra0,ra1,ra2,ra3	d/C,Reset,Vccmd,SCE
;     internal clock
;     standard crystal 4.000 MHz XT - 1us pe instructiune/pe aproape
;     Program realizat de Ing. Bergthaller Iulian-Alexandru 
;------------------------------------------------------------
	list	p=16f628A
	include "p16F628A.inc"

	__CONFIG       _CP_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC

;------------------------------------------------------------
;      cpu init
porta	      equ	05
portb	      equ	06

	cblock	0x20
count1
count2
count3
afisaj
	endc

#DEFINE sclk	portb,6
#DEFINE sdta	portb,7
#DEFINE dorc	porta,0
#DEFINE rset	porta,1
#DEFINE tens	porta,2
#DEFINE enab	porta,3
;------------------------------------------------------------
	org	0
;
;------------------------------------------------------------
init
	movlw	7
	movwf	CMCON
; existing code.   
	movlw   0
	tris    portb ; set portb as output

Mike.
 
Hi!

my code was close to your example above, now i did the modifications you gave me,
but i'm still getting some errors...

btw i prefer to use the internal oscillator! is there any problem if i do that?



Warning[224] C:\MPASM\LCD.ASM 41 : Use of this instruction is not recommended.

Warning[224] C:\MPASM\LCD.ASM 43 : Use of this instruction is not recommended.
Error[113] C:\MPASM\LCD.ASM 109 : Symbol not previously defined (COUNT4)
Message[305] C:\MPASM\LCD.ASM 119 : Using default destination of 1 (file).
Error[113] C:\MPASM\LCD.ASM 119 : Symbol not previously defined (COUNT4)
Message[305] C:\MPASM\LCD.ASM 135 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 138 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 140 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 149 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 151 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 153 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 160 : Using default destination of 1 (file).
Message[305] C:\MPASM\LCD.ASM 162 : Using default destination of 1 (file).
 
Last edited:

There's only one 'error' there, that's clearly explained - you are trying to use a GPR that you haven't defined - 'count4'.

The 'messages' are because you haven't added the required ', F' or ', W' to the commands on those lines - which I suggest you go and do.

The 'warning' is also self explanatory, you're using an instruction that hasn't been recommended for more than ten years - but it's still supported!.
 
ok!!!

i added this line "count4 equ 10" over the cblock 0x20 opcode and the error went away!

nigel dfo you think i can use the internal oscillator for what i'm trying to do?
 
whiz115 said:
ok!!!

i added this line "count4 equ 10" over the cblock 0x20 opcode and the error went away!

nigel dfo you think i can use the internal oscillator for what i'm trying to do?

count4 equ 10 is no good, (that's PCLATH) add it to the cblock section.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…