Searching \ for ' From 16F84 to 16F877' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16F
Search entire site for: 'From 16F84 to 16F877'.

No exact or substring matches. trying for part
PICList Thread
'[PIC]: LCD From 16F84 to 16F877'
2001\04\29@202632 by Aart

picon face
Hello,

i'm working with a LCD (HD44780, 2x16 4 wire mode) i used code from called WKTIM4M.ASM (thx :). This worked great with a 16F84 but now i want to use it at an 16F877 but it won't work.

Am i doing something wrong here?

;----------------------------------------------------------------------;
;                       Initialize the ports                           ;
;----------------------------------------------------------------------;
init:
           clrf   PORTE
           clrf   PORTD

           bsf STATUS, RP0
           movlw B'00000000'          ;  RE all as outputs
           movwf TRISE
           movlw B'00001111'          ;  RD7-RD4 outputs others Input
           movwf TRISD
           bcf STATUS, RP0                       return
================================================================

Thanks for reading this far...
Aart.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\04\29@203300 by Tony Nixon

flavicon
picon face
Aart wrote:
{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.




--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
spam_OUTsalesTakeThisOuTspampicnpoke.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\04\29@205415 by Drew Vassallo

picon face
> > i'm working with a LCD (HD44780, 2x16 4 wire mode) i used code from
>called WKTIM4M.ASM (thx :). This worked great with a 16F84 but now i want
>to use it at an 16F877 but it won't work.
> >             bsf STATUS, RP0
> >             movlw B'00000000'          ;  RE all as outputs
> >             movwf TRISE
> >             movlw B'00001111'          ;  RD7-RD4 outputs others Input
> >             movwf TRISD
> >             bcf STATUS, RP0

This probably doesn't affect anything you're doing here, but it's worth
mentioning that in changing from a 16F84 to a 16F87x chip, you have to
concern yourself with the RP1 status bit as well as the RP0 bit when
selecting banks.

To be correct, use bcf STATUS, RP1 and bsf STATUS, RP0 for bank 1.  It could
trick you up, especially since some files can be accessed through banks 0
and 2, and 1 and 3.
Unless you know from where you're coming in your code, you should try to set
both bank bits to what you really need, not just the RP0 bit.

--Andrew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\04\29@222913 by Aart

picon face
> 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.


2001\04\30@001154 by Tony Nixon
flavicon
picon face
Aart wrote:
>
> > 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

Try adding this...


           movlw B'00000000'          ;  RA0-5 = outputs
           movwf TRISA
           movlw B'00000000'          ;  RB0-7 = outputs
           movwf TRISB
           movlw B'00000000'          ;  RC0-7 = outputs
           movwf TRISC

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam@spam@picnpoke.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\30@001952 by Tony Nixon

flavicon
picon face
Aart wrote:

> 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).

OutMessage:
 movwf  FSR                    ;  Point at first letter
OutLoop:
 movf   FSR, w                 ;  Get pointer into W
 incf   FSR, f                 ;  Set up for next letter
 call   shomsg                 ;  Get character to output
 iorlw  0                      ;  At the End of the Message?
 btfsc  STATUS, Z              ;  Skip if not at end
 return                        ;  Yes - Equal to Zero
 call   SendCHAR               ;  Output the ASCII Character
 goto   OutLoop                ;  Get the next character

I would change the FSR references to "Temp1", or define a new RAM
location like "CharIndex".

Eg

OutMessage:
 movwf CharIndex
OuLoop:
 movf   CharIndex, w                 ;  Get pointer into W
 incf   CharIndex, f                 ;  Set up for next letter
 etc...
 etc...

Although the FSR is primarily intended for indirect addressing, it can
be used in the way presented, but it is best to use a GP RAM location
instead.


--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
.....salesKILLspamspam.....picnpoke.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\30@004731 by Aart

picon face
----- Original Message -----
From: "Tony Nixon" <Tony.Nixonspamspam_OUTENG.MONASH.EDU.AU>
To: <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU>
Sent: Monday, April 30, 2001 6:10 AM
Subject: Re: [PIC]: LCD From 16F84 to 16F877


{Quote hidden}

Done!

No respons at all, even RA,0 won't change for half a sec. Can't find out
what's wrong.

Full code at http://aart.myip.org/test/     .

I'm using a boot loader but that seems to work fine (with the test program,
in C) then there's happening something, the test program sends a string and
echo's characters at 19.200 . So the circuit seems to function okay. All
lines are okay double checked it 5 times.
HELP!!

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\04\30@035437 by Ben Suffolk

flavicon
face
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 <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>




To:   spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU
cc:    (bcc: Ben SUFFOLK/EN/HTLUK)


Subject:  Re: [PIC]:  LCD  From 16F84 to 16F877



{Quote hidden}

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 TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\30@142359 by Aart

picon face
> 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.
>

Not necessary anymore.. IT WORKS! i made a mistake with the CBLOCK, didn't
change the variable "CBLOCK    0Ch"  to  "CBLOCK   20h" which is necessary
for the '877.

Thank you all for your help so far!

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2001\04\30@172201 by Olin Lathrop

face picon face
> Not necessary anymore.. IT WORKS! i made a mistake with the CBLOCK, didn't
> change the variable "CBLOCK    0Ch"  to  "CBLOCK   20h" which is necessary
> for the '877.

Yet another reason for using relocatable mode and the RES directive.  Too
bad you can't go back and spend the time wasted on this bug to learn about
relocatable mode instead.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinEraseMEspam.....embedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body



'[PICLIST] From 16F84 to 16F877'
2002\03\06@184403 by Larry Bradley
flavicon
face
I've built a couple of project using the 16F84, using an ancient programmer
designed by Steve Marchant driven from a PC parallel port; I have the PC
source for the programmer. It is very similar to the programmer described
in the Microchip documentation, as I recall - it has been a couple of years
since I have "PICed"

I now would like to play around with the newer PICs, such as the 16F877.

Question 1: is the physical programming of the new units the same as the
F84 (in terms of voltages and timing)?.

Question 2: Are there different registers etc that have to be set up
compared to the F84 (during programming)?

I have the data sheets for both products, but if someone out there has gone
through this type of thing already, I'd appreciate any guidance.

I'm not a large user of PICs, so buying a commercial programmer doesn't
make economic sense.

Thanks in advance

Larry


Larry Bradley
Orleans (Ottawa), Ontario, CANADA

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2002\03\06@185013 by Tony Nixon

flavicon
picon face
Larry Bradley wrote:
>
> Question 1: is the physical programming of the new units the same as the
> F84 (in terms of voltages and timing)?.

Yes. The actual programming time is shortened, but that is internal to
the PIC.

> Question 2: Are there different registers etc that have to be set up
> compared to the F84 (during programming)?

Nope.

The only diference, will be ROM/EEPROM size.

Also, take note of the LVP pin, RB3. Keep it LOW while programming.


--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
RemoveMEsalesspam_OUTspamKILLspambubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspamspammitvma.mit.edu with SET PICList DIGEST in the body


2002\03\07@054112 by Peter Onion

flavicon
face
On 06-Mar-02 Tony Nixon wrote:
>
> The only diference, will be ROM/EEPROM size.
>
> Also, take note of the LVP pin, RB3. Keep it LOW while programming.

I don't believe RB3 needs to be controled if you are using
traditional "high voltage" programing method.

If you are using "low voltage" programing then of course RB3 must be controled

Peter

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspamspamspamBeGonemitvma.mit.edu


2002\03\07@055340 by cdb

flavicon
<HTML><HEAD>
<BASEFONT FACE="Arial" SIZE="2" COLOR="#000000">
</HEAD>
<BODY>
<div>I have found keeping the LVP pin low during high voltage programming has eradicated programming errors I had been having if I left it floating.</div>
<div>&nbsp;</div>
<div>colin</div>
<div><FONT FACE="Arial" SIZE=2>-- </FONT></div>
<div><FONT FACE="Arial" SIZE=2>cdb, RemoveMEbodgy1KILLspamspamoptusnet.com.au on 07/03/2002</FONT></div>
</body></html>

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestSTOPspamspamspam_OUTmitvma.mit.edu


2002\03\07@061327 by Peter Onion

flavicon
face
Somewhere in the middle of a load of html you said

"I have found keeping the LVP pin low during high voltage programming
has eradicated programming errors I had been having if I left it floating."

I've built my own "high voltage" programmer which doesn't do anything with
RB3 and not had any problems with errors at all.

I wouldn't expect the state of RB3 to have any importance if LVP isn't
enabled in the config word.

YMMV

Peter.

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestSTOPspamspamEraseMEmitvma.mit.edu


2002\03\07@082528 by Bob Ammerman

picon face
But LVP _is_ enabled in the config on a brand new part.

Bob Amemrman
RAm Systems

----- Original Message -----
From: "Peter Onion" <KILLspamponionspamBeGonespamSRD.BT.CO.UK>
To: <EraseMEPICLISTspamEraseMEMITVMA.MIT.EDU>
Sent: Thursday, March 07, 2002 3:16 AM
Subject: Re: From 16F84 to 16F877


> Somewhere in the middle of a load of html you said
>
> "I have found keeping the LVP pin low during high voltage programming
> has eradicated programming errors I had been having if I left it
floating."
{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2002\03\07@083557 by Peter Onion

flavicon
face
On 07-Mar-02 Bob Ammerman wrote:
> But LVP _is_ enabled in the config on a brand new part.

Oh !  Well I've just been lucky then !   First thing I do with new parts is
program the fuses and turn lvp off !

Peter.

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestspam_OUTspammitvma.mit.edu


2002\03\07@105046 by Mike Mansheim

flavicon
face
>> The only diference, will be ROM/EEPROM size.
>> Also, take note of the LVP pin, RB3. Keep it LOW while programming.

>I don't believe RB3 needs to be controled if you are using
>traditional "high voltage" programing method.

When the F87x flash parts first came out, a lot of programming problems
were solved by grounding RB3 during high voltage programming.  It's
documented in the archives, and we certainly had that experience here.
You are right - it shouldn't matter, but it did.  I don't know if there
was a problem with the chip that Microchip subsequently fixed, but we
keep doing it whenever we use those parts.

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-request.....spamTakeThisOuTmitvma.mit.edu


2002\03\07@155748 by Byron A Jeff

face picon face
On Thu, Mar 07, 2002 at 10:44:44AM -0000, Peter Onion wrote:
> On 06-Mar-02 Tony Nixon wrote:
> >
> > The only diference, will be ROM/EEPROM size.
> >
> > Also, take note of the LVP pin, RB3. Keep it LOW while programming.
>
> I don't believe RB3 needs to be controled if you are using
> traditional "high voltage" programing method.

There has been at least one errata sheet published by Microchip that indicates
that on some silicon revisions that a floating LVP pin can cause the chip to
screw up going into programming mode, even when programming in HVP mode.

It's always best to ground RB3/LVP when programming.

>
> If you are using "low voltage" programing then of course RB3 must be controled

Of course.

BAJ

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestKILLspamspamspammitvma.mit.edu


2002\03\07@160629 by Thomas N

picon face
What is the different between High voltage Programming and LVP?  Why do we
want LVP or HVP?
Thomas


{Quote hidden}

_________________________________________________________________
Join the world s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspammitvma.mit.edu


2002\03\07@195346 by Byron A Jeff

face picon face
On Thu, Mar 07, 2002 at 09:04:27PM +0000, Thomas N wrote:
> What is the different between High voltage Programming and LVP?

HVP uses a nominal 13V signal on the MCLR pin to indicate that the PIC should
go into programming mode.

LVP uses a separate dedicated I/O (RB3 onthe 16F87X series, RB4 on the 16F62X
series) to indicate to the PIC when to go into programming mode.

The HVP/LVP mode is controlled by the LVP config bit in the config word. Note
that the LVP bit cannot be reprogrammed in LVP mode.

Note that HVP is just an indicator signal for all flash parts. All of the
flash chips have an internal high voltage generator for actually programming
the flash cells.


> Why do we want LVP or HVP?

Each has pros and cons. The primary question is the cost of an I/O pin vs.
having to dedicate a programmable high voltage source in the programmer which
makes it more complicated to design.

In broad strokes HVP is probably better for the professional PIC user. LVP
is great for the hobbiest because you can get started cheaply and quickly.
For example my Trivial LVP programmer (http://www.finitesite.com/d3jsys) only
consists of two parts, cables, and a 5V power source which is easily obtainable
from the programmer host. Changing to HVP would require at minimum the high
voltage supply and a transistor switch.

However LVP has its issues too. First and foremost is that an I/O pin is
permanently unavailable. I've been using 16F877's recently and I haven't
missed it too much. The next annoying thing is that since all of the midrange
PIC's pins on the edges of ports had already been allocated for special
functions, they had to pick a pin that's in the middle of a port (RB3 or RB4)
which breaks up a perfectly good 8 bit I/O port. I've learned to live with it.

That's the scoop. Hope it helps,

BAJ

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu


2002\03\08@095018 by Herbert Graf

flavicon
face
LVP is just that, low voltage programming. The benefit is that you don't
need a high voltage (~13VDC) to program the PIC. The con is that you lose an
I/O. TTYL

> {Original Message removed}

2002\03\09@165106 by uter van ooijen & floortje hanneman

picon face
> I don't believe RB3 needs to be controled if you are using
> traditional "high voltage" programing method.
>
> If you are using "low voltage" programing then of course RB3 must be
controled

Oh oh, not again! At the very least there are versions of the various new
flash chips that DO require that LVP is low *even when using HVP*. So just
do it (pull LVP low) and don't spend time solving strange programming
problems...

Wouter van Ooijen
--
Van Ooijen Technische Informatica: http://www.voti.nl
Jal compiler, Wisp programmer, WLoader bootloader, PICs kopen

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...