Searching \ for '[PIC] Probably Something Simple' 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: 'Probably Something Simple'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Probably Something Simple'
2006\12\09@082848 by DAX2

picon face
I'm doing a project for work using a 12F675 PIC. I tried using the following code snippet ...

;***** VARIABLE DEFINITIONS

Mark1       EQU     0x20        ;time delay variable
General     EQU     0x21        ;keeps track of time point
Tenthsec   EQU     0x22

;**********************************************************************

#define    sec     General,0
             lon      General,1
             ORG     0x000             ; processor reset vector
             goto    Start

... and when I compiled I got an Illegal OpCode for the General variable. So I tried it this way ...

Mark1       EQU     0x20        ;time delay variable
General     EQU     0x21        ;keeps track of time point
Tenthsec   EQU    0x22
Ledon       EQU     0x23

;**********************************************************************

#define    sec     General,0
             lon      Ledon,0
             ORG     0x000             ; processor reset vector
             goto    Start

... Now I get the Illegal OpCode for the Ledon variable instead.

Can someone explain what I'm doing wrong?

I assumed General would be an 8 bit variable with "sec" using bit 0. That's why I tried the first set.
JFTR, without "lon" the first set compiles with no error. So does the second set without the Ledon and lon entries.
My aim is to flag a low transient.

2006\12\09@091849 by Jan-Erik Söderholm

face picon face
WHat is "lon" ??

Jan-Erik.

spam_OUTdax2TakeThisOuTspamhotmail.com skrev:
{Quote hidden}

2006\12\09@092157 by Howard Winter

face
flavicon
picon face
On Sat, 9 Dec 2006 08:28:36 -0500, .....dax2KILLspamspam@spam@hotmail.com wrote:

{Quote hidden}

I think so - you need "#define" on the second line as well as the first.  Otherwise it's trying to compile it as an
instruction, rather than it being a compiler directive.

Cheers,


Howard Winter
St.Albans, England


2006\12\09@100419 by DAX2

picon face
Same thing as "sec", a bit flag. For me, it stands for "LED on". Does it
make a difference what it's called?

{Original Message removed}

2006\12\09@100614 by DAX2

picon face
Then both lines need to start with #define then? I didn't know that. Then
that's the problem. Thank you!

{Original Message removed}

2006\12\09@102602 by Jan-Erik Söderholm

face picon face


dax2spamKILLspamhotmail.com skrev:
> Same thing as "sec", a bit flag. For me, it stands for "LED on".
> Does it make a difference what it's called?

Yes, since you are using "lon" as if it was an MPASM instruction,
but it isn't.

*Maybe* you're missing a #define", how should *I* know
what you're doing... :-)


Best Regards,
Jan-Erik.


>
> {Original Message removed}

2006\12\09@112545 by DAX2

picon face
Thank you, Jan-Erik. That was most helpful.

----- Original Message -----
From: "Jan-Erik Söderholm" <.....jan-erik.soderholmKILLspamspam.....telia.com>
To: "Microcontroller discussion list - Public." <EraseMEpiclistspam_OUTspamTakeThisOuTmit.edu>
Sent: Saturday, December 09, 2006 10:24 AM
Subject: Re: [PIC] Probably Something Simple



dax2spamspam_OUThotmail.com skrev:
> Same thing as "sec", a bit flag. For me, it stands for "LED on".
> Does it make a difference what it's called?

Yes, since you are using "lon" as if it was an MPASM instruction,
but it isn't.

*Maybe* you're missing a #define", how should *I* know
what you're doing... :-)


Best Regards,
Jan-Erik.


{Quote hidden}

>> --

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