Searching \ for '[Pic:] 12F675 strange behaviour' 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=pic
Search entire site for: '12F675 strange behaviour'.

Exact match. Not showing close matches.
PICList Thread
'[Pic:] 12F675 strange behaviour'
2004\04\21@222733 by Jason S

flavicon
face
I'm using a 12F675 for the first time and I'm getting some very strange behaviour.

At this point, I have a simple program that just sets all the outputs.  I have GP0, GP1, and GP2 connected to an RGB led through 220 ohm resistors.  The LED dies are lit up to a barely noticable brightness.  
When I measure the outputs I get about 15 milivolts.  I can't measure anything across the resistor, and there's about 15 milivolts and 10 microamps across and through the LED segments.

I'm powering the circuit from 3 new AA batteries (and I did test them).

My whole source code is:

START MOVLW b'10001111'    OPTION
 CLRF 5        MOVLW   b'00001000'    TRIS 5
 BSF  5,0
 BSF  5,1
 BSF  5,2
 BSF  5,4
 BSF  5,5
 END

I know I shouldn't be using OPTION and TRIS, but that shouldn't stop it from working.

My config bits are:
Osc:  Internal RC No Clock
WDT: Off
Power Up Timer: On
Master Clear Enable: Internal
Brown Out Detect: On    Code Protect: Off
Data EE Read Protect: Off

Any ideas what I'm doing wrong here?

Thanks,
 Jason

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\04\21@232621 by William Chops Westfield

face picon face
On Wednesday, Apr 21, 2004, at 19:30 US/Pacific, Jason S wrote:

> At this point, I have a simple program that just sets all the outputs.
>  I have GP0, GP1, and GP2 connected to an RGB led through 220 ohm
> resistors.  The LED dies are lit up to a barely noticable brightness.
>
> When I measure the outputs I get about 15 milivolts.  I can't measure
> anything across the resistor, and there's about 15 milivolts and 10
> microamps across and through the LED segments.
>
been there, did that.  Make sure you turn of the analog comparator,
which owns some of the pins by default.

BillW

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\04\22@001317 by Eric Bohlman

picon face
On Wed, 21 Apr 2004 19:30:35 -0700, Jason S <spam_OUTpicTakeThisOuTspamCANADASPEAKS.COM> wrote:

{Quote hidden}

Not disabling the comparators; by default GP0 and GP1 are comparator pins
rather than digital IO.

BTW, *please* use mnemonics (like "GPIO") for registers rather than
numbers when presenting code for other people to read.

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

2004\04\22@121728 by Andrew Warren

flavicon
face
Eric Bohlman <.....PICLISTKILLspamspam@spam@mitvma.mit.edu> wrote:

> > My whole source code is:
> >
> > START MOVLW b'10001111'
> >   OPTION
> >   CLRF 5
> >   MOVLW   b'00001000'
> >   TRIS 5
> >   BSF  5,0
> >   BSF  5,1
> >   BSF  5,2
> >   BSF  5,4
> >   BSF  5,5
> >   END
> ....
> BTW, *please* use mnemonics (like "GPIO") for registers rather
> than numbers when presenting code for other people to read.

   I'd usually agree that symbols are preferable... But in this
   case, with a tiny program that "SHOULD work", I think the raw
   numbers are far better, since they eliminate the possibility
   that the bug might be an error in the symbol definitions.

   -Andy

=== Andrew Warren -- aiwspamKILLspamcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

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

2004\04\22@184848 by Jason S

flavicon
face
Thanks, that did fix things.  Hopefully actually using the analog input
won't be so difficult :)

Jason

----- Original Message -----
From: "William Chops Westfield" <.....westfwKILLspamspam.....MAC.COM>
To: <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Wednesday, April 21, 2004 8:25 PM
Subject: Re: [Pic:] 12F675 strange behaviour


> been there, did that.  Make sure you turn of the analog comparator,
> which owns some of the pins by default.

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

2004\04\22@185055 by Jason S

flavicon
face
Thanks for the help.

As far as using mnemonics, I deliberately didn't because it's possible the
problem is I'm setting them wrong.  The overall code seemed simpler the way
I posted it and I thought that would be more useful in finding the problem.

I do use mnemonics in my code, but in a case like the question I just asked,
is it really better to use them?

Jason


----- Original Message -----
From: "Eric Bohlman" <ebohlmanspamspam_OUTEARTHLINK.NET>
To: <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU>
Sent: Wednesday, April 21, 2004 9:15 PM
Subject: Re: [Pic:] 12F675 strange behaviour


> BTW, *please* use mnemonics (like "GPIO") for registers rather than
> numbers when presenting code for other people to read.

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

2004\04\23@040327 by Jan-Erik Soderholm

face picon face
Jason S wrote :

> Thanks for the help.
>
> As far as using mnemonics, I deliberately didn't because it's
> possible the problem is I'm setting them wrong.

Hi !
What exactly are you talking about here ?
The symbolic register names are set in the device include file !!
What are *you* setting ???

> The overall code seemed  simpler the way I posted it.

It was not.

> and I thought that would be more useful in
> finding the problem.

It was not, it just got harder to read.
If you say "GPIO", everyone knows what you are saying.
If you say "h'05', most have to pick up the data sheet and
check what register that is. Many just hit the delete button.

> I do use mnemonics in my code, but in a case like the
> question I just asked,  is it really better to use them?

Yes. There are no case I can think of where numeric constants
are better then the symbolic names. (Maybe when debugging
the include files themselfs...)

So do yourself (and us) a big favour and stick to the
symbolic names. The only way this could go wrong, is if
there is an error in the supplied device include files.
Highly unlikely for a chip that have been out
for some time now.

Jan-Erik.

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

2004\04\23@041403 by Matt Marsh

flavicon
face
> > The overall code seemed  simpler the way I posted it.
>
> It was not.
>
> > and I thought that would be more useful in
> > finding the problem.
>
> It was not, it just got harder to read.
> If you say "GPIO", everyone knows what you are saying.

I've been wondering how to best go about setting multiple flags when
setting up INTCON for example. So, to begin with I was doing:

       movlw   b'10100000'     ; Enable timer interrupts
       movwf   INTCON

I presume that the recommendation is to set the flags individually,
even though it might cost an instruction or two, for the sake of
being easier to read:

       clrf    INTCON
       bsf     INTCON,T0IE
       bsf     INTCON,GIE

Or is there a better way of doing it when setting multiple flags?

Thanks,
Matt

--
Matt N. Marsh
Email: KILLspammattKILLspamspammattmarsh.net          Yahoo: marshmn
 Web: http://www.mattmarsh.net/  Jabber: RemoveMEmattmarshTakeThisOuTspamjabber.org
                                    MSN: spamBeGonemattspamBeGonespammattmarsh.net
                                    ICQ: 250467363
                                    AIM: MattMarshUK

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

2004\04\23@043311 by Jan-Erik Soderholm

face picon face
> I've been wondering how to best go about setting multiple flags when
> setting up INTCON for example. So, to begin with I was doing:
>
>         movlw   b'10100000'     ; Enable timer interrupts
>         movwf   INTCON
>
> I presume that the recommendation is to set the flags individually,
> even though it might cost an instruction or two, for the sake of
> being easier to read:
>
>         clrf    INTCON
>         bsf     INTCON,T0IE
>         bsf     INTCON,GIE

Hi.
Many (incl me) find the following way of coding
to be easy to read and self-documentary :
(It should line up using a fixed pitch font...)

  movlw   b'10100000'     ; Enable timer interrupts
;            1-------        Set GIE
;            -0------        Clear PEIE
;            --1-----        Set T0IE
;            ---0----        Clear INTE
;            ----0---        Clear GPIE
;            -----0--        Clear T0IF
;            ------0-        Clear INTF
;            -------0        Clear GPIF

  movwf   INTCON

It's easy to read, and uses fewer instructions then
multiple bcf/bsf.

Regards,
Jan-Erik

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

2004\04\23@044804 by Jinx

face picon face
> I presume that the recommendation is to set the flags individually,
> even though it might cost an instruction or two, for the sake of
> being easier to read:

In the long run you'll thank yourself for using individual BSFs to
improve readability. Unless there's a desperate need to save
time I would always use

       clrf    INTCON
       bsf     INTCON,T0IE
       bsf     INTCON,GIE

rather than

     movlw   b'10100000'
       movwf   INTCON

as SFR bits have descriptive names, which is half-way to a comment

The usual exception is when setting ports, but bits are commented,
eg (lines up with fixed font)

        clrf    portd
        movlw   b'11110011'
;                  1111        thumbwheel data
;                      0       n/u
;                       0      delayed 5ms pulse out
;                        1     x10 switch
;                         1    power good
        movwf   trisd

or SFRs with several related bits, eg CCP or timer

        movlw   b'00000111'
;                  x
;                   0000      1:1 post-scale
;                       1     Timer2 on
;                        1x   1:16 pre-scale
        movwf   t2con

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

2004\04\23@045840 by William Chops Westfield

face picon face
On Friday, Apr 23, 2004, at 01:32 US/Pacific, Jan-Erik Soderholm wrote:

>> I've been wondering how to best go about setting multiple flags when
>> setting up INTCON for example. So, to begin with I was doing:
>>
>>         movlw   b'10100000'     ; Enable timer interrupts
>>         movwf   INTCON
>>
>> I presume that the recommendation is to set the flags individually,
>> even though it might cost an instruction or two, for the sake of
>> being easier to read:
>>
>>         clrf    INTCON
>>         bsf     INTCON,T0IE
>>         bsf     INTCON,GIE

how about
       movlw   (1<<TOIE)|(1<<GIE)
       movwf   INTCON

BillW

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

2004\04\23@051748 by hael Rigby-Jones

picon face
{Quote hidden}

You can also use this format to show bits without resorting to multiple
bsf/bcf

       movlw   (1 << T0IE) | (1 << GIE)
       movwf   INTCON

Regards

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
postmasterEraseMEspam.....bookham.com.

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

2004\04\23@055805 by Jinx

face picon face
>         movlw   (1<<TOIE)|(1<<GIE)
>         movwf   INTCON

WCW and MR-J

How does that work ? I can see the inclusive-OR but..... (are
those left shifts ?)

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

2004\04\23@061147 by hael Rigby-Jones

picon face
>-----Original Message-----
>From: Jinx [EraseMEjoecolquittspamCLEAR.NET.NZ]
>Sent: 23 April 2004 10:58
>To: RemoveMEPICLISTEraseMEspamEraseMEMITVMA.MIT.EDU
>Subject: Re: [Pic:] 12F675 strange behaviour
>
>
>>         movlw   (1<<TOIE)|(1<<GIE)
>>         movwf   INTCON
>
>WCW and MR-J
>
>How does that work ? I can see the inclusive-OR but..... (are
>those left shifts ?)

Yes, due to the format of the PIC bit instructions, the bit definitions are
simply the bit position.  By shifting 1 left by the bit position you create
a simple bit mask.  The OR function is used to combine multiple bitmasks
together.


e.g.

from "P16F84.INC"

GIE                          EQU     H'0007'
EEIE                         EQU     H'0006'
T0IE                         EQU     H'0005'


1 << GIE = B'10000000'
1 << T0IE= B'00100000'
IOR them   B'10100000'

Regards

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
RemoveMEpostmasterspam_OUTspamKILLspambookham.com.

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

2004\04\23@062223 by Jinx

face picon face
> 1 << GIE = B'10000000'
> 1 << T0IE= B'00100000'
> IOR them   B'10100000'

Ah, gotcha. So T0IE is representing, in a user-friendly way, 5

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

2004\04\23@072451 by Ake Hedman

flavicon
face
Jan-Erik,

This

  movlw   b'10100000'     ; Enable timer interrupts
;            1-------        Set GIE
;            -0------        Clear PEIE
;            --1-----        Set T0IE
;            ---0----        Clear INTE
;            ----0---        Clear GPIE
;            -----0--        Clear T0IF
;            ------0-        Clear INTF
;            -------0        Clear GPIF

was actually nice. I usually comes up with something like
(or have since 1979)

       movlw   0xc0    ; Set GIE
                               ; Clear PEIE
                               ; Set T0IE
                               ; Clear INTE
                               ; Clear GPIE
                               ; Clear T0IF
                               ; Clear INTF
                               ; Clear GPIF

       ....

Mostly using a constant of course but the issue is the same.
And this is always hard when you change something. Probably will change
this from now on. Thanks!

/Ake


-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list
[RemoveMEPICLISTTakeThisOuTspamspamMITVMA.MIT.EDU]För Jan-Erik Soderholm
Skickat: den 23 april 2004 10:32
Till: EraseMEPICLISTspamspamspamBeGoneMITVMA.MIT.EDU
Ämne: Re: [Pic:] 12F675 strange behaviour


{Quote hidden}

Hi.
Many (incl me) find the following way of coding
to be easy to read and self-documentary :
(It should line up using a fixed pitch font...)

  movlw   b'10100000'     ; Enable timer interrupts
;            1-------        Set GIE
;            -0------        Clear PEIE
;            --1-----        Set T0IE
;            ---0----        Clear INTE
;            ----0---        Clear GPIE
;            -----0--        Clear T0IF
;            ------0-        Clear INTF
;            -------0        Clear GPIF

  movwf   INTCON

It's easy to read, and uses fewer instructions then
multiple bcf/bsf.

Regards,
Jan-Erik

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

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

2004\04\23@084422 by Kevin Olalde

flavicon
face
and BTW, the first time I saw this method was in Predko's book.

>>>        movlw   (1<<TOIE)|(1<<GIE)
>>>        movwf   INTCON
>>>
>>>

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

2004\04\23@102726 by Bob Ammerman

picon face
>
> I've been wondering how to best go about setting multiple flags when
> setting up INTCON for example. So, to begin with I was doing:
>
>         movlw   b'10100000'     ; Enable timer interrupts
>         movwf   INTCON
>
> I presume that the recommendation is to set the flags individually,
> even though it might cost an instruction or two, for the sake of
> being easier to read:
>
>         clrf    INTCON
>         bsf     INTCON,T0IE
>         bsf     INTCON,GIE
>
> Or is there a better way of doing it when setting multiple flags?
>

  movlw    (1<<T0IE)|(1<<GIE)
  movwf    INTCON

Bob Ammerman
RAm Systems

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

2004\04\23@103143 by Bob Barr

flavicon
face
On Fri, 23 Apr 2004 13:23:07 +0200, Ake Hedman wrote:

<snip>
>was actually nice. I usually comes up with something like
>(or have since 1979)
>
>        movlw   0xc0    ; Set GIE
>                                ; Clear PEIE
>                                ; Set T0IE
>                                ; Clear INTE
>                                ; Clear GPIE
>                                ; Clear T0IF
>                                ; Clear INTF
>                                ; Clear GPIF
>
>        ....
>
>Mostly using a constant of course but the issue is the same.
>And this is always hard when you change something. Probably will change
>this from now on. Thanks!
>

You've actually supplied a very good example illustrating why one
shouldn't take this approach. The comment says one thing (0xA0) but
the code (0xC0) says another. It's a very easy mistake to make but
potentially very difficult to see.


Regards, Bob

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

2004\04\23@113342 by Ake Hedman

flavicon
face
On Fri, 23 Apr 2004 13:23:07 +0200, Ake Hedman wrote:

<snip>
>was actually nice. I usually comes up with something like
>(or have since 1979)
>
>        movlw   0xc0    ; Set GIE
>                                ; Clear PEIE
>                                ; Set T0IE
>                                ; Clear INTE
>                                ; Clear GPIE
>                                ; Clear T0IF
>                                ; Clear INTF
>                                ; Clear GPIF
>
>        ....
>
>Mostly using a constant of course but the issue is the same.
>And this is always hard when you change something. Probably will change
>this from now on. Thanks!
>

You've actually supplied a very good example illustrating why one
shouldn't take this approach. The comment says one thing (0xA0) but
the code (0xC0) says another. It's a very easy mistake to make but
potentially very difficult to see.


Regards, Bob

Ooooops! Yes thats typical. Good this time. :-)
/Ake

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

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

2004\04\23@113348 by William Chops Westfield

face picon face
On Friday, Apr 23, 2004, at 03:22 US/Pacific, Jinx wrote:

>> 1 << GIE = B'10000000'
>> 1 << T0IE= B'00100000'
>> IOR them   B'10100000'
>
> Ah, gotcha. So T0IE is representing, in a user-friendly way, 5

Yep.  And the PIC uses bit numbers rather than masks in the bsf and
related instructions, so all of the symbols are also bit numbers.  The
(1 << bitnum) shift is a standard C hack for converting bit numbers to
masks.  (You wouldn't want to do this at runtime, multiple shifts being
rather inefficient.  But there's not reason not to let the compiler do
the math at compile time.)

BillW

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

2004\04\23@123424 by Jan-Erik Soderholm

face picon face
William Chops Westfield wrote :

> On Friday, Apr 23, 2004, at 03:22 US/Pacific, Jinx wrote:
>
> >> 1 << GIE = B'10000000'
> >> 1 << T0IE= B'00100000'
> >> IOR them   B'10100000'
> >
> > Ah, gotcha. So T0IE is representing, in a user-friendly way, 5
>
> Yep...
> The (1 << bitnum) shift is a standard C hack for converting
> bit numbers to masks.  (You wouldn't want to do this at runtime,
> multiple shifts being rather inefficient.

> But there's not reason not to let the compiler do the math at
> compile time.)

Maybe lack of readability, if you (like me) are not familiar with those
"standard C hacks"...

Jan-Erik.

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

2004\04\23@132035 by Andrew Warren

flavicon
face
Jan-Erik Soderholm <RemoveMEPICLISTKILLspamspammitvma.mit.edu> wrote:

> So do yourself (and us) a big favour and stick to the symbolic
> names. The only way this could go wrong, is if there is an error in
> the supplied device include files.

   Not everyone uses the Microchip-supplied include files,
   Jan-Erik...

   -Andy

=== Andrew Warren -- aiwSTOPspamspamspam_OUTcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

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

2004\04\23@134420 by Jan-Erik Soderholm

face picon face
Andrew Warren wrote :

> Jan-Erik Soderholm <spamBeGonePICLISTSTOPspamspamEraseMEmitvma.mit.edu> wrote:
>
> > So do yourself (and us) a big favour and stick to the symbolic
> > names. The only way this could go wrong, is if there is an error in
> > the supplied device include files.
>
>     Not everyone uses the Microchip-supplied include files,
>     Jan-Erik...

So what ?
If you supply your own include files, what would be the
reason *not* to define (e.g.) GPIO to h'05' ?

I can't see how your comment invalidates my request for
symbolic constants in code snippets posted to the piclist.

Or am I totaly missing your point ?

Best Regards,
Jan-Erik.

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

2004\04\23@173236 by Andrew Warren

flavicon
face
Jan-Erik Soderholm <KILLspamPICLISTspamBeGonespammitvma.mit.edu> wrote:

> If you supply your own include files, what would be the reason
> *not* to define (e.g.) GPIO to h'05' ?
>
> I can't see how your comment invalidates my request for symbolic
> constants in code snippets posted to the piclist.
>
> Or am I totaly missing your point ?

   You and I are in violent agreement; symbolic names are usually
   desirable in code posted to the list.

   IN THIS PARTICULAR CASE, though, I think that the raw constants
   were more useful.  I mean, we were looking for a software bug,
   and one could just as easily have been in the include file as in
   the asm file. Omitting the include file removed one possible
   source of errors.

   The program we were trying to debug was only six or eight lines
   long.  I don't think that doubling its line count by including
   equates for constants used only once would've helped much; after
   all, we'd have had to verify that "5" was the correct definition
   for "GPIO" even if the 5 had appeared in an EQU instead of a
   MOVWF.

   The original poster desired to post the smallest complete example
   that demonstrated the problem he was having, and I think he
   succeeded.

   -Andrew

=== Andrew Warren -- EraseMEaiwspamEraseMEcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

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

2004\04\24@062222 by Jan-Erik Soderholm

face picon face
Andrew Warren wrote :

> Jan-Erik Soderholm <@spam@PICLIST@spam@spamspam_OUTmitvma.mit.edu> wrote:
>
> > I can't see how your comment invalidates my request for symbolic
> > constants in code snippets posted to the piclist.
> >
> > Or am I totaly missing your point ?
>
>     You and I are in violent agreement; symbolic names are usually
>     desirable in code posted to the list.

Fine, I thought so :-)

>     IN THIS PARTICULAR CASE, though, I think that the raw constants
>     were more useful.  I mean, we were looking for a software bug,
>     and one could just as easily have been in the include file as in
>     the asm file.

I Disagree. A bug is the 12f675.inc file is *much less* likely
then is some "home made" source file, that also obviously
doesn't work.


> Omitting the include file removed one possible
> source of errors.

But introduces a number of new sources of errors.
Nothing won, a lot lost.

>
>     The program we were trying to debug was only six or eight lines
>     long.  I don't think that doubling its line count by including
>     equates for constants used only once would've helped much;

No *new* lines needed, just replace the numeric contants with symbols.

*At most* added a single line saying "I'm using MPLAB's include files",
but I've never seen anyone saying that before, and noone have had any
problem with that either...

>     all, we'd have had to verify that "5" was the correct definition
>     for "GPIO" even if the 5 had appeared in an EQU instead of a
>     MOVWF.

Which is exactly my point !
Use the include files as supplied with MPLAB.
There is no reason to verify every EQU in those, are there ?

>     The original poster desired to post the smallest complete example
>     that demonstrated the problem he was having, and I think he
>     succeeded.

It was not the *size* of the code I was talking about.

Apart from those points, yes, we are in violent agreement :-)

Jan-Erik.

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

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