Aart,
You were using a 4Mhz Xtal on the '84, and you also using a 4Mhz Xtal on
the'877, if not you might want to check the delay routines for the LCD init are
correct.
Here is a snippit of code I use to give 100us delay
LCD_D1 equ 0x30
LCD_D2 equ 0x31
#DEFINE LCD_xtal 0xA5 ;This should divide the clock to be 100us
LCD_delay
MOVWF LCD_D1
LCD_delay1
MOVLW LCD_xtal
MOVWF LCD_D2
LCD_delay2
DECFSZ LCD_D2,F
GOTO LCD_delay2
DECFSZ LCD_D1,F
GOTO LCD_delay1
RETURN
My init code is like this :-
LCD_init
LCD_delaym 150 ;Delay 15ms
LCD_nibble LCD_4_init ;First Init Byte
LCD_delaym 41 ;Delay 4.1ms
LCD_nibble LCD_4_init ;Second Init Byte
LCD_delaym 1 ;Delay 100us
LCD_nibble LCD_4_init ;Third Init Byte
LCD_delaym 41 ;Delay 4.1ms
LCD_nibble LCD_4_mode_n ;Set 4 bit interface, busy flag now
readable, from this point on use busy flag on not time delays
LCD_command LCD_4_2_5x8 ;Select 2 line 5X8 4 bit mode
LCD_command LCD_disp ;Display off Command
LCD_command LCD_disp | LCD_d_on ;Display on, Cursor off
LCD_command LCD_i_right ;Increment Cursor, No Scroll
LCD_command LCD_clear ;Clear the display
RETURN
I include the LCD_init not for use as you have on that works anyway, but just to
show the timings I use with LCD_delaym which is just a macro to move the litral
to W and call LCD_delay.
LCD_delaym macro argv
MOVLW argv
CALL LCD_delay
endm
I can let you have the full source if you want it, just ask.
Regards
Ben
Please respond to pic microcontroller discussion list <spam_OUTPICLISTTakeThisOuT
MITVMA.MIT.EDU>
To: .....PICLISTKILLspam
@spam@MITVMA.MIT.EDU
cc: (bcc: Ben SUFFOLK/EN/HTLUK)
Subject: Re: [PIC]: LCD From 16F84 to 16F877
{Quote hidden}> PORTE will be in ANALOG mode.
>
> Change the ADCON1 register to make it work in digital mode.
>
> bsf STATUS,RP0
> movlw 6h ; all analog pins = digital
> movwf ADCCON1
> bcf STATUS,RP0
>
>
> Make sure the unused pins on the other ports are set as outputs.
>Tony
Hi,
The code is now changed (as above) all unused pins were set as output and i
made sure i was refering to the right page:
bcf STATUS, RP1
bsf STATUS, RP0
---code---
There was a slight change, there are some characters (all the same and
unreadable) at the display now when turning on. Maybe somone would take a
look at the full code (it's short).
http://aart.myip.org/test/
the 84 code is working and the 877 aint, i'm using a bootloader these are
the first few lines.
Thanks a lot,
Aart.
--
http://www.piclist.com hint: The PICList is archived three different
ways. See http://www.piclist.com/#archives for details.
- att1.eml
*******************************************************************************
Important. This E-mail is intended for the above named person and may be
confidential and/or legally privileged. If this has come to you in error you
must take no action based on it, nor must you copy or show it to anyone; please
inform the sender immediately.
*******************************************************************************
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listserv
KILLspammitvma.mit.edu with SET PICList DIGEST in the body