Searching \ for '[PIC]: 16F674 hex code onto 16F677' 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: '16F674 hex code onto 16F677'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 16F674 hex code onto 16F677'
2003\03\20@060545 by Quentin

flavicon
face
Hi all
I am helping a friend with a hobby project. He send me a hex file for
16F674 (4K) but I only have 16F677 (8K) in stock. I never worked with
hex files before (except upgrading picstart), so my question is: What do
I have to do (if any) to put the code on a 16f677?

In case you were wondering where the code comes from:
gm.cnc.free.fr
OR
http://www.rc-aero.net

I don't really want to waste time disasembling the code. (Would be
quicker to go and buy a 16F674).


Quentin
spam_OUTqscTakeThisOuTspamiptech.co.za
http://www.iptech.co.za

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

2003\03\20@070311 by Mike Harrison

flavicon
face
Depends a lot on how the code is written - it may just run, but if it uses banked vars in the upper
common area it will fall over.
On Thu, 20 Mar 2003 12:59:54 +0200, you wrote:

{Quote hidden}

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

2003\03\20@081411 by Dennis Crawley

flavicon
face
16F*6*77?

I can't find that reference neither in the web site nor in Tech ref CD.
Could you post link to that datasheet?

Thanks
Dennis

{Original Message removed}

2003\03\20@084319 by Olin Lathrop

face picon face
> I am helping a friend with a hobby project. He send me a hex file for
> 16F674 (4K) but I only have 16F677 (8K) in stock. I never worked with
> hex files before (except upgrading picstart), so my question is: What do
> I have to do (if any) to put the code on a 16f677?

He is either mistaken or just sent you to fetch a #5 skyhook.  My line
card shows no such thing as a PIC 16F674 or 16F677, even the vaporware
section.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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

2003\03\20@090559 by hael Rigby-Jones
picon face
> > I am helping a friend with a hobby project. He send me a hex file for
> > 16F674 (4K) but I only have 16F677 (8K) in stock. I never worked with
> > hex files before (except upgrading picstart), so my question is: What do
> > I have to do (if any) to put the code on a 16f677?
>
> {Original Message removed}

2003\03\20@092815 by Quentin

flavicon
face
Sooorry!!!
Let me pick my brain up from the floor... :)
16F874 and 877
Anyway, I loaded it on a 877 and will see tonight if it works.
> #5 skyhook
No, but I would like a bottle of 5A Blue current!
(old joke we played on the aprentices)

--
Quentin
qscspamKILLspamiptech.co.za
http://www.iptech.co.za

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

2003\03\20@094846 by Larry Bradley

flavicon
face
I'm doing some development for a client using an 16F876, but he is using an
872. I tried the 872 hex file on the 876 and it does NOT work. The only
obvious difference in the two chips is the 876 has more memory.


At 04:27 PM 3/20/2003 +0200, you wrote:
{Quote hidden}

Larry Bradley
Orleans (Ottawa), Ontario, CANADA

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

2003\03\20@103146 by Mike Harrison

flavicon
face
On Thu, 20 Mar 2003 09:48:04 -0500, you wrote:

>I'm doing some development for a client using an 16F876, but he is using an
>872. I tried the 872 hex file on the 876 and it does NOT work. The only
>obvious difference in the two chips is the 876 has more memory.

There are some less obvious differences, in partictular the top area of RAM is shared across all
banks,  where  the lower-end parts have completely seperate banks. There is also an extra program memory page preselect bit, but this would not normally cause a
problem.

{Quote hidden}

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

2003\03\20@104609 by Quentin

flavicon
face
I've developed a project on 16F876 and then changed it to a 870 for
production. All I had to do was change the type and the header. But I
must say I did develop the code to be used on an 870 eventually.
Still, what I want to do is the other way around so let's see.

I see some banking but it looks like it is mostly for the FSR's. The
code is a bit difficult to read as it was not written with assembler.
(If you want to see how much code space and time programming with C or
Basic waste, dissasemble the hex file.)

> I'm doing some development for a client using an 16F876, but he is using an
> 872. I tried the 872 hex file on the 876 and it does NOT work. The only
> obvious difference in the two chips is the 876 has more memory.


--
Quentin
qscspamspam_OUTiptech.co.za
http://www.iptech.co.za

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

2003\03\20@110205 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Quentin [SMTP:@spam@qscKILLspamspamIPTECH.CO.ZA]
> Sent: Thursday, March 20, 2003 3:45 PM
> To:   KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU
> Subject:      Re: [PIC]: 16F674 hex code onto 16F677
>
> I see some banking but it looks like it is mostly for the FSR's. The
> code is a bit difficult to read as it was not written with assembler.
> (If you want to see how much code space and time programming with C or
> Basic waste, dissasemble the hex file.)
>
The reason it's not very readable is that compilers can use tricks to
optimise code that would not be easily understandable or maintainable in
ASM.  The code produced by the popular PIC c compilers is actually very good
in most circumstances.

Mike


=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to RemoveMEpostmasterTakeThisOuTspambookham.com.

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

2003\03\20@110408 by Olin Lathrop

face picon face
> Anyway, I loaded it on a 877 and will see tonight if it works.

It may not work.  The 16F874 has unique RAM at F0h - FFh, whereas the
16F877 has this region aliased to 70h - 7Fh.  If the code doesn't use RAM
from F0h - FFh and doesn't screw eith the RP1 bit in STATUS (bad
programming practise, but there seems to be no shortage of bad
programmers), it should work.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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

2003\03\20@113113 by Dale Botkin

flavicon
face
On Thu, 20 Mar 2003, Michael Rigby-Jones wrote:

> The reason it's not very readable is that compilers can use tricks to
> optimise code that would not be easily understandable or maintainable in
> ASM.  The code produced by the popular PIC c compilers is actually very good
> in most circumstances.

*IF* the programmer understands the PIC and the compiler.  I've put a lot
of time into my most recent project just going through the asm listing
produced by the compiler, looking for ways to write better C code to
produce more compact assembly code.  If you write C just like for a system
where there are virtually no resource limits, you'll get correspondingly
inefficient code.

Dale
--
It's a thankless job, but I've got a lot of Karma to burn off.

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

2003\03\20@121500 by Alan B. Pearce

face picon face
>No, but I would like a bottle of 5A Blue current!
>(old joke we played on the aprentices)

Yeah, but you gotta use the right coloured wire for the 'lectricity else the
electrons get lost .... :)))))

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

2003\03\20@144955 by Quentin

flavicon
face
First, the 877 works, thanks all! But I am still going to get him an 874.
> The reason it's not very readable is that compilers can use tricks to
> optimise code that would not be easily understandable or maintainable in
> ASM.  The code produced by the popular PIC c compilers is actually very good
> in most circumstances.

I am not just talking about the readability, but the waste of program
space and execution time.
The code is full of the following for example:
       BTFSS some_bit
       GOTO    A
       GOTO    B

A       GOTO    C ;Or Somewhere_else
B       GOTO    Anada_place
C       GOTO    Anada_nada_place ;Sometimes this line is also here for
                                ;some reason.
That is a lot of GOTOs just to test a bit (between 3 to 5 GOTO's everytime).

--
Quentin
spamBeGoneqscspamBeGonespamiptech.co.za
http://www.iptech.co.za

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

2003\03\20@150419 by Quentin

flavicon
face
> (between 3 to 5 GOTO's everytime).

OK, Make that 7 GOTO's.
Figure this one out (maybe it was just a bad program the guy was using):

062B      btfss  0x5,0x5
062C      goto   0x62F
062D      goto   0x62E
062E      goto   0x631
062F      goto   0x630
0630      goto   0x626
0631      goto   0x633
0632      goto   0x633
0633      bsf    0x3,0x5
--
Quentin
TakeThisOuTqscEraseMEspamspam_OUTiptech.co.za
http://www.iptech.co.za

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

2003\03\20@151039 by Ned Konz

flavicon
face
On Thursday 20 March 2003 11:49 am, Quentin wrote:
{Quote hidden}

Then you're using a poor compiler.

As an example of what a decent compiler can do,
here's some output from the Microchip C18 compiler
(yes, I know this is a different family, but that doesn't matter for this code):

00090a   a2ab     BTFSS     0xab,0x1,0x0        if (RCSTAbits.OERR)                     // overrun?
00090c   d004     BRA       0x916
                                               {
00090e   98ab     BCF       0xab,0x4,0x0                RCSTAbits.CREN = 0;             // disable receiver
000910   88ab     BSF       0xab,0x4,0x0                RCSTAbits.CREN = 1;             // enable receiver
000912   8403     BSF       0x3,0x2,0x0                 ISRFlags.overrunError = 1;
                                               }
000914   d01b     BRA       0x94c               else if (RCSTAbits.FERR)        // framing error? now what?
000916   a4ab     BTFSS     0xab,0x2,0x0
000918   d004     BRA       0x922
                                               {
                                                       uchar c;

00091a   cfae     MOVFF     0xfae,0xca                  c = RCREG;                              // just read bad byte
00091c   f0ca
00091e   8603     BSF       0x3,0x3,0x0                 ISRFlags.framingError = 1;
                                               }

--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

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

2003\03\21@025710 by hael Rigby-Jones

picon face
{Quote hidden}

Absolutely.  When I started using HiTech many years ago I spent considerable
amounts of time looking at the ASM produced so that I could let the compiler
produce the most efficient code.  I know some people would regard this as a
waste of time when they could achieve simmilar results in assembler, but
once you've learnt a compilers habits you can start banging out pretty
decent code much faster than an ASM programmer could.

Mike


=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to EraseMEpostmasterspambookham.com.

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

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