Searching \ for ' MPASM' 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/language/index.htm?key=asm
Search entire site for: 'MPASM'.

No exact or substring matches. trying for part
PICList Thread
'MPALC vs. MPASM ??'
1995\01\05@161154 by crocontroller discussion list

flavicon
face
Harrison Cooper wrote:

>When it ain't broke, don't fix it........
> ....
>when did the switch [from MPALC to MPASM] occur and what is the
>benifits/drawbacks of the MPASM compiler - or is the MPASM the Parralax
>software.
>
>I don't want to have to rewrite my code for a new assembler - and it
>ought to be downward compatible anyway.

Harrison:

Unfortunately, MPALC _was_ broke.

MPASM is NOT Parallax's assembler; theirs is called PASM and is a
much... umm... "leaner" product.

If you've followed generally-accepted rules for writing
assembly-language code (labels starting at the leftmost column, opcodes
starting anywhere else, comments preceded by a semicolon), your code
will be compatible with MPASM.

MPASM drawbacks:

       MPASM needs more free memory than MPALC, since it dynamically
       allocates heap space.  This isn't usually a problem (especially
       for relatively-small programs), and there's a protected-mode
       version of MPASM that uses extended memory, anyway.

MPASM benefits:

       Too numerous to list.  The main ones are:

       It's supported by Microchip.  MPALC support was dropped a year
       ago.

       It works with all existing and future PICs (including the 17Cxx
       series).

       It doesn't have MPALC's math bugs.

       It generates what's called a ".COD" file, which allows true
       source-level debugging with Microchip's PIC-Master emulator and
       MPSIM simulator.

       It adds a number of assembly directives, including a "#define"
       directive that forever solves the problem of addressing the
       correct bit of the wrong byte in bit-oriented instructions.  For
       example:

       With MPALC, you might write:

               DATAIN  EQU     1               ;"DATAIN" IS BIT 1 OF
                                               ;PORTA.
               ....
                       BTFSS   PORTA,DATAIN    ;CORRECT USE.
               ....
                       BTFSS   PORTB,DATAIN    ;INCORRECT USE... I
                                               ;FORGOT TO WHICH PORT
                                               ;"DATAIN" WAS ASSIGNED.

       With MPASM, you can do this:

               #DEFINE DATAIN  PORTA,1         ;"DATAIN" IS BIT 1 OF
                                               ;PORTA.
               ....
                       BTFSS   DATAIN          ;NO NEED TO REMEMBER
                                               ;WHICH PORT, AND NO
                                               ;CHANCE OF ERROR.

       Also, MPASM can create object-code files for use with the
       upcoming linker/librarian.  These object files will also be
       linkable with code generated by Byte Craft Limited's "MPC" C
       compiler.

Since MPASM is compatible with your existing source code (except for
some minor reserved-word conflicts [HIGH and LOW, for instance,
shouldn't be used as symbols in your source code]), it'd probably be a
good idea to move your development to MPASM as soon as possible.

-Andy


--
Andrew Warren - spam_OUTfastfwdTakeThisOuTspamix.netcom.com
Fast Forward Engineering, Vista, California


'Problem with new Rev. MPASM'
1995\06\22@105620 by Andrew Warren
face
flavicon
face
Henry Carl Ott (.....carlottKILLspamspam@spam@INTERPORT.NET) wrote:

>Does anybody know why the following line assembles just fine with the
>Rev. 1.02.05 assembler but generates an illegal character error with
>Rev. 1.10.35?
>
>        movlw   '('
>
>I can work around it but I did not think that the "(" was considered
>a special character when it was inclosed in quotes.

Henry:

The problem's not the parenthesis; it's the quotes.  MPASM 1.10.35 only
accepts double quotes ("") for single-character ASCII literals.  If you
change your source code to read:

       movlw   "("

it will work.

-Andy

P.S.  Future versions of MPASM, like previous versions, will accept
     single quotes.

--
Andrew Warren - fastfwdspamKILLspamix.netcom.com
Fast Forward Engineering, Vista, California


'Warnings with MPASM'
1995\08\12@125519 by Gerry Smith
flavicon
face
Hoe does one make it so that mpasm doesn't give this warning:
Warning: Argument out of range: TRISA (0085).  Least significant bits used.
I specified "list p=16c71" but it still does this.  Anyone have a solution?
Thanks in advance.

1995\08\12@204829 by Andrew Warren

face
flavicon
face
Gerry Smith <.....LIUKBKILLspamspam.....KIRK.NORTHERNC.ON.CA> wrote:

>Hoe does one make it so that mpasm doesn't give this warning:
>Warning: Argument out of range: TRISA (0085).  Least significant bits used.
>I specified "list p=16c71" but it still does this.  Anyone have a solution?

   Gerry:

   Replace all references to "TRISA" with "TRISA ^ 0x80"

   -Andy

--
Andrew Warren - EraseMEfastfwdspam_OUTspamTakeThisOuTix.netcom.com
Fast Forward Engineering, Vista, California

1995\08\13@110101 by Gerry Smith

flavicon
face
Yes I am.  I use the bsf and bcf status,5 before accessing them. I know
it's not just my programming because if I try to complie an546 (a/d converter)
it still gives the same errors.
ttyl

'pasm -> mpasm translator'
1995\08\13@121946 by Aaron Wohl

flavicon
face
I created a translator from Parallax assembly to microchip assembly.
It keeps all the comments.  The Parallax psuedo ops are translated into
their microchip equivilants.   Anyone interested in beta testing it?   I
can mail you uuencoded file.
Aaron Wohl / ham callsign N3LIW / 412-731-3691 / 412-268-5032

1995\08\15@142244 by Claus K|hnel

flavicon
face
>>I created a translator from Parallax assembly to microchip assembly.
>>Anyone interested in beta testing it?   I
>
>Yes, I'm very interested !
>
>Regards
>   Erik
>
--------------
Me Too!
Ciao,
Claus Kuehnel
kuehnelspamspam_OUTdial.eunet.ch


'new MPASM features - documentation'
1995\10\18@122228 by Siegfried Grob
flavicon
face
Hello everyone,

I have ftp'ed the MPASM version 1.21 from rasi.lr.ttu.ee (that is much faster
than ftp.ultranet.com) and it is working fine with my asm-files.
But in a readme-file there were some special variables mentioned like
__MAXRAM or __BADRAM. I have found similar variables in the different PIC
variable initialization files, but the included documentation (I think it is
named usrguide.txt) doesn't mention this new feature anywhere. It seems that
the document has not been updated yet.

Who can point me towards a description of these 'system variables', please, or
post a documentation?

BTW, I still prefer the DOS-version of MPASM. But it only uses the 80x25
character resolution and does not switch back to my preferred 100x40 screen
resolution which is based on the 800x600 graphics res. and provided by most
ET4000 graphic adapters.


Siggi


Siegfried Grob,                                   |
student of electrical engineering,                |
university of ulm, germany                        |
e-mail:  @spam@siegfried.grobKILLspamspamstudent.uni-ulm.de        |
tel&fax: +49 731 25148                            |
--------------------------------------------------'

1995\10\18@232225 by PETE KLAMMER

flavicon
face
> I have ftp'ed the MPASM version 1.21 from rasi.lr.ttu.ee (that is much faster
> than ftp.ultranet.com) and it is working fine with my asm-files.
> But in a readme-file there were some special variables mentioned like
> __MAXRAM or __BADRAM. I have found similar variables in the different PIC
> variable initialization files, but the included documentation (I think it is
> named usrguide.txt) doesn't mention this new feature anywhere. It seems that
> the document has not been updated yet.
>
> Who can point me towards a description of these 'system variables', please, or
> post a documentation?

They were documented in README.1ST from ASM12100.ZIP when I downloaded it
from MCHIPBBS.  The USRGUIDE.TXT in there did not mention them yet.

> BTW, I still prefer the DOS-version of MPASM. But it only uses the 80x25
> character resolution and does not switch back to my preferred 100x40 screen
> resolution which is based on the 800x600 graphics res. and provided by most
> ET4000 graphic adapters.

Agreed!  I have a 132x25 mode which is perfect for viewing listings output
from the assembler, but MPASM insists on switching to 80x25, and does not
switch back.  I suspect this means it would not work if I redirected the
console (CTTY?) to a serial port, etc.  Microchip!  Please give an option
for no-mode-switching standard output from MPASM!

> Siggi

Peter F. Klammer, Racom Systems Inc.                   KILLspamPKlammerKILLspamspamACM.Org
6080 Greenwood Plaza Boulevard                            (303)773-7411
Englewood, CO  80111                                  FAX:(303)771-4708

1995\10\19@053249 by Falstaff

picon face
>
> > I have ftp'ed the MPASM version 1.21 from rasi.lr.ttu.ee (that is much
faster
> > than ftp.ultranet.com) and it is working fine with my asm-files.
> > But in a readme-file there were some special variables mentioned like
> > __MAXRAM or __BADRAM. I have found similar variables in the different PIC
> > variable initialization files, but the included documentation (I think it is
> > named usrguide.txt) doesn't mention this new feature anywhere. It seems that
> > the document has not been updated yet.
> >
> > Who can point me towards a description of these 'system variables', please,
or
{Quote hidden}

Yes!!!

Those silly buggers at bytecraft must believe that everyone uses the
'menu-interface' of the assembler; I just want to run the assembler
directly from my editor (which doesn't like mode changes in its DOS
shell) or from make (in which case my screen is blanked and reset to
80x25).

This way of forcing one's own preferences down the throat of users
seems to come mainly from the example that turbo pascal set back in
1985.

Frank

"Mutual respect, even if we disagree."
------------------------------------------------------------------------
Frank A. Vorstenbosch        +31-(70)-355 5241        RemoveMEfalstaffTakeThisOuTspamxs4all.nl

1995\10\19@124750 by rman

flavicon
face
In message <spamBeGone199510190934.KAA14933spamBeGonespamlistserv.rl.ac.uk>, TakeThisOuTfalstaffEraseMEspamspam_OUTxs4all.nl writes
:
>Those silly buggers at bytecraft must believe that everyone uses the
>'menu-interface' of the assembler; I just want to run the assembler
>directly from my editor (which doesn't like mode changes in its DOS
>shell) or from make (in which case my screen is blanked and reset to
>80x25).

I'm glad I'm not the only person who finds this _really_ annoying.  I
don't expect command line utilities (which is how _I_ use the assembler)
to mess around with the video settings.  It doesn't _need_ to do anything
fancy.  As a compromise, there should be a /NOVIDEO (or somesuch) option
so that those of us with build scripts and extended video modes can work
without this getting in the way.

It can't be that difficult to add an option for this.  Please!

Dave.

1995\10\19@124750 by rman

flavicon
face
In message <RemoveME199510190934.KAA14933spamTakeThisOuTlistserv.rl.ac.uk>, falstaffEraseMEspam.....xs4all.nl writes
:
>Those silly buggers at bytecraft must believe that everyone uses the
>'menu-interface' of the assembler; I just want to run the assembler
>directly from my editor (which doesn't like mode changes in its DOS
>shell) or from make (in which case my screen is blanked and reset to
>80x25).

I'm glad I'm not the only person who finds this _really_ annoying.  I
don't expect command line utilities (which is how _I_ use the assembler)
to mess around with the video settings.  It doesn't _need_ to do anything
fancy.  As a compromise, there should be a /NOVIDEO (or somesuch) option
so that those of us with build scripts and extended video modes can work
without this getting in the way.

It can't be that difficult to add an option for this.  Please!

Dave.

1995\10\19@193711 by Peter Jennings

picon face
> Those silly buggers at bytecraft must believe that everyone uses the
> 'menu-interface' of the assembler; I just want to run the assembler
> directly from my editor (which doesn't like mode changes in its DOS
> shell) or from make (in which case my screen is blanked and reset to
> 80x25).

I'm confused. I use MPASM 1.21 from the DOS command line because I
don't like the menu (e.g. C> MPASM mysrc ) and it doesn't affect my
80x50 display at all. What am I missing here? Works fine from the
editor DOS shell, too.

MPSIM on the other hand does change the display to 80x25. And just
to show how dumb it is, it does it when it exits, so it isn't even
necessary. It would be much nicer if it would use all 50 lines!

Peter
--                                                EraseMEpeterjspamnetcom.com
        URL: http://mall.turnpike.net/~jc/

Stereograms - Shareware - Amateur Radio - WWW Camera Map - Delphi Mysteries

1995\10\20@112441 by John Payson

flavicon
face
> > Those silly buggers at bytecraft must believe that everyone uses the
> > 'menu-interface' of the assembler; I just want to run the assembler
> > directly from my editor (which doesn't like mode changes in its DOS
> > shell) or from make (in which case my screen is blanked and reset to
> > 80x25).
>
> I'm confused. I use MPASM 1.21 from the DOS command line because I
> don't like the menu (e.g. C> MPASM mysrc ) and it doesn't affect my
> 80x50 display at all. What am I missing here? Works fine from the
> editor DOS shell, too.
>
> MPSIM on the other hand does change the display to 80x25. And just
> to show how dumb it is, it does it when it exits, so it isn't even
> necessary. It would be much nicer if it would use all 50 lines!

I have a little 48-byte .COM file I wrote which may be of help.  When run
the first time, it disables all calls to INT 10h; when run a second time,
it re-enables them.  Rather than executing as a TSR, it (blindly) assumes
that the user vectors at 1F0-1F4 [inclusive] will be available for its
use; it uses 1F0-1F3 to store the old INT 10h vector and 1F4 to store a
0CFh instruction [IRET].  If anyone is interested, I could uuencode it and
put it up here (I know, no binaries here, but this one would be less than
four lines long...)

1995\10\26@122306 by Martin McCormick

flavicon
face
       I truly agree for a couple of reasons.  One can send the output to
a file, if desired, to process by some other unrelated utility.
It is also possible to do other non-standard things with the output such
as run it to a speech synthesizer.  Those of us who are blind appreciate
software that can produce standard output because it is much easier to make
it work right for us than programs that only write to the screen buffer.
This feature should not be much trouble to implement because somebody had
to reinvent output to write directly to the screen so why not
make it possible to divert that output to standard output if desired.
a flag to switch between direct screen writes or BIOS should make everybody
happy.

       I do not yet have a programming setup for PIC's, but I have plaid
around with the Motorola 68HC11 whose free assembler totally uses standard
I/O and I have no trouble at all with it.

In message <RemoveMEm0t5ob8-0000nNCEraseMEspamEraseMEdc.cis.okstate.edu>, PETE KLAMMER writes:
>I have a 132x25 mode which is perfect for viewing listings output
>from the assembler, but MPASM insists on switching to 80x25, and does not
>switch back.  I suspect this means it would not work if I redirected the
>console (CTTY?) to a serial port, etc.  Microchip!  Please give an option
>for no-mode-switching standard output from MPASM!


Martin McCormick WB5AGZ  Stillwater, OK 36.7N97.4W
OSU Center for Computing and Information Services Data Communications Group


'Test and an MPASM question'
1995\12\06@105343 by Martin J. Maney
flavicon
face
The test is to see if the reflector will bounce this back as a duplicate,
as it did my recent attempts to reply to the fellow who's trying to drive
power MOSFETs from a PIC.  (BTW, I think you can use a simple open
collector driver with relatively large pullup resistors: since you're
always turning the device on at the supply's zero-corssing the turn-on
delay is unimportant.)

And so to the MPASM question.  I'm using the supplied p16cxx.inc header
and don't care to get the "operand too large" warning every time I
address a port in the upper bank of RAM.  Is there some magic I can
invoke to shut this up?  I really don't want to write "ADCON1 & 0xff" all
over the place, but that would be marginally better than writing the
address as a literal.

What's everyone else doing about this - perhaps one of the other
assemblers available is better?

Thanks.

'Use PICSTART with MPASMX'
1995\12\31@061250 by Maurizio Conti

flavicon
face
Hi,

some questions for a last day of year...

1)
I want to ask like I could program the C84 with the PICSTART using the
PARALLAX ASSEMBLER.
I am doing experiments with the PIC-C compiler of J. Favata and I have only
the PICSTART.
How to create (with MPASMX) an OBJ in format INHEX8 to load with the PICSTART ?

2)
Where could I find the manual for the PARALLAX ASSEMBLER ?
Please send me a complete U.R.L. not a simply indication like "try on
http://www.pallaxinc.com...." thank.



Excuse me all for my "maccheronich" English !!
Thank you to all and good new year.


Maurizio Conti                           / __  __  __       / ___ ____
RemoveMEmcontispam_OUTspamKILLspamiper.net                         / /__)/_  /__) /\  / /_    /
http://www.iper.net                    / /   /__ / \  /  \/ /___  /
Viale Viareggio 19, 47037 Rimini Italy               /
------------------------------------------------------------------


'Thank's about MPASM help!'
1996\03\12@152846 by Dwayne Reid
flavicon
face
>I just looked at the .inc files from Microchip and the definitions are in
>them.  Are you including a .inc file to define registers etc?  If so, the
>above equates are probably in them.
>
>Norm

No, I don't use any .inc files as of yet.  I'll have to start, my source is
getting too hard to handle but not as of yet.  Have a look at some of the
updates to MPASM - at some point they talk about not needing to define W and
F to 1 & 0.  As I said, I've never had to so far.

Dwayne


'Text handling in MPASM'
1996\04\04@040334 by Matthew Rowe
flavicon
face
I have just written an x-y table lookup because I wanted to write the
3 (4) character day string to a similar display:
Charater is returned from (w*4)+counter.
This is easiest with binary length strings e.g. 2,4,8,16
Haven't thought about how to multiply by any other numbers.

day_table   movwf   temp        ;day number 0-6
           clrc
           rlf    temp,f      ;multiply by 2
           rlf    temp,w      ;multiply by 2
                              ;this takes us to the correct day
           addwf  counter,w   ;add char offset within day string 0-3
           addwf  pc,f

           dt  "Sun "
           dt  "Mon "
           dt  "Tue "
           dt  "Wed "
           dt  "Thu "
           dt  "Fri "
           dt  "Sat "
           dt  "Sun "

Write_day   clrf    counter

another     movlw   5           ;write "Fri " as an example.
           call    day_table
           call    write_to_LCD    ;character is now in w. print it.
           incf    counter,f
           movlw   4
           subwf   counter,w
           btfss   status,z
           goto    another_char

spin        goto    spin            ;that's it. done.



There you go. This is from memory of the code I wrote the other day
which worked very nicely. If there are any bugs then it's my memory
at fault.

/\/\att.

1996\04\04@125353 by Scott Dattalo

face
flavicon
face
A couple of comments:


Matthew Rowe wrote:

> <snip>

> Haven't thought about how to multiply by any other numbers.

Well, here's one thought:


>
> day_table   movwf   temp        ;day number 0-6
>             clrc
>             rlf    temp,f      ;multiply by 2
>             rlf    temp,w      ;multiply by 2

Since all of your strings are three characters and not four, you may want to
multiply
the "day number" by three

day_table   movwf   temp        ;day number 0-6
           clrc
           rlf    temp,f      ;multiply by 2, temp = day_number * 2
           addwf  temp,w      ;W = day_number + 2*day_number = 3 * day_number

Of course, you will have to shorten your strings to three characters (by
removing
the extra space character).


Did you see the string handling code I posted on this same thread about a month
ago? It can handle a list of arbitrary length strings. If any anyone's
interested,
I'll re-post it.


Scott

1996\04\05@015430 by Sek Wing Siu

flavicon
face
Hi Scott,
       I am interested in how you handle string of arbitrary length.
Can you repost your code?  Thanks!!

--
   ___       __             _____   _
  /   | ____/ / ___   ____ / ___/  (_) __  __
 / /| |/ __  / / _ \ / __ \\__ \  / / / / / /
/ ___ | /_/ / /  __// / / /__/ / / / / /_/ /
/_/  |_|__,_/  \___//_/ /_/____/ /_/  \__,_/
~~~~~~~~~RemoveMEadensTakeThisOuTspamspampo.eecs.berkeley.edu
        EraseMEadenspamspamspamBeGoneix.netcom.com~~~~~~~~~~~~~~~

1996\04\05@111545 by Scott Dattalo

face
flavicon
face
Sek Wing Siu wrote:
>
> Hi Scott,
>         I am interested in how you handle string of arbitrary length.
> Can you repost your code?  Thanks!!
>


O.K., Here it is again. Remember, this is a cut-and-paste from a working
program. So the comments might be slightly out of context, but there are
no bugs (except the one warning I point out in the comments).


;*******************************************************************
;write_string
;
;  The purpose of this routine is to display a string on the LCD module.
;On entry, W contains the string number to be displayed. The current cursor
;location is the destination of the output.
;
; Memory used
;    buffer2, buffer3
; Calls
;    LCD_WRITE_DATA
; Inputs
;    W = String Number
;
write_string
       CLRF    buffer2                 ;Used as an index into the string table
       MOVWF   buffer3                 ;Save a copy of which string we're to
write
                                       ;Note that no check is made to see if W
is within
                                       ;bounds (5 for my case, since there are
5 strings)
ws1:    CLRC
       RLF     buffer3, W              ;Get the saved copy and multiply it by
two
       ADDWF   PCL, F                  ;Computed GOTO

       CALL    string0                 ;Get next character in the string
       GOTO    ws2

       CALL    string1
       GOTO    ws2

       CALL    string2
       GOTO    ws2

       CALL    string3
       GOTO    ws2

       CALL    string4

ws2:    ANDLW   0xff                    ;"Return" point for computed goto's.
       BTFSC   STATUS, Z               ;If the returned byte is zero, we've
reached the end
       RETURN
       CALL    LCD_WRITE_DATA          ;Write a single character
       INCF    buffer2, F              ;Point to the next character in the
string
       GOTO    ws1

string0 MOVF    buffer2, W              ;Get the string index
       ADDWF   PCL, F                  ;and add it to the PC to get the next
character
       dt   "SENSOR",0                 ;Note the zero termination.

string1 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "SMALL",0

string2 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "MEDIUM",0

string3 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "LARGE",0

string4 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "0123456789ABCDEF",0



You're free to use it with no strings attached. (I couldn't resist!)

Scott

1996\04\05@111545 by Scott Dattalo

face
flavicon
face
Sek Wing Siu wrote:
>
> Hi Scott,
>         I am interested in how you handle string of arbitrary length.
> Can you repost your code?  Thanks!!
>


O.K., Here it is again. Remember, this is a cut-and-paste from a working
program. So the comments might be slightly out of context, but there are
no bugs (except the one warning I point out in the comments).


;*******************************************************************
;write_string
;
;  The purpose of this routine is to display a string on the LCD module.
;On entry, W contains the string number to be displayed. The current cursor
;location is the destination of the output.
;
; Memory used
;    buffer2, buffer3
; Calls
;    LCD_WRITE_DATA
; Inputs
;    W = String Number
;
write_string
       CLRF    buffer2                 ;Used as an index into the string table
       MOVWF   buffer3                 ;Save a copy of which string we're to
write
                                       ;Note that no check is made to see if W
is within
                                       ;bounds (5 for my case, since there are
5 strings)
ws1:    CLRC
       RLF     buffer3, W              ;Get the saved copy and multiply it by
two
       ADDWF   PCL, F                  ;Computed GOTO

       CALL    string0                 ;Get next character in the string
       GOTO    ws2

       CALL    string1
       GOTO    ws2

       CALL    string2
       GOTO    ws2

       CALL    string3
       GOTO    ws2

       CALL    string4

ws2:    ANDLW   0xff                    ;"Return" point for computed goto's.
       BTFSC   STATUS, Z               ;If the returned byte is zero, we've
reached the end
       RETURN
       CALL    LCD_WRITE_DATA          ;Write a single character
       INCF    buffer2, F              ;Point to the next character in the
string
       GOTO    ws1

string0 MOVF    buffer2, W              ;Get the string index
       ADDWF   PCL, F                  ;and add it to the PC to get the next
character
       dt   "SENSOR",0                 ;Note the zero termination.

string1 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "SMALL",0

string2 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "MEDIUM",0

string3 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "LARGE",0

string4 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "0123456789ABCDEF",0



You're free to use it with no strings attached. (I couldn't resist!)

Scott

1996\04\09@022946 by Scott Dattalo

face
flavicon
face
Sek Wing Siu wrote:
>
> Hi Scott,
>         I am interested in how you handle string of arbitrary length.
> Can you repost your code?  Thanks!!
>


O.K., Here it is again. Remember, this is a cut-and-paste from a working
program. So the comments might be slightly out of context, but there are
no bugs (except the one warning I point out in the comments).


;*******************************************************************
;write_string
;
;  The purpose of this routine is to display a string on the LCD module.
;On entry, W contains the string number to be displayed. The current cursor
;location is the destination of the output.
;
; Memory used
;    buffer2, buffer3
; Calls
;    LCD_WRITE_DATA
; Inputs
;    W = String Number
;
write_string
       CLRF    buffer2                 ;Used as an index into the string table
       MOVWF   buffer3                 ;Save a copy of which string we're to
write
                                       ;Note that no check is made to see if W
is within
                                       ;bounds (5 for my case, since there are
5 strings)
ws1:    CLRC
       RLF     buffer3, W              ;Get the saved copy and multiply it by
two
       ADDWF   PCL, F                  ;Computed GOTO

       CALL    string0                 ;Get next character in the string
       GOTO    ws2

       CALL    string1
       GOTO    ws2

       CALL    string2
       GOTO    ws2

       CALL    string3
       GOTO    ws2

       CALL    string4

ws2:    ANDLW   0xff                    ;"Return" point for computed goto's.
       BTFSC   STATUS, Z               ;If the returned byte is zero, we've
reached the end
       RETURN
       CALL    LCD_WRITE_DATA          ;Write a single character
       INCF    buffer2, F              ;Point to the next character in the
string
       GOTO    ws1

string0 MOVF    buffer2, W              ;Get the string index
       ADDWF   PCL, F                  ;and add it to the PC to get the next
character
       dt   "SENSOR",0                 ;Note the zero termination.

string1 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "SMALL",0

string2 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "MEDIUM",0

string3 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "LARGE",0

string4 MOVF    buffer2, W
       ADDWF   PCL, F
       dt   "0123456789ABCDEF",0



You're free to use it with no strings attached. (I couldn't resist!)

Scott

'What is MPASM error code 302'
1996\04\09@202628 by Wilf Melling

flavicon
picon face
I have made a start on my very first PIC project, it is to be a home
alarm system (hopefully). So here my very first plea for help, I keep
getting the following message. I have read the manuals but the answer
does not jump out at me.

Message[302] C:\MPASM\HALARM.ASM 40 : Argument out of range.  Least
significant bits used.

Code sample with line numbers:-
39        Movlw   PORT_B_OUT      ;Define PORTB
40        Movwf   TRISB           ;as output

PORT_B_OUT   EQUates to b11111111

If anyone as any tips or know of any similar projects that have code
available to look at I would be VERY grateful.

TIA


--
Wilf Melling
Tel. +44 802 633888

1996\04\09@205810 by Dave Ritchie

flavicon
face
> Message[302] C:\MPASM\HALARM.ASM 40 : Argument out of range.  Least
> significant bits used.
>
> Code sample with line numbers:-
> 39        Movlw   PORT_B_OUT      ;Define PORTB
> 40        Movwf   TRISB           ;as output
>
> PORT_B_OUT   EQUates to b11111111
>
> If anyone as any tips or know of any similar projects that have code
> available to look at I would be VERY grateful.
>
> TIA
>
>
> --
> Wilf Melling
> Tel. +44 802 633888
>

I would start by changing this constant to decimal and retrying the
assembly - the EQU function of the assembler may be getting confused
here.....

-- Dave Ritchie
former assember maintainer for HP....
RemoveMEderKILLspamspamatl.hp.com

1996\04\09@210020 by Andrew Warren

face
flavicon
face
Wilf Melling <PICLISTSTOPspamspamspam_OUTMITVMA.MIT.EDU> wrote:

> I have made a start on my very first PIC project, it is to be a home
> alarm system (hopefully). So here my very first plea for help, I
> keep getting the following message. I have read the manuals but the
> answer does not jump out at me.
>
> Message[302] C:\MPASM\HALARM.ASM 40 : Argument out of range.  Least
> significant bits used.
>
> Code sample with line numbers:-
> 39        Movlw   PORT_B_OUT      ;Define PORTB
> 40        Movwf   TRISB           ;as output
>
> PORT_B_OUT   EQUates to b11111111

Wilf:

This has nothing to do with your problem, but if you want all the
PORTB pins to be outputs, PORT_B_OUT must equate to 00000000.

Ok...

The MPASM message refers not to PORT_B_OUT but to TRISB.

If you look at the instruction set for your PIC, you'll see that
register-oriented instructions only have room for 7-bit register
addresses, so they can only address 128 registers.  To accomodate
more than 128 registers, PICs employ a banking scheme that uses a few
bits of the STATUS register to select from multiple 128-register
banks.

If you try to directly access a register in any bank other than Bank
0, MPASM won't be able to fit the register's 8-bit address into the
instruction.  Instead, it'll just use the low 7 bits of the
register's address and generate the message you're seeing.

TRISB is located at address 086H, which puts it in Bank 1.  To access
it, you need to select bank 1 (by setting the RP0 bit in the STATUS
register), then write to register 006H.  Before accessing registers on
Bank 0, you'll need to switch back to that page by clearing the
RP0 bit.  Your code should look like this:

   BSF     STATUS,RP0

       MOVLW   PORT_B_OUT
   MOVWF   080H ^ TRISB

   BCF     STATUS,RP0

The "080H ^ TRISB" exclusive-ORs the TRISB address with 080H, thereby
clearing the high bit of the address... It's equivalent to "07FH &
TRISB", "TRISB - 128", and "006H".

-Andy

Andrew Warren - spamBeGonefastfwdSTOPspamspamEraseMEix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\04\09@234212 by Byron A Jeff

face picon face
{Quote hidden}

That's a great explaination Andy. Now can I ask a dumb question?
The 16C84 Datasheet (and I assume the others too) state that the FSR
will utilize all 8 bits of the file address on indirection. So would
the following work?

  movlw     TRISB
  movwf     FSR
  movlw     .0     ; Note that 0 bits are required for output
  movwf     INDF

It's the same number of instructions but I find it slightly more straight-
forward personally.

BTW I just re-read the databook and in fact the IRP bit in the status
register is prepended to the FSR giving a nine bit address. So in fact
4 128 register pages are accessible using indirection. Cool.

BAJ

1996\04\10@001802 by Andrew Warren

face
flavicon
face
Byron A Jeff <EraseMEPICLISTspamEraseMEMITVMA.MIT.EDU> wrote:

> That's a great explaination Andy. Now can I ask a dumb question? The
> 16C84 Datasheet (and I assume the others too) state that the FSR
> will utilize all 8 bits of the file address on indirection. So would
> the following work?
>
>    movlw     TRISB
>    movwf     FSR
>    movlw     .0     ; Note that 0 bits are required for output
>    movwf     INDF
>
> It's the same number of instructions but I find it slightly more
> straight- forward personally.

   Byron:

   Yes, that will work perfectly.  Keep in mind that, although it's
   no longer than the bank-switching code FOR ACCESSING ONE
   REGISTER, it's much less efficient for cases that require
   multiple register accesses.

> BTW I just re-read the databook and in fact the IRP bit in the
> status register is prepended to the FSR giving a nine bit address.
> So in fact 4 128 register pages are accessible using indirection.

   Well, yeah... If any of the 16C6x, 7x, or 8x parts had more than
   2 pages, it'd be pretty useful.

   -Andy

Andrew Warren - @spam@fastfwd@spam@spamspam_OUTix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

1996\04\10@132120 by John Payson

flavicon
face
> >    movlw     TRISB
> >    movwf     FSR
> >    movlw     .0     ; Note that 0 bits are required for output
> >    movwf     INDF
> >
> > It's the same number of instructions but I find it slightly more
> > straight- forward personally.
>
>     Byron:
>
>     Yes, that will work perfectly.  Keep in mind that, although it's
>     no longer than the bank-switching code FOR ACCESSING ONE
>     REGISTER, it's much less efficient for cases that require
>     multiple register accesses.

While in most cases it makes more sense to use direct addressing with RP0
set/unset as appropriate, indirect addressing can be useful when rapidly
accessing registers in both banks.  For example, if you need rapidly and
repeatedly set TRISB and PORTB, it may make sense to point FSR to TRISB, so
that it may be accessed without any intermediate accesses to RP0.  This
technique can pay off especially well when trying to rapidly read the EEPROM
on a 16C84 [point FSR to EECTRL1].


'ITU programmers? with MPASM'
1996\05\04@014346 by David E. Queen
flavicon
face
At 07:45 PM 5/3/96 -0500, you wrote:
{Quote hidden}

I guess I am sold on the ITU unit. Now to use some plastic money...

'EOLs and MPASM'
1996\05\28@112318 by rdmiller

picon face
Don't ya just wish MPASM understood UNIX-style new-lines
as well as the PFE (editor) that comes with MPLAB?

I hate having to translate the stuff back and forth
between checking it into CVS and assembling with MPASM.

Rick Miller

1996\05\28@112941 by Chaipi Wijnbergen

flavicon
picon face
What is CVS ?

                              \\\|///
                            \\  ~ ~  //
                             (  @ @  )
----------------------------oOOo-(_)-oOOo--------------------------------------
!                                                                             !
! Chaipi Wijnbergen                                                           !
! Electronics/Computer Eng. M.Sc.  Tel    : +972-8-9343079                    !
! Optical Imaging Laboratory       Fax    : +972-8-9344129                    !
! Brain Research Center            Email  : .....chaipispam_OUTspamtohu0.weizmann.ac.il       !
! Weizmann Institute of Science    URL    : http://www.weizmann.ac.il/~chaipi !
! Rehovot 76100 ISRAEL             IPhone : chaipi                            !
!                                                                             !
------------------------------------Oooo.--------------------------------------
                         .oooO     (   )
                         (   )      ) /
                          \ (      (_/
                           \_)


On Tue, 28 May 1996, Rick Miller wrote:

> Don't ya just wish MPASM understood UNIX-style new-lines
> as well as the PFE (editor) that comes with MPLAB?
>
> I hate having to translate the stuff back and forth
> between checking it into CVS and assembling with MPASM.
>
> Rick Miller
>

1996\05\28@121424 by rdmiller

picon face
I wrote:
> > Don't ya just wish MPASM understood UNIX-style new-lines
> > as well as the PFE (editor) that comes with MPLAB?
> >
> > I hate having to translate the stuff back and forth
> > between checking it into CVS and assembling with MPASM.
> >
> > Rick Miller

On Tue, 28 May 1996, Chaipi Wijnbergen responded:
> What is CVS ?
> >

It's the freeware "Concurrent Version System" (I think).
That's version control that allows lots of people to work
on lots of files, sometimes the same files, all at once.
It really does reduce the likelyhood of premeditated murder.

It's a GNU thing.  Good stuff.  We (Digalog Systems, Inc.)
keep all of our product source code archived under it.

For the curious, we're running CVS on a Linux box which
also runs a "samba" daemon so we can mount our user
directories from our Windows 95 workstations.

It's clean, it's simple, *and* unlike the Novell server
which we're phasing out... it handles long filenames,
has better security, does Internet standard E-mail, NFS,
X Windows apps (for when some of us run Linux on our
workstations), and schedules its own system maintenance
and backups with cron.

Since the only cost was the hardware (Linux is free),
we were able to put more money into a snappier server
and even splurge on some professional backup software.

Rick Miller


'Going from Intel Hex format file back to MPASM ass'
1996\06\05@082229 by Jim Main
flavicon
face
Owing to a hard disk corruption, I've lost the latest version of my s/ware.

Unfortunately, I didn't back up that version (which worked) and can't
remember the changes I made to the software to get it to work!

What I do have is a blown 16C74, and the intel hex code off it - how do I
get back to a partial assembly listing???

Jim

1996\06\05@084202 by rdmiller

picon face
On Wed, 5 Jun 1996, Jim Main wrote:
> Owing to a hard disk corruption, I've lost the latest version of my s/ware.
>
> Unfortunately, I didn't back up that version (which worked) and can't
> remember the changes I made to the software to get it to work!
>
> What I do have is a blown 16C74, and the intel hex code off it - how do I
> get back to a partial assembly listing???

Under the new MPLAB you can "File-->Import-->Load to Memory" the HEX file
and it will disassemble it for you into the "Program Memory" window which
you can view via "Window-->Program Memory".

Rick Miller


'Using MPASM with Micormint's PicStic and EPIC prog'
1996\10\17@134734 by )
flavicon
face
Has anyone used MPASM with Micromint's PicStic system? I have been
unable to successfully download MPASM compiled code using the
Micromint/micro Engineering EPIC programmer. The code is tested and
known to work when programmed into a 16C84 using PicStart in an
otherwise identical circuit to what's on the PicStic module. When
downloaded with EPIC we get "Config Verify Error" or no error sometimes,
but in either case there is no sign of life. I can also take code
compiled with Micromint/micro Engineering's PM assembler (Parallax
format) and have it work fine on the same PicStic. The reason for using
MPASM over PM is that we already have code in MPASM format as well as a
better familiarity with Micochip assembler format.

Anyone have any ideas?

1996\10\17@155205 by dontronics

flavicon
face
Richterkessing, Frank H (GEA, 055132 ) wrote:
>
> Has anyone used MPASM with Micromint's PicStic system? I have been
> unable to successfully download MPASM compiled code using the
> Micromint/micro Engineering EPIC programmer. The code is tested and
> known to work when programmed into a 16C84 using PicStart in an
> otherwise identical circuit to what's on the PicStic module. When
> downloaded with EPIC we get "Config Verify Error" or no error sometimes,
> but in either case there is no sign of life. I can also take code
> compiled with Micromint/micro Engineering's PM assembler (Parallax
> format) and have it work fine on the same PicStic. The reason for using
> MPASM over PM is that we already have code in MPASM format as well as a
> better familiarity with Micochip assembler format.
>
> Anyone have any ideas?

Why not contact:
Jeff Schmoyer <TakeThisOuT71165.322.....spamTakeThisOuTCompuServe.COM>
at microEngineering Labs.

MEL not only did the drivers for the EPIC programmer, they also did the
PicStic software. I realise that you built your own PicStic equiv. but
I'm sure Jeff would be
concerned if he knew the latest MPASM threw out a config wobbly that his
EPIC software couldn't handle.

Don...

Don McKenzie TakeThisOuTdonmckKILLspamspamspamlabyrinth.net.au
DonTronics Tullamarine, Australia
http://www.labyrinth.net.au/~donmck

EASY PIC'n Beginners Guide to using PIC 16/17 MicroChip products.
Picosaurus(tm) 40 pin FED Basic with 8 channels of A-D, and real Uart.
MEL PicBasic Compiler. Programmers from 15 USD.  Pic-Axe(tm) A New Tool.


'Formatting MPASM output listing'
1996\11\09@234742 by Brooke
flavicon
face
Hi:

I am using MPLAB 3.12.00 & MPASM 01.40 LaserJet 4 w/postscript 600dpi
WFWG 3.11.
In order to see full line lengths I have selected COURIER 9 point fonts.
After 60 printed lines the assembler generates a page break even
though there is about 3 inches of white space on the bottom of the
page.  How do I tell the assembler that It can print more lines?

Also when telling the assembler to print just pages 1 to 3, it only
prints a page heading on a single sheet.  Is this a bug in MPASM 01.40?

Thanks,
Brooke

1996\11\10@013926 by fastfwd

face
flavicon
face
Brooke <.....PICLISTspamRemoveMEMITVMA.MIT.EDU> wrote:

> I am using MPLAB 3.12.00 & MPASM 01.40 LaserJet 4 w/postscript
> 600dpi WFWG 3.11. In order to see full line lengths I have selected
> COURIER 9 point fonts. After 60 printed lines the assembler
> generates a page break even though there is about 3 inches of white
> space on the bottom of the page.  How do I tell the assembler that
> It can print more lines?

Brooke:

Near the top of your source file, add the line:

   LIST N=xxx

where "xxx" is the number of lines you'd like to print per page.

-Andy

Andrew Warren - RemoveMEfastfwdspamspamBeGoneix.netcom.com
Fast Forward Engineering, Vista, California
http://www.geocities.com/SiliconValley/2499

'Differences between MPASM V1.11 & V 1.21'
1996\11\13@104059 by Mike Hogben

flavicon
face
Code previously assembled without error using  Version 1.11 of MPASM, now
gives a number of Error 110: "Unmatched"  and Error 113 : "Symbol not
previously defined" errors, presumably in connection with labels.

I have release notes for V1.21 but can't see anything immediatey
obvious to explain why this should be ( but I'll stand corrected on
this )

Any ideas ?
----------------------------------------------------------
Mike Hogben.
Senior Engineer.
spamBeGonemah@spam@spamspam_OUTitl.co.uk.

'Possible BUG in MPASM V1.4???'
1996\11\20@072415 by Mike Hogben

flavicon
face
LIST P=16C84

I have been having some problems with code previously written with
V1.11 that gives Error [110] : "Unmatched" errors when attempting to
assemble with V1.21 or V1.4 MPASM..

The following test code has no errors on V1.11 but gives error [106]
"String subsitution too complex" followed by Error [109] "Unmatched
(" when assembled with Version 1.21 or 1.4 MPASM.

#define A               D'100'
#define         B               D'17000'
#define         C               (( B * 4 ) / D'1000')
#define         D               (( A * 4 ) - C)
#define         E               low      D

MAIN
  MOVLW        E
END

It is a real shame that the old version 1.11 seems to be better at
hadling the directive language than 1.4.

If I am doing something silly here, please tell me and I'll stand
corrected.
----------------------------------------------------------
Mike Hogben.
Senior Engineer.
TakeThisOuTmahspamspamitl.co.uk.


'Executing MPASM from a DOS Program'
1997\01\01@113606 by myke predko
flavicon
face
This question is probably best answered by the Microchip guys, or Walt
Banks, but here goes.

I'm trying to execute MPASM from another DOS program using the int 21h 0x04B
function ("Load or Execute a Program").  I have trouble sending command line
parameters to MPASM.

I have tried putting in the string from the command line part of the
Parameter Block (which works fine for Edit, MPSIM) as well as forcing it
into the FCB block, but in both cases, it doesn't work - a "random" ASCII
character is put in with .asm (ie "3.asm") according to MPASM.

I do have enough space to load MPASM (usually around 500K in the Windows/95
DOS box).

Does anybody have any ideas?

Thanx and I hope everybody has a wonderful New Year!

myke

"There are only three kinds of economists in the world.  Those who can count
and those who can't." - Eddy George, governor of the Bank of England

1997\01\03@155422 by Eduardo J. Martinez Velez

flavicon
face
part 0 468 bytes

I have tried putting in the string from the command line part of the
Parameter Block (which works fine for Edit, MPSIM)


----------------------------
Thanks for all - Mil gracias
----------------------------
Eduardo Jorge Mart’nez VŽlez
a   Asesoria
&   &
 s   Sistematizacion
INET: ejmvEraseMEspamsatlink.com
 RemoveME73070.3653EraseMEspamspam_OUTcompuserve.com
CServe: 73070,3653
2000-Rosario-SF-Argentina
TelFax: (54)(41)254561
Tel: (54)(41)8804
----------------------------

1997\01\06@103929 by myke predko

flavicon
face
Hi Eduardo,

>        You implied that you *CAN* pass parameters to mpsim.
>        Can you (May be interesting your version) pass anything related
with commans file (*.ini) or *.hex to load?
>        I tried but, due to my non-existent free time, I abandoned that line.

No, you can't pass anything related to the *.ini or load the *.hex file.
MPSIM looks for, loads, and executes MPSIM.INI and that's it on Power Up.
Sorry.

You can send simple Parameters (ie what is the type of PIC to be simulated)
to MPSIM, but that's about it.

sorry.

>I have tried putting in the string from the command line part of the
>Parameter Block (which works fine for Edit, MPSIM)

Now, what was the file that you sent me (attached to this note)?  I tried to
take a look at it and it's some kind of binary file, but I'm not sure what
it's actually for...

myke
{Quote hidden}

"There are only three kinds of economists in the world.  Those who can count
and those who can't." - Eddy George, governor of the Bank of England


'Re[2]: MPASM Pseudo OPs'
1997\02\07@122927 by Darrel Johansen
picon face
John Piccirillo <@spam@jpiccirispam_OUTspam.....NEBULA.TBE.COM> writes:

      >>I looked through the MPASM Manual Appendices but apparently it's not in
      >>the newer versions.

It's in Appendix D., Quick Reference of the MPASM User's Guide, DS33014E, pages
78-79.

Darrel Johansen

1997\02\07@161907 by Craig Knotts

flavicon
face
Attachment converted: wonderlandfive:ATTACH01.TXT 1 (TEXT/CSOm) (0000B5E0)


'Built-in set of macros in MPASM?'
1997\04\15@135733 by gtham
flavicon
face
Where is that set of macros described that's built into
MPASM?
I know it's been up, but I don't find it in any of the
manuals or even in the archives.
Or did I dream it??

I'd also like to thank everybody who gave me advice on
what programmer to build or buy (Re: newbie general...)

Thanks

Gustaf

1997\04\15@204529 by Andrew Warren

face
flavicon
face
Gustaf Tham <spamBeGonegthamEraseMEspamlidkoping.mail.telia.com> wrote:

> Where is that set of macros described that's built into
> MPASM?

Gustaf:

Are you talking about the pseudo-ops like "SKPZ", "CLRC", etc.?
Here's a copy of the message I posted last month:

------- Forwarded Message Follows ------

The following pseudo-ops are understood by MPASM directly; no
include file, etc., is needed in order to use them.

          PIC16CXX SPECIAL INSTRUCTION MNEMONICS

    Name                Mnemonic       Equivalent       Status
                                      Operation(s)
Clear Carry                CLRC        BCF      3,0        -
Clear Digit Carry          CLRDC       BCF      3,1        -
Set Digit Carry            SETDC       BSF      3,1        -
Clear Zero                 CLRZ        BCF      3,2        -
Set Zero                   SETZ        BSF      3,2        -
Skip on Carry              SKPC        BTFSS    3,0        -
Skip on No Carry           SKPNC       BTFSC    3,0        -
Skip on Digit Carry        SKPDC       BTFSS    3,1        -
Skip on No Digit Carry     SKPNDC      BTFSC    3,1        -
Skip on Zero               SKPZ        BTFSS    3,2        -
Skip on Non Zero           SKPNZ       BTFSC    3,2        -
Test File                  TSTF f      MOVF     f,1        Z
Move File to W             MOVFW f     MOVF     f,0        Z
Negate File                NEGF f,d    COMF     f,1
                                      INCF     f,d        Z
Add Carry to File          ADDCF f,d   BTFSC    3,0
                                      INCF     f,d        Z
Subtract Carry from File   SUBCF f,d   BTFSC    3,0
                                      DECF     f,d        Z
Add Digit Carry to File    ADDDCF f,d  BTFSC    3,1
                                      INCF     f,d        Z
Subtract Digit             SUBDCF f,d  BTFSC    3,1
Carry from File                        DECF     f,d        Z
Branch                     B k         GOTO     k          -
Branch on Carry            BC k        BTFSC    3,0
                                      GOTO     k          -
Branch on No Carry         BNC k       BTFSS    3,0
                                      GOTO     k          -
Branch on Digit Carry      BDC k       BTFSC    3,1
                                      GOTO     k          -
Branch on No Digit Carry   BNDC k      BTFSS    3,1
                                      GOTO     k          -
Branch on Zero             BZ k        BTFSC    3,2
                                      GOTO     k          -
Branch on Non Zero         BNZ k       BTFSS    3,2
                                      GOTO     k          -
Call across page boundary  LCALL k     BCF 3,5 or BSF 3,5
                                      BCF 3,6 or BSF 3,6
                                      CALL     k

By the way, don't bother using the "LCALL" pseudo-op... Since it
doesn't restore the code-page bits after the CALL, it's sorta
useless.  Also, be careful with the pseudo-ops that assemble to two
instructions; constructs like the following, for instance, will cause
you great pain and suffering:

   ; DON'T DO THIS!

   BTFSS   FLAGS,SWITCH    ;If the switch is pressed, skip ahead.
   NEGF    REG             ;Otherwise, negate the REG register.

------- End of Forwarded Message ------

-Andy

=== Andrew Warren - fastfwdspamBeGonespamix.netcom.com
=== Fast Forward Engineering - Vista, California
===
=== Custodian of the PICLIST Fund -- For more info, see:
=== www.geocities.com/SiliconValley/2499/fund.html

1997\04\16@033809 by gtham

flavicon
face
> Are you talking about the pseudo-ops like "SKPZ", "CLRC", etc.?
> Here's a copy of the message I posted last month:
>
(snip, snip)

Yeah, that must be it...

Thank you very much!


Gustaf

1997\04\16@192008 by Tony Matthews

flavicon
face
>     ; DON'T DO THIS!
>
>     BTFSS   FLAGS,SWITCH    ;If the switch is pressed, skip ahead.
>     NEGF    REG             ;Otherwise, negate the REG register.
> -Andy
Darn good advice that. Timely to.Thanks


'PASMX to MPASM translator?'
1997\05\14@063545 by wterreb
flavicon
face
Hi

 Do anyone know if there is a translator program available anywhere
that translates source files written for the Parallax PASMX compiler
into source files that can be compiled by Microchip MPASM?  I seem to
have read something about this on the Piclist a long time ago, but
forgot now what the details were.

Alternatively, is it possible to convert the OBJ files generated by
PASMX into HEX files needed by most programmers?

Rgds
Werner

'Two tips on MPASM; floating point library bugs; Tr'
1997\05\30@145824 by Josef Hanzal

flavicon
face
Hi everybody on the list,

I have joined the list recently and this is my first list I have ever
subscribed. I must say this is a terrific way to get help on a very specific
issues. I am not quite new to PIC and microelectronics, but certainly far
from not needing any help ever. I use almost everything from 12C508 to
16C74, haven't got project that demanding to use the 17Cxx family. My main
target is chemical laboratory equipment but generally everything, what has
little moving parts and lot of PICs. Let me share some tips on MPASM
programming.


1. Useful #defines

For each bit in every special register i declare a #define directive like this:

#define _Z      STATUS,Z
#define _SPEN   RCSTA,SPEN

I put them in a file and I name this file Q16Cxx.INC (after the P16Cxx from
Microchip) and keep it in the same directory. It takes a while to edit the
P*.INC into Q*.INC, but you do it just once for a new processor. Then I
include the Q*.INC file right after the P*.INC in the main program.

What is this all for ? I need not to remember or look up each time where the
bits reside. It also prevents errors like:

       BSF     TXSTA,SPEN      ; should be BSF     RCSTA,SPEN
               -----                               -----

What is bad about the above error - the statement is perfectly legal, you
receive no varning from the assembler and easily overlook it. You would just
wonder why the serial port is not working.


2. How to avoid "Register in operand not in bank 0." message

Questions like "What does it mean when assembler says: Message[302]
CC58_10.PIC 280 : Register in operand not in bank 0.  Ensure that bank bits
are correct" have already been posted to the list. It issued every time you
address any special register or variable from the page 1. If your code is
some 50 lines, you can thru it and "ensure that the bank bits are correct"
as the assembler suggests. If you go to larger source files, it is more and
more time consuming. You can remember the count and if it is still the same
as it was last assembly then assume it is OK this time as well. But it is
not that comfortable.
I work around these messages following way. My philosophy about pages
switching is to locate all byte or word variables in the page 0, and use
page 1 for buffers, seldom used or indirectly addressed variables or arrays.
Most of the time the page 0 is selected so you don't need page bits
handling. Any part of the code or a subroutine that switches to page 1 is
also responsible for swithing back to page 0. And now the little trick comes
- instead of plain BSF/BCF STATUS,RP0, I have these macros:

SELRP0  MACRO
       BCF     _RP0        ; _RP0 = STATUS,RP0
       ERRORLEVEL +0302    ; switch the page warning on
       ENDM

SELRP1  MACRO
       BSF     _RP0        ; _RP0 = STATUS,RP0
       ERRORLEVEL -302     ; switch the page warning off
       ENDM

So for the code, that uses variables from page 1 the warning is deactivated
and the rest of the code has the warning enabled. For a correct program
(regarding page swithing) you get no warnings. It is not totally foolproof
however - if you use variable from page 0 in the segment where the RP0 is
set, the warning does not appear. Or if you jump in the middle of the
segment with incorrect bits set. So if you receive no warning, it still does
not mean the page swithing is correct, but since the places, where an error
can occur, are generaly small in size, it is easier to check them.


3. Floating point library

I have ordered the May digest and noticed, that someone warns about
Microchip floating point divide routine. I use the FP32_14.a16 library and I
would like to point out, that not only the divide, but also the multiply
routine as well as subtract and addition routines have bugs too. The
multiply does not round correctly in some instances and the addition and
subtraction fail if the numbers have different signs and one is smaller by
the order of 2^24 or more than the other one. I have reported these bugs
together with corrected code to Microchip and guess what happened ! They
send me the $2300 PIC-Master, full tubes of JW parts and a very nice letter
encouraging me to continue in the valuable customer feedback.

(Just kidding, nothing happend so far. ;-) If there is an interest, I can
post the corrected code fragments.


4. Re - testing true/false returned from subroutine.

This solution I have found in the Fast Forward Engineering answer page, if I
overlocked the posting in the huge digest, then just disregard it.

       CALL    TEST    ; subroutine returns W=0 for FALSE, W=1 for TRUE
       ADDWF   PCL,F
       GOTO    FALSE   ; jump to process false branch
TRUE:   ...             ; process true branch here

Of course you have to watch out for program page boundaries.

Josef Hanzal

1997\05\30@205049 by Pioneer Microsystems

flavicon
face
At 09:02 PM 5/30/97 +0200, you wrote:
>Hi everybody on the list,
>
>blah, blah, blah,
>yeah, yeah, yeah,
>
>3. Floating point library
>
>They send me the $2300 PIC-Master, full tubes of JW parts and a very nice
letter
>encouraging me to continue in the valuable customer feedback.
>
>Josef Hanzal
>
Man, did you have me going!  I hadn't been that speechless since the OJ
verdict.

As a matter of fact, I would be interested in your corrected fragments.  As
well as any info you have on calling the routines. I actually failed at my
first run at the library since I couldn't for the life of me figure out the
calling and returned information.  Worst of all, I couldn't interpret the
IEEE format to check the result for accuracy.  I have collected some
comments from our Piclist for the fateful day when I will not be able to
avoid FP.  Boy, can you squeeze alot out of long integers when you are
afraid of the FP routines.

Thanks up front.

Christopher Eddy, PE
Pioneer Microsystems, Inc.
Pittsburgh, PA (Nor is it smelly)


'New! MPLINK, MPLIB, MPASM tools from Microchip'
1997\08\08@164031 by Darrel Johansen
picon face
PICLISTers,

    Today Microchip is posting advance releases of the new MPASM
    relocatable assembler to the web site and to the Microchip BBS
    (v1.99.33).  This version works in two modes: the old way, which
    generates .HEX files directly, and the new way (signified by using
a
    "/o" on the command line) to generate relocatable object modules
for
    the linker.

    The advanced release of MPLINK is available separately (v0.00.02),
and
    documentation for it and the new MPASM are included as .PDF files,
    for viewing with Adobe Acrobat Reader.

    MPLIB (v0.00.20) is newly released as part of the MPLINK package
and it
    allows you to make reusable libraries.

    These are posted as beta versions on the "Tools" section of the
    Microchip web site.  Files are located at:
        http://www.microchip2.com/mplab.htm

    The programmers at Microchip hope that you will add this
reloacatable
    macro assembler, linker, and librarian to your suite of freely
    distributed Microchip Development System tools.  Any feedback can
be
    sent directly to me or to the webmaster.

    Darrel Johansen
    RemoveMEdarrel.johansen@spam@spamspamBeGonemicrochip.com

1997\08\08@223458 by Eric Smith

flavicon
face
Darrel,

I downloaded the new MPLINK.  When I ran it, it went through the nice Windows
setup stuff, but then it asked me to insert disk 2.  The web site only
seems to have Disk 1 of 1.  Am I doing something wrong?

Thanks,
Eric

1997\08\09@140904 by Darrel Johansen

picon face
Eric Smith wrote:
>
> Darrel,
>
> I downloaded the new MPLINK.  When I ran it, it went through the nice Windows
> setup stuff, but then it asked me to insert disk 2.  The web site only
> seems to have Disk 1 of 1.  Am I doing something wrong?
>
> Thanks,
> Eric

Sorry.  Looks like we didn't get both files zipped up into that one.  I
may be able to send it to you directly if you'd like.  Otherwise, we'll
get the right one up on the web page on Monday.

Darrel

1997\08\09@172939 by Dave Brobst

flavicon
face
At 02:09 AM 8/9/97 -0000, you wrote:
>Darrel,
>
>I downloaded the new MPLINK.  When I ran it, it went through the nice Windows
>setup stuff, but then it asked me to insert disk 2.  The web site only
>seems to have Disk 1 of 1.  Am I doing something wrong?
>
>Thanks,
>Eric
>

The same thing happend here. . . I downloaded the software twice.  Perhaps
there is something in the instructions I am missing . . .
David Brobst
Solutions Cubed
3029 Esplanade, Suite F
Chico, CA 95973
Phone:  (916)891-8045
Fax:    (916)891-1643

1997\08\12@115230 by Dave Mumert

flavicon
face
It appears the files currently on the web site are missing
a file called DISK02.
Just add any file and call it DISK02, it can even be a
blank file.  The install program needs this to identify and
confirm that disk 2 is in the drive.

I have installed both the linker and assembler but have not
had a chance to play with them yet.

Good Luck
Dave  Mumert
.....SDM@spam@spamEraseMEsoftoptions.com



----------
> From: Darrel Johansen <.....darreljRemoveMEspamPRIMENET.COM>
> To:
> Subject: Re: New!    MPLINK, MPLIB, MPASM  tools from
Microchip
> Date: Saturday, August 09, 1997 11:11 AM
>
> Eric Smith wrote:
> >
> > Darrel,
> >
> > I downloaded the new MPLINK.  When I ran it, it went
through the nice Windows
> > setup stuff, but then it asked me to insert disk 2.
The web site only
> > seems to have Disk 1 of 1.  Am I doing something wrong?
> >
> > Thanks,
> > Eric
>
> Sorry.  Looks like we didn't get both files zipped up
into that one.  I
> may be able to send it to you directly if you'd like.
Otherwise, we'll
> get the right one up on the web page on Monday.
>
> Darrel
>

'"New! MPLINK, MPLIB, MPASM tools from Microchip"'
1997\08\12@185707 by .jaring.my, and/or

flavicon
I downloaded both files - Assembler & Link.
The installation for the assem. works because it's just simply unzipped.
But Mpasmwin doesn't. It keeps on saying invalid time and date when run.

The link- I tried exactly what Dave  Mumert have suggested.
Unfortunately, it didn't work as well!

TRY again.

Sam

'"New! MPLINK, MPLIB, MPASM tools from Microchip" -'
1997\08\13@021621 by Erik Klausen

flavicon
face
> I downloaded both files - Assembler & Link.
> The installation for the assem. works because it's just simply unzipped.
> But Mpasmwin doesn't. It keeps on saying invalid time and date when
> run.

This is because you don't use USA-format on the time and date. I had the
same error on a danish-configured Windows. Try changing the xcountry
code in Control Panel, International, to U.S.A.

This is, of cause, not a final solution, but it will get you started on testing
the new assembler. The error is registered at Microchip.

Erik Klausen

'two mpasm questions'
1997\08\18@104805 by Ooijen,Wouter van

picon face
two MPASM questions:

1. can I prevent "LIST" from appearing in my listing? I switch
nolist/list VERY often, so the LIST lines become a nuisance.

2. can I  "remove" a variable? I need a lot of temporaries, which value
is of no interest in the end. Those variables make the symbol table very
large.

regards,
Wouter.

1997\08\18@123045 by Andrew Warren

face
flavicon
face
Ooijen,Wouter van <.....PICLISTSTOPspamspam@spam@MITVMA.MIT.EDU> wrote:

> 1. can I prevent "LIST" from appearing in my listing? I switch
> nolist/list VERY often, so the LIST lines become a nuisance.

   Wouter:

   No, you can't keep the LIST line from printing, although this
   feature has already been requested and is in Microchip's
   "requested MPASM features" database.

> 2. can I  "remove" a variable? I need a lot of temporaries, which
> value is of no interest in the end. Those variables make the symbol
> table very large.

   The easiest way to keep the table from filling up with lots of
   temporary variables is, obviously, to use as few temporary
   variables as possible.

   MPASM makes this easy with the "SET" directive; SET works just
   like EQU, except that it allows its asociated symbol to be
   re-assigned a new value later in your source code.

   For example, this code won't work:

       TEMP    EQU     1       ;TEMP = 1 from this point forward.
       ....
       TEMP    EQU     2       ;This line causes an error; variables
                               ;defined with EQU can't be redefined.

   but this code will:

       TEMP    SET     1       ;TEMP = 1 from this point forward.
       ....
       TEMP    SET     2       ;This line works; TEMP = 2 from this
                               ;point forward.
       ....
       TEMP    SET     3       ;Now TEMP = 3.

       etc....

  -Andy

=== Andrew Warren - fastfwdEraseMEspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

=== For PICLIST help (including "unsubscribe" instructions),
=== put the single word "help" in the body of a message and
=== send it to: RemoveMElistservspamspamBeGonemitvma.mit.edu

'Masking the High Bit (was: "Re: MPASM bug ?")'
1997\08\21@041205 by Andrew Warren

face
flavicon
face
Darrel Johansen <spamBeGonePICLISTKILLspamspam@spam@MITVMA.MIT.EDU> wrote:

> [a whole bunch of useful information on MPASM 1.99.xx's new
> bank-selecting directives, then...]
>
> You may want to use
>       ERRORLEVEL -302
> to suppress those MPASM messages that are distracting, or as Andy
> also suggested, AND the operand to strip off the extra bits.

Darrel:

Actually, I recommended XORing the operand with 0x80; I did NOT
recommend ANDing it with 0x7F.

It's a small distinction, but I think it's important... While both
methods will correctly clear the high bit from an operand that's in
the range [0x80-0xFF], only the XOR method will cause the assembler
to generate a warning if you accidentally try to mask the high bit
of a register in the [0x00-0x7F] range.

This behavior can be very helpful... For instance, say that you
do this:

   TEMP    EQU     0x90            ;TEMP is on register-page 1.

   ....

   BSF     STATUS,RP0              ;Switch to register-page 1.

   MOVF    0x7F&TEMP,W             ;Read TEMP, masking off the
                                   ;high-bit with an "AND".

   BCF     STATUS,RP0              ;Switch back to register-page 0.

Then you decide (for whatever reason) to move TEMP from register 0x90
to register 0x30, but forget to go through your code and remove the
now-incorrect "BSF STATUS,RP0"/"BCF STATUS,RP0" lines from around
your TEMP accesses.

What happens?  Well, the code no longer works... But MPASM still
assembles it with no errors!

Now... Let's say you used "0x80^" instead of "0x7F&".  If you wrote
your code assuming that TEMP was on one page, then moved TEMP to
another page and tried to re-assemble, MPASM would have generated a
Warning #302 every time it saw code that assumed that TEMP was still
on the original page.

The XOR method also checks for other errors... Like mistakenly
guessing that TXSTA is on page 0 and RCSTA is on page 1, etc.

-Andy

=== Andrew Warren - fastfwdspam_OUTspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

=== For PICLIST help (including "unsubscribe" instructions),
=== put the single word "help" in the body of a message and
=== send it to: spamBeGonelistserv@spam@spammitvma.mit.edu


'funny MPASM behaviour'
1997\09\09@141355 by oortje Hanneman & Wouter van Ooijen
picon face
I have this small and completely useless file,
which shows a strange MPASM behaviour I stumbled
upon while writing a generic RS232 receive macro.

       list p=16c84
wrong   macro
               error something wrong
       endm
test    macro
       local x,y
       if y - x != 1
               error strange #v(y) #v(x)
               wrong ; try to remove
       endif
x       nop
y
       endm
       test ; try to remove
       test
       end

When I assemble its I get

Error[101]   C:\USERS\DEFAULT\16C84\TRY.ASM 9 : ERROR: (strange 0 0)
Error[101]   C:\USERS\DEFAULT\16C84\TRY.ASM 4 : ERROR: (something wrong)

This is caused by the fact that in pass one all forward labels
have the value 0. Indeed the errors disappear when I change
the test to y - x != 1 && y - x != 0.

But when I remove either one "test" macro call,
or the "wrong" macro call both errors disappear!

Can someone explain this?


'Why does MPASM not see PORTA definition?'
1997\10\03@155458 by Tony Vilches
flavicon
face
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

PORTA is defined in the .inc file (load when the LIST command is
executed) - so why does MPASM not recognise PORTA as a defined
register?

Cheers,
Antonio

Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

  ---- File information -----------
    File:  byte2led.asm
    Date:  3 Oct 1997, 20:44
    Size:  1094 bytes.
    Type:  Program-source

Content-type: Application/Octet-stream; name="byte2led.asm"; type=Program-source
Content-disposition: attachment; filename="byte2led.asm"

Attachment converted: wonderland:byte2led.asm (????/----) (0000814F)

1997\10\03@163224 by Lynn Richardson

flavicon
face
Add the following to cause the assembler to pass through the include file
and pick up the PORTA definition.


;On output, _High contains high byte and _Low contains low byte
;The required byte is in _Sample on entry. (Set to ff for testing)
;
;
       LIST   P=PIC16C84
       INCLUDE "P16C84.INC"
;
_Sample equ 0xff
Base equ 0x20           ;set memory base
;
-------------------------------------------


At 08:52 PM 10/3/97 +0000, Tony Vilches wrote:
{Quote hidden}

---------------------------------------------------------------------------
Lynn Richardson - Design Eng.|WA0ZNL            |Progress Instruments, Inc.
DC - 1GHz, RX, TX 100W, PLL  |WA0ZNL.AMPR.ORG   |807 NW Commerce Drive
ASM 6805, 8051, Z8, PIC      |44.46.176.3       |Lee's Summit, MO 64086
C                            |RemoveMElrichEraseMEspamKILLspamproginst.com|P(816)524-4442 F 246-4556

'MPLAB + MPASM=ENDLESS PROBLEMS'
1997\10\04@034531 by Tony Vilches

flavicon
face
I recently posted some source code that, now that I have included an
include file, compiles correctly under "compile single file" - there
are warnings but no errors.

Why is it that when I try to "build all", I get 29 errors?
There is only 1 file in the project - and that seems to compile
correctly on its own.

I must admit that MPLAB is _the_ most user unfriendly software I have
ever encountered.

Are there any switches / options / prayers I could use to set the
bloody thing up so that I can actually compile a small amount of code
_without_ spending a week on it and tearing out my hair in the
process?

TO MICROCHIP: I would very much like to be able to use your 16c84
microcontroller in my designs. I am a 'home' user, an enthusiast (and
a professional electronics engineer), I have no need for an
integrated environment capable of handling lots of different files -
I need an easy to use editor/compiler that will enable me to produce
PIC code from 1main source file, easily and quickly, ideally with a
graphic menu driven  interface and simulation window. Do you think
your gifted programmers could produce something like this and
document it so that an absolute beginner can use it?

I bet you can not.

You produced a microcontroller with a very small instruction set so
that programmers would quickly become familiar with the device. Why
should I have to spend more time learining the ins and outs of the
tools needed to assemble the code  than on the
code itself?

Antonio

1997\10\04@190306 by Andy Kunz

flavicon
face
>You produced a microcontroller with a very small instruction set so
>that programmers would quickly become familiar with the device. Why

They didn't produce it originally.  Before MCHP came along, GI (the cable
converter people) made them.

There's a basic paradigm in the world that, if you want something cheap, it
must be simple to make.  It doesn't get much simpler than a '5x chip, for
sure!

If I'm designing something for the mass market (100K per year or so),
engineering costs really don't matter very much, but parts costs is very
important.  If I'm making something that will be produced in very small
quantities, parts costs doesn't matter as much, but engineering costs do.

Most low- or mid-range PICs are ideal for very high volume production.  The
programmer must do the USART, PWM, etc. in software.  This takes time
(dollars) up front, but in the long run is very cost effective.  OTOH, the
'6x/7x parts have lots of peripherals which make the programmer's job
easier, but cost $$$ in production.

Get the idea?  It takes a tougher software development system to make cheap
micros easy to deal with.

As a non-user of MPLAB for the most part, I really can't say much about my
experiences with it.  I've never had any trouble trying to accomplish what
I want it to do (sometimes the thing doesn't do it the way I would expect,
so I have to try different methods).  Maybe I think differently.  I would
LOVE to change icons so they have a word on them rather than a picture -
figuring out pictures is sure a pain sometime (that's why we have balloon
help, I guess).

Andy

==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
         Hardware & Software for Industry & R/C Hobbies
       "Go fast, turn right, and keep the wet side down!"
==================================================================

1997\10\04@194124 by jorgegf

flavicon
face
Hi

...
Tony Vilches wrote:
>
> I recently posted some source code that, now that I have included an
> include file, compiles correctly under "compile single file" - there
> are warnings but no errors.
...


I'm here only out of curiosity, and with a couple of ideas that I might
try to put to work sometime in the near future. So I didn't had your
kind of problems yet. But by what I've seen the MPLAB tool is not that
complex, but might need some study.
But, it ocurred to me that you may try to do it tha way I did it myself
in my first year at the university. I leartned to program the Intel
8085, by coding it all in HEX by hand (of course I'm not refering to
programs bigger then 256 ~ 512 bytes. Its a simple process, you write
your program using the mnemonics (one at a line) and them assemble it by
writing the hex code for each instruction and counting the addreses used
by that code. After a couple of programs you start to creat the HEX
image out of your memory only. The only tool you need is a table with
the HEX codes for each instruction.

       Some of you, younger ones, probably didn't even know that there was a
time when things were done this way, but I really did it (and the others
students also) around the year 1882/83, and a lot of people did it as a
way of life, hardcoding soma KB of program and data that way.

       Think about it, and you probaly recon that it pays to dedicate one or
two weeks to study the modern programing/debugging tools at and :-).


       Best Regards

       Jorge F

1997\10\05@012410 by Mike Smith

flavicon
face
-----Original Message-----
From: Tony Vilches <spamBeGonetony-vilchesspam_OUTspamRemoveMEIDISCOVER.NET>
To: .....PICLISTspamRemoveMEMITVMA.MIT.EDU <PICLISTspam@spam@MITVMA.MIT.EDU>
Date: Saturday, 4 October 1997 17:16
Subject: MPLAB + MPASM=ENDLESS PROBLEMS


>I recently posted some source code that, now that I have included an
>include file, compiles correctly under "compile single file" - there
>are warnings but no errors.

>Why is it that when I try to "build all", I get 29 errors?
>There is only 1 file in the project - and that seems to compile
>correctly on its own.


Specifics?  Can't help much without them.

>I must admit that MPLAB is _the_ most user unfriendly software I have
>ever encountered.

I must admit I've just d/led it recently, thinking about using it with C &
IcePic.  Let u know my experiences.

>Are there any switches / options / prayers I could use to set the
>bloody thing up so that I can actually compile a small amount of code
>_without_ spending a week on it and tearing out my hair in the
>process?

Are you producing straight hex code, or going to obj, then link?  There's a
switch for that.
Are you using the dos or the windows assembler?

MikeS
<EraseMEmikesmith_ozRemoveMEspamSTOPspamrelaymail.net>

1997\10\05@053729 by Tjabo Kloppenburg

flavicon
face
hi Tony,

> Are there any switches / options / prayers I could use to set the
> bloody thing up so that I can actually compile a small amount of code
> _without_ spending a week on it and tearing out my hair in the
> process?

:-) have you read the "MPLAB tutorial" (20 pages)? It's not that
difficult...
Why don't you just forget MPLAB and try an old version of MPASM (V01.01).
It's quite simple in use.

--
tk.
(Did you specify the pic type in your source code?)


'A little quirk in MPASM for 12C5xx'
1997\11\08@230337 by myke predko
flavicon
face
Hi Folks,

I just wanted to update you on something I've found as I've been debugging a
12C508 application I'm working on with MPASM.

The instruction "return" does NOT return an error/warning/message but puts
in the code for "retlw 0".  This won't be a problem unless you are trying to
return a value in "w" (as I was).

So, this is something to watch out for when doing 12C5xx (and 16C5x?)
applications if data doesn't seem to be returned properly from a subroutine.

myke

Check out "Programming and Customizing the PIC Microcontroller" at:

http://www.myke.com


'MEL PBasic Compiler & MPASM __CONFIG directive'
1998\01\19@125017 by Will Chapman
flavicon
face
I am looking into buying the MEL PBasic compiler.  From what I can tell,
it takes a pbasic text file and compiles it into a .HEX file.

My problem with this is: I use the ITU PIC-1+ programmer which supports
the __CONFIG directive in MPASM.  If I use the MEL PBasic Compiler, how
do I use and equivalent __CONFIG directive?

Would I:
1) Compile my PBasic code into a .HEX using the Pbasic Compiler.
2) Dissamble the .HEX file into .ASM with 3rd party software.
3) Edit the .ASM and add the __CONFIG directive line.
4) Use MPASM to re-compile it back into a HEX.

?????? Stumped in Seattle,

---Will Chapman
  Power-Brick Designs


'Problem with MPASM on 12C508'
1998\02\14@174310 by David Sprenkle
flavicon
face
I can't figure out if I don't know how to use MPASM correctly or there
is a bug in the MPASM program.  Here is what it is.

For the 12C508 processor.

Use any .asm code you want.

The GP3 pin indicates 1.  Change it to 0 with the windows>modify
window.  (I tried changing it with a stimulus file and got the same
problem.)

Try to step through the program.  It will stay at PC = FF and just xor
the working register.  Which indicates to me it is not turning over like
it should to zero.

David

'MPLAB not MPASM'
1998\02\14@184958 by David Sprenkle

flavicon
face
I reread my message about MPASM.  It is MPLAB that I am referring to and
it is the simulator that is giving me problems.  Also the PC stays at
01FF not FF.

I am using the 12C508 for the processor.

I am trying to debug a program by stepping through it using the
simulator.  Like I said changing the input on pin GP3 to 0 using the
Modify dialog box or simulator stimulus file make the simulator stay at
the 01FF address.

I am having the problem no matter what .asm file I use.
--
David

1998\02\14@194058 by Andrew Warren

face
flavicon
face
David Sprenkle <RemoveMEPICLISTKILLspamspamTakeThisOuTMITVMA.MIT.EDU> wrote:

> I am using the 12C508 for the processor.
>
> I am trying to debug a program by stepping through it using the
> simulator.  Like I said changing the input on pin GP3 to 0 using the
> Modify dialog box or simulator stimulus file make the simulator stay
> at the 01FF address.

David:

The 12C508's pin 4 serves a dual-purpose; it can be configured as
either GP3 (as you desire) or MCLR.

It sounds as though you've configured it as MCLR; check the chip
configuration and make sure that MCLR is disabled.

-Andy

=== Andrew Warren - spamBeGonefastfwdspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\02\14@215736 by David Sprenkle

flavicon
face
Thank you for the help, that was the problem.  MPLAB does not prompt you
for the chip setup like if does when you program them.  Thanks again, took
a nap and woke up to solution to my frustrations.

Andrew Warren wrote:

{Quote hidden}

--

'Problem with MPASM on 12C508'
1998\02\14@224813 by Michael S. Hagberg

flavicon
face
do you have this port configured as an input port? I believe that GP3 is
ONLY input.

michael


-----Original Message-----
From: David Sprenkle <spam_OUTsprenklespam_OUTspamspam_OUTBUSPROD.COM>
To: PICLISTspam_OUTspamMITVMA.MIT.EDU <RemoveMEPICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Date: Saturday, February 14, 1998 4:44 PM
Subject: Problem with MPASM on 12C508


{Quote hidden}

'MPLAB not MPASM'
1998\02\15@122721 by Tom Handley

picon face
  David, you need to disable MCLR in the configuration word. GP3 is
shared with MCLR and it sounds like the simulator is assuming MCLR is
enabled and is holding the PC at 1FFh where it would normally do a
MOVLW xx where xx is the OSCCAL value.

  - Tom

At 05:43 PM 2/14/98 -0800, you wrote:
{Quote hidden}

1998\02\16@095022 by Steve Lawther

flavicon
face
    David,
   
    I had the same problem with mplab 3.30 about a month ago.
   
    Even when I was sure that the internal MCLR was enabled, simulating
    with a 0 on GP3 would put it in reset. ( I assumed it was reset as PC
    = 1FF as you say)
   
    Since it was a panic day, I just assumed mplab had a bug, removed that
    part of simulation, and blew a chip to test it instead. (which worked
    as expected).
   
    Sorry I haven't got a solution, but at least you know it's not just
    you...
   
               Steve Lawther


______________________________ Reply Separator _________________________________
Subject:      MPLAB not MPASM
Author:  MIME:sprenklespamBeGonespam.....BUSPROD.COM at INTERNET-HUSKY
Date:    16/02/98 12:47


I reread my message about MPASM.  It is MPLAB that I am referring to and
it is the simulator that is giving me problems.  Also the PC stays at
01FF not FF.
   
I am using the 12C508 for the processor.
   
I am trying to debug a program by stepping through it using the
simulator.  Like I said changing the input on pin GP3 to 0 using the
Modify dialog box or simulator stimulus file make the simulator stay at
the 01FF address.
   
I am having the problem no matter what .asm file I use.
--
David
   


'help on MPASMWIN problem'
1998\03\11@134416 by Roberto Marchini
flavicon
face
Hello piclister,

I've a problem with MPASMWIN from ICEPIC emulator running on WIN95 (sigh!).
MPASMWIN don't starts and displays the message:
--------------------------------------------------------------
             Application error
Exception EconvertError in module MPASMWIN at 0014:0472
'01/01/70 00:00:00' is not a valid date and time
--------------------------------------------------------------
The same message is displayed if I run only MPASMWIN.

What's the problem?

I've loaded it from RF Solution many months ago.
MPASMWIN is 814 kb, and the date/time is 31/07/97 14:19

Can you help me?

Thanks in advance and CIAO

Roberto Marchini  TURIN (Italy)

for (i=1; i<=100; ++i) {
 printf("sorry for my bad english");
}

1998\03\12@083612 by Morgan Olsson

picon face
I had similar problems with the first one I downloded at about the same date.

The problem was that MPASM required american date/time format !!
Had some struggle until I found what was wrong....

Solution 1: Set your country in Windows to USA (Quick, but not very funny...)

Solution 2: Download the new version.  (Best)
/Morgan

At 13:44 1998-03-11 -0500, you wrote:
{Quote hidden}

/  Morgan Olsson, MORGANS REGLERTEKNIK, SE-277 35 KIVIK, Sweden \
\  KILLspammrtspam.....iname.com, ph: +46 (0)414 70741; fax +46 (0)414 70331    /


'Bar Graph (was: "Re: MPASM MACRO")'
1998\04\11@222408 by Andrew Warren
face
flavicon
face
Leonardo wrote:

> Referring to the RPM pulse meter, I would like build a LED BAR METER like
> ....
> Count= 20 (RPM=10000) bits set: RB1,RB2,RB3,RB4,RB5,RB6,RB7,RA0,RA1,RA2
> Count= 28 (RPM= 9000) bits set: RB1,RB2,RB3,RB4,RB5,RB6,RB7,RA0,RA1
> Count= 36 (RPM= 8000) bits set: RB1,RB2,RB3,RB4,RB5,RB6,RB7,RA0
> Count= 44 (RPM= 7000) bits set: RB1,RB2,RB3,RB4,RB5,RB6,RB7
> Count= 54 (RPM= 6000) bits set: RB1,RB2,RB3,RB4,RB5,RB6
> Count= 66 (RPM= 5000) bits set: RB1,RB2,RB3,RB4,RB5
> Count= 72 (RPM= 4000) bits set: RB1,RB2,RB3,RB4
> Count=105 (RPM= 3000) bits set: RB1,RB2,RB3
> Count=144 (RPM= 2000) bits set: RB1,RB2
> Count=240 (RPM= 1000) bits set: RB1

Leonardo:

You may want to check your calculations; if 1000 RPM produces a
count of 240, 2000 RPM should produce 120, not 144.  What's the
resolution of your counter (i.e., how many microseconds are required
for one count)?

Anyway... This routine requires 44 instructions.  You could shrink
it to 30 or so by using a subroutine; I probably wouldn't bother.

Note that if you call this routine too often (like more than 2000
times per second), you may get some flicker on the LEDs.  It's best,
therefore, to call this routine no more frequently than once every
10 milliseconds.

       MOVLW   00000111B
       IORWF   PORTA
       MOVLW   11111110B
       IORWF   PORTB

       MOVLW   240-1
       SUBWF   COUNT,W
       SKPNC
       BCF     PORTB,1

       MOVLW   144-1
       SUBWF   COUNT,W
       SKPNC
       BCF     PORTB,2

       MOVLW   105-1
       SUBWF   COUNT
       SKPNC
       BCF     PORTB,3

       MOVLW   72-1
       SUBWF   COUNT,W
       SKPNC
       BCF     PORTB,4

       MOVLW   66-1
       SUBWF   COUNT,W
       SKPNC
       BCF     PORTB,5

       MOVLW   54-1
       SUBWF   COUNT
       SKPNC
       BCF     PORTB,6

       MOVLW   44-1
       SUBWF   COUNT
       SKPNC
       BCF     PORTB,7

       MOVLW   36-1
       SUBWF   COUNT,W
       SKPNC
       BCF     PORTA,0

       MOVLW   28-1
       SUBWF   COUNT,W
       SKPNC
       BCF     PORTA,1

       MOVLW   20-1
       SUBWF   COUNT
       SKPNC
       BCF     PORTA,2

-Andy

=== Andrew Warren - spam_OUTfastfwdspamKILLspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

'help needed with mpasmwin errors'
1998\04\16@202746 by Ken Johnson

flavicon
face
Hi, can anyone on the list give a newcomer to PIC programming (though not
to assembley programming) some help, tell me what I am doing wrong on the
following piece of code?

I am using MPASMWIN v02.01 and PICPROG 1.2b (by Bryan Rentoul-
http://www.igrin.co.nz/~bryanh/picprog/picprog12b.zip ) and the piece of
code comes from an LCD demo programme by Peter Ouwehand. It's set for a
16c84. I can't work out why I am getting the error messages, as far as I
can see the code should work (aren't they famous last words...); originally
it had 0xf8 for the operand in line 101 but I changed that so it would not
try and set the unused high bits- it didn't change the errors at all.  The
include file sets  (amongst many other things)

STATUS                       EQU     H'0003'

The hex file also causes an error with PICPROG when I try to load it, it
says

"Address larger than rom encountered"

and aborts the load. I can load other .hex files with no problems so
whatever is causing it appears to be in this particular .hex file.

Many thanks for any help and/or advice you can give me, Ken.

----------------------------------------------------------------------------
------------------------------
0009 0185           00097                 CLRF    PORTA           ; ALL
PORT output should output Low.
000A 0186           00098                 CLRF    PORTB
                   00099
000B 1683           00100                 BSF     STATUS, RP0     ; Select
bank 1
000C 3018           00101                 MOVLW   0x18            ; RA2-0
outputs, RA4-3 inputs
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are
correct.
000D 0085           00102                 MOVWF   TRISA
MPASM 02.01 Released              LCD.ASM   4-17-1998  2:59:35
PAGE  3


LOC  OBJECT CODE     LINE SOURCE TEXT
 VALUE

000E 3000           00103                 MOVLW   0x00            ; RB7-0
outputs
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are
correct.
000F 0086           00104                 MOVWF   TRISB
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are
correct.
0010 1781           00105                 BSF     OPTION_REG, NOT_RBPU
                   00106                                         ; Disable
PORTB pull-ups
                   00107
0011 1283           00108                 BCF     STATUS, RP0     ; Select
bank 0
                   00109
0012 2040           00110                 CALL    LCDINIT         ;
Initialize LCDisplay
----------------------------------------------------------------------------
-----------------------------

1998\04\16@205718 by Dennis Plunkett

flavicon
face
At 10:14 AM 17/04/98 +1000, you wrote:
{Quote hidden}

the RP0 bit there is no problem. I don't think that this warning can be
turned off. Also the waning message is for the:-

       MOVWF   TRISB

In line 102, 104 and 105. As for the HEX file error, a complete listing may
be required.

-=====================================================================-

Dennis Plunkett: Embedded Hardware, Software design
NEC Australia DRMASS
Line Interface cards
TRX software
ISDN interface card
ph 03 9264-3867

-=====================================================================-

1998\04\16@205742 by TONY NIXON 54964

flavicon
picon face
>Message[302]: Register in operand not in bank 0.  Ensure that bank
>bits are correct.

This message is meant to warn you to set the RAM Page select bits for
the RAM address you have specified in your instruction. If you have
done this correctly, ignore the message.

Disable it with

errorlevel  -(302)

I don't know why the 'address larger' problem happens. It usually
means that you have assembled with the wrong processor, and the
compiler is trying to write to a ROM location that doesn't exist.

Tony


PicNPoke Multimedia 16F84 Beginners PIC Tools.

**PLUS** - PicNPlay - PicNPlan - PicNPrep - PicNPost
PicNPort - DT Type Saver - *new* PicNQuiz.
Recent addition - DogBoneZ Component.

http://www.dontronics.com/picnpoke.html

'Linux and mpasm'
1998\04\21@190441 by mlist

flavicon
face
I am finally getting my act together and playing with these PICs. I am using
Linux at home. I use mpasm under a DOS EMU environment. All seemed to be
working untill I tried using the INCLUDE statement. It seems no mater
what syntax I use I always get a :

Cannot open file (Include File "G:\MTTEST\P16C84.INC")

I have tried all of these syntax methods (and more)

       #include "P16C84.INC"
       #include "g:\mytest\p16c84.inc"
       include <g:\mytest\p16c84.inc>
       include "G:\MYTEST\P16C84.INC"

Here is my setup:

Linux 2.0.33
dosemu 0.66
mpasm 2.01

Is there anyone out there using mpasm under a dosemu environment. I am
open to other options when it comes to compiling under Linux as well.

I use picprog as my serial port burner and a LudiPIPo programmer.

1998\04\22@084119 by Lou Calkins

flavicon
face
I am using the MKS Toolkit under DOS, and I use the following line in my
code with no problems:

       include "c:/mplab/p16c62a.inc"

Note the FORWARD slashes.  I am still running the (old I guesss) MPLAB
v3.22.02 but I think the newer version should be the same.  Give the forward
slashes a try.

{Quote hidden}

1998\04\22@085341 by Ints Mikelsons

flavicon
face
I dunno about forward slashes, but problem WAS in include file - this file wasn'
t
included in package!

Lou Calkins wrote:

{Quote hidden}

--
With the best regards, Ints Mikelsons
(e-mail: RemoveMEmintsRemoveMEspamEraseMEedi.lv)
(www: http://welcome.to/biocenter.lv)

1998\04\29@141226 by Juan Manuel Muqoz Caqadillas

flavicon
face
Daryl Sayers escribi—:
{Quote hidden}

Hi, in the last version of Linux Debian 1.3 have one asambler and
simulator for Linux , only version Linux no DOS.

Bye.
Juan Manuel


'Configure MultiEdit for MPASM'
1998\05\13@163400 by David Sorlien
picon face
As some PICLIST-ers have requested, I have written up directions to
configure MultiEdit for use with MPASM. My configuration enables syntax
highlighting, and compiler program setup. I haven't got the compile
error file parsing to work yet, but my config does load the error file
automatically after a compile.

Here is a link to the instructions:
http://www.geocities.com/SiliconValley/Haven/9004/meconfig.txt

If you do not know what MultiEdit is, look at the following web site:
http://www.multiedit.com

Please let me know if I made mistakes, or if anyone has suggestions for
improvement.

Dave Sorlien

1998\05\15@123118 by Alex Torres

picon face
-----Original Message-----
From: David Sorlien <KILLspamdsorlienspamspamBeGoneGEOCITIES.COM>
To: PICLISTspamspamMITVMA.MIT.EDU <RemoveMEPICLISTspamBeGonespamRemoveMEMITVMA.MIT.EDU>
Date: Wednesday, May 13, 1998 11:34 PM
Subject: Configure MultiEdit for MPASM


>As some PICLIST-ers have requested, I have written up directions to
>configure MultiEdit for use with MPASM. My configuration enables syntax
>highlighting, and compiler program setup. I haven't got the compile
>error file parsing to work yet, but my config does load the error file
>automatically after a compile.

MultiEdit is good, but anybody who work with Borland Pascal or C may use my
message filter, that can parse the MPLAB's errors and brousing them into
assembler text (include file is also supported).
You can find this software at
http://www.geocities.com/SiliconValley/Lab/6311/pic.htm

==================================
Alex Torres, Kharkov, Ukraine (exUSSR)
E-Mail: KILLspamaltorspamBeGonespamgeocities.com
2:461/28 FidoNet
Home Page: http://www.geocities.com/SiliconValley/Lab/6311

'Help with MPASM error'
1998\05\22@080226 by Mark Jurras

picon face
This used to work, then all of a sudden I get this error message when
I compile the Macro T1.INC with MPLAB 3.31 and 3.40 X is declared
local and USECS is Passed. The Macro is invoked twice.

Here are lines 4,8,12 and 48 respectivly:

       IF ((USECS) > 1024)
       IF ((USECS) < 0)
X = (USECS)%8
X = (USECS)/8

Here is the error:

Command line: "D:\PROGRA~1\MPLAB\MPASM.EXE /aINHX8M /e+ /l+ /x- /w0
/c+ /m+ /rhex /p16C62A /q M:\HOME\TCIR.ASM"
Warning[217] M:\HOME\JURRAM\PROJECTS\IRDATA\TCIR.ASM 3 : Hex file
format specified on command line.
Message[308] M:\HOME\TCIR.ASM 10 : Warning level superceded by command
line value. (0)
Error[112]   M:\HOME\T1.INC 4 : Missing operator
Error[112]   M:\HOME\T1.INC 8 : Missing operator
Error[112]   M:\HOME\T1.INC 12 : Missing operator
Error[112]   M:\HOME\T1.INC 48 : Missing operator
Error[112]   M:\HOME\T1.INC 4 : Missing operator
Error[112]   M:\HOME\T1.INC 8 : Missing operator
Error[112]   M:\HOME\T1.INC 12 : Missing operator
Error[112]   M:\HOME\T1.INC 48 : Missing operator
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

'calculation in MPASM'
1998\05\26@100855 by Mark Jurras

picon face
I need to calculate a constant at compile time to set a delay. I have
an equate:

NumAve  equ     0x40            ;Average 64 Readings

that I set for the number of A/D readings I want to average. I want to
average that number over one cycle of the AC power or 1/60 seconds. I
want to call a Macro (You know it well Andy!) with the amount of the
delay between A/D readings. The equation for the delay is:

1000000/60/NumAve-80


1000000 is me instruction rate
60 is the power line freq.
NumAve (see above)
80 is my A/D overhead

I want to invoke Andrew Warren's WAIT macro with
the result. Any hints how to setup the expression??

Thank you,

- -Mark



_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

1998\05\26@123811 by Marco DI LEO

flavicon
face
Mark Jurras wrote:
>
> I need to calculate a constant at compile time to set a delay. I have
> an equate:
>
> NumAve  equ     0x40            ;Average 64 Readings
>
> that I set for the number of A/D readings I want to average. I want to
> average that number over one cycle of the AC power or 1/60 seconds. I
> want to call a Macro (You know it well Andy!) with the amount of the
> delay between A/D readings. The equation for the delay is:
>
> 1000000/60/NumAve-80

Simply use the following:

       WAIT    ((1000000/60)/NumAve)-80

Actually you shouldn't need the parenthesis but I prefer to specify the
strict operation precedence. All calculation in MPASM are carried out on
32 bit _integer_ values so you can compute the desired value.

Please note that your expression gives a result of 0xb4 (180 decimal) so
you are almost near the capacity of a byte. Should you, in a latter
time, decide to reduce the number of readings to, say, 32, the
expression gives 0x1b8 (440 decimal) thus exceeding the byte size (the
same applies if you change the osc frequency). I don't know if the macro
you are planning to use takes a 16 or 8 bit value but in the latter case
you have to handle the overflow.

You can try something like this:

NumAve    equ     0x40            ;Average 64 Readings
CyclePS   equ     D'1000000'      ;Cycles per second
LineFreq  equ     D'60'           ;AC power frequency
ADtime    equ     D'80'           ;A/D overhead

ToWait    equ     ((CyclePS/LineFreq)/NumAve)-ADtime

         if      ToWait > 0xff   ;Change 0xff to the routine limit
         error   "Can't wait so long..."
         endif
...
...
...
         WAIT    ToWait

This way if your delay exceeds the limit of the macro (remember to
change the value in the 'if' line) you get an error so you can fix the
problem.

Using a routine that needs the delay value in separate bytes (LSB to
MSB) you can call it as in:

         movlw   low ToWait
         movwf   DelayLO              ;Low byte of delay
         movlw   high ToWait
         movwf   DelayHI              ;High part of delay
         call    Delay

or for 32 bit values (veeery long delay):

         movlw   ToWait & 0x000000ff
         movwf   DelayLO              ;Low byte
         movlw   (ToWait & 0x0000ff00) >> 8
         movwf   DelayML              ;Middle-low byte
         movlw   (ToWait & 0x00ff0000) >> 16
         movwf   DelayMH              ;Middle-high byte
         movlw   (ToWait & 0xff000000) >> 24
         movwf   DelayHI              ;High byte
         call    LongDelay

Ciao
 Marco

----
Marco DI LEO                  email: @spam@m.dileoSTOPspamspam@spam@sistinf.it
Sistemi Informativi S.p.A.    tel:   +39 6 50292 300
V. Elio Vittorini, 129        fax:   +39 6 5015991
I-00144 Roma                  web:   http://members.tripod.com/~mdileo/
Italy

1998\05\26@150524 by Andrew Warren

face
flavicon
face
Mark Jurras <PICLISTspamBeGonespamspamBeGoneMITVMA.MIT.EDU> wrote:

> I need to calculate a constant at compile time to set a delay. I
> have an equate:
>
> NumAve  equ     0x40            ;Average 64 Readings
> ....
> The equation for the delay is:
>
> 1000000/60/NumAve-80
> ....
> I want to invoke Andrew Warren's WAIT macro with the result. Any
> hints how to setup the expression??

Mark:

   WAIT (1000000/(60*NUMAVE)) - 80

-Andy

=== Andrew Warren - spamBeGonefastfwdspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499 (personal)
=== http://www.netcom.com/~fastfwd (business)


'WHAT'S WRONG? - MPASM WITH 17C756'
1998\07\01@141807 by WF AUTOMACAO
flavicon
face
Hi, :(

       I don't believe what's happening with a program that i try to execute a
program in 2
external EEPROM connected in a PIC17C756 (MICROPROCESSOR MODE)

       The first works well! I wrote 0 and 1 on PORTB, i measure in osciloscope
a square wave!


                   00425
                   00426
                   00427         LIST P=17C756
                   00428
;--------------------------------------------------------------------------
                   00429 ; Program Code
                   00430
;--------------------------------------------------------------------------
                   00431
;--------------------------------------------------------------------------
                   00432 ;   Set the reset vector here.  If you are using a PIC
16C5X device,
use:
                   00433 ;               ORG     &lt;last program memory locati
on&gt;
                   00434 ;   Otherwise, use:
                   00435 ;               ORG     0
                   00436
;--------------------------------------------------------------------------
                   00437
0000                00438                 ORG     0
0000 C001           00439                 GOTO    Start
                   00440
0001                00441 Start
0001 B800           00442                  MOVLB  BANK0 ;select bank1
0002 B000           00443                  MOVLW  0x00
0003 0111           00444                  MOVWF  DDRB  ; portb as output
                   00445
0004                00446 Loop
                   00447
0004 B000           00448                 MOVLW  0x00
0005 0112           00449                 MOVWF  PORTB ; Flip-Flop
0006 B0FF           00450                 MOVLW  0xFF
0007 0112           00451                 MOVWF  PORTB ; Flip-Flop
0008 C004           00452                 goto Loop    ; stay in LOOP
                   00453
                   00454
                   00455                 END

But, when i do a small change on Software, nothing happens, the osciloscope show
s anything!


                   00437
0000                00438                 ORG     0
0000 C001           00439                 GOTO    Start
                   00440
0001                00441 Start
0001 B800           00442                  MOVLB  BANK0 ;select bank1
0002 B000           00443                  MOVLW  0x00
0003 0111           00444                  MOVWF  DDRB  ; portb as output
                   00445
0004                00446 Loop
0004 B706           00447                  lcall Sub     ; call a FLIP-FLOP subr
outine
0005 C004           00448                  goto Loop    ; stay in LOOP
0006                00449 Sub
                   00450
0006 B000           00451                 MOVLW  0x00
0007 0112           00452                 MOVWF  PORTB ; Flip-Flop
0008 B0FF           00453                 MOVLW  0xFF
0009 0112           00454                 MOVWF  PORTB ; Flip-Flop
000A 0002           00455                 RETURN
                   00456
                   00457                 END

What am i doing wrong? Wait for other BIG question! (Now in MPLAB17-C)

My mpab is 01.50, but i think that's not the problem! (BUG)

Miguel Wisintainer

1998\07\01@163501 by Mike Keitz

picon face
On Wed, 1 Jul 1998 15:14:41 -0700 WF AUTOMACAO <spam_OUTwfSTOPspamspamAMBIENTE.COM.BR>
writes:
>Hi, :(
>
>        I don't believe what's happening with a program that i try to
>execute a program in 2
>external EEPROM connected in a PIC17C756 (MICROPROCESSOR MODE)

What is your PIC clock rate?  It is quite possible that the PIC is
running too fast for the EEPROMs to supply the proper program
instructions to it.

The timing diagrams in the back of the PIC data say that the time between
when the PIC outputs a valid address and the memory must provide the
correct data is 3 xtal cycles - 30 ns.  At 25 MHz, that is only 90 ns.
The delay through the address latch must also be accounted for, maybe 20
ns.  So the memory must have an access time of 70 ns or less.

Parallel EEPROMs are rather slow to read compared to RAM or EPROM.  Newer
Microchip 28C64s are spec'd at 150 ns.  Other ones may be 200 or even 450
ns.  None of these chips will work with the PIC going 25 MHz, or even 16
MHz.  Not allowing enough access time can cause the chips to read wrong,
though often consistent, data.  This would explain one program working
and another not.

For a test, slow the PIC way down and see if the programs operate
properly.  With a 4 MHz crystal, the memories have about 700 ns to
respond, which should be plenty.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\07\01@165717 by WF AUTOMACAO

flavicon
face
Mike Keitz wrote:
{Quote hidden}

Myke, i don't know if you understood what i did!

THe first sample works well!

But the second, where i did include a Subroutine for change the State of
PORTB, doesn't work!

I only included a Subroutine, nothing more! :(

Miguel

1998\07\01@193749 by Mike Keitz

picon face
On Wed, 1 Jul 1998 17:52:48 -0700 WF AUTOMACAO <TakeThisOuTwfspamspamRemoveMEAMBIENTE.COM.BR>
writes:

>THe first sample works well!
>
>But the second, where i did include a Subroutine for change the State
>of
>PORTB, doesn't work!

If you exceed the speed ratings of the memory chips, they may read one
program OK but fail on another.  Not every bit in a memory chip works at
the same speed.  The manufacturer's rating is just a guaranteed maximum
for the worst bit.  If you happen to have a program only in  fast bits,
it will work OK, but expanding the program into a slow section of the
chip won't.  Bits can also be such that zeros will read at a high speed,
but it takes longer to read a one (or vice versa).  Changing the program
so such a bit that was zero is now one will make it fail.  So it is
something to check.  If you are running the PIC faster than 4 MHz it is
quite possible to have a speed related problem.


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\07\02@104253 by AA9LA

flavicon
face
Miguel,

The LCALL instruction loads the high order 8 bits of the called address from
PCLATH.

You need to be sure it is set to High Sub.  It appears that PCLATH
coincidentally is
set to zero so this should be working as expected (if you are executing this
code
exactly).

The CALL instruction would be more appropriate.

..EUGENE..  (AE2F - "Always Easy To Find")

------------------------------

Date:    Wed, 1 Jul 1998 15:14:41 -0700
From:    WF AUTOMACAO <KILLspamwfspamspamspam_OUTAMBIENTE.COM.BR>
Subject: WHAT'S WRONG? - MPASM WITH 17C756

Hi, :(

       I don't believe what's happening with a program that i try to
execute a program in 2
external EEPROM connected in a PIC17C756 (MICROPROCESSOR MODE)

       The first works well! I wrote 0 and 1 on PORTB, i measure in
osciloscope a square wave!


                   00425
                   00426
                   00427         LIST P=17C756
                   00428
;--------------------------------------------------------------------------
                   00429 ; Program Code
                   00430
;--------------------------------------------------------------------------
                   00431
;--------------------------------------------------------------------------
                   00432 ;   Set the reset vector here.  If you are using a
PIC16C5X device,
use:
                   00433 ;               ORG     &lt;last program memory
location&gt;
                   00434 ;   Otherwise, use:
                   00435 ;               ORG     0
                   00436
;--------------------------------------------------------------------------
                   00437
0000                00438                 ORG     0
0000 C001           00439                 GOTO    Start
                   00440
0001                00441 Start
0001 B800           00442                  MOVLB  BANK0 ;select bank1
0002 B000           00443                  MOVLW  0x00
0003 0111           00444                  MOVWF  DDRB  ; portb as output
                   00445
0004                00446 Loop
                   00447
0004 B000           00448                 MOVLW  0x00
0005 0112           00449                 MOVWF  PORTB ; Flip-Flop
0006 B0FF           00450                 MOVLW  0xFF
0007 0112           00451                 MOVWF  PORTB ; Flip-Flop
0008 C004           00452                 goto Loop    ; stay in LOOP
                   00453
                   00454
                   00455                 END

But, when i do a small change on Software, nothing happens, the osciloscope
shows anything!


                   00437
0000                00438                 ORG     0
0000 C001           00439                 GOTO    Start
                   00440
0001                00441 Start
0001 B800           00442                  MOVLB  BANK0 ;select bank1
0002 B000           00443                  MOVLW  0x00
0003 0111           00444                  MOVWF  DDRB  ; portb as output
                   00445
0004                00446 Loop
0004 B706           00447                  lcall Sub     ; call a FLIP-FLOP
subroutine
0005 C004           00448                  goto Loop    ; stay in LOOP
0006                00449 Sub
                   00450
0006 B000           00451                 MOVLW  0x00
0007 0112           00452                 MOVWF  PORTB ; Flip-Flop
0008 B0FF           00453                 MOVLW  0xFF
0009 0112           00454                 MOVWF  PORTB ; Flip-Flop
000A 0002           00455                 RETURN
                   00456
                   00457                 END

What am i doing wrong? Wait for other BIG question! (Now in MPLAB17-C)

My mpab is 01.50, but i think that's not the problem! (BUG)

Miguel Wisintainer

------------------------------

'Parallax to MPASM opcode conversion'
1998\07\27@133722 by NCS Products

flavicon
face
Are there any programs out there which can take a
parallax format opcode .asm file and turn it to standard
microchip opcodes?

1998\07\27@140433 by John Bellini

flavicon
face
I had to this before manually and it wasn't too bad.  However, the next
time I have to do this I will write macro's for all of the Parallax
instructions in Microchip.  This is handy too because Parallax has a lot
of good instructions that are useful.

-----Original Message-----
From: NCS Products [ncsRemoveMEspamWORLDNET.ATT.NET]
Sent: Sunday, July 26, 1998 9:56 PM
To: EraseMEPICLISTSTOPspamspamRemoveMEMITVMA.MIT.EDU
Subject: Parallax to MPASM opcode conversion


Are there any programs out there which can take a
parallax format opcode .asm file and turn it to standard
microchip opcodes?

1998\07\29@043209 by Tom Handley

picon face
  Well... I have some beta software that was loaned to me but I can't go
into details. I have not had time to thoroughly test it. There are more
issues than simply writing macros. One that comes to mind is how the
Parallax (CVASM) assembler handles LCALL/LSET. This has to be done at
assembly time or through a converter. LCALL/LSET allows me to call any
routine, in any bank, without worrying about PCLATH. Other issues are
assembly directives, comments, etc, in the converted code. Obviously the
best qualified folks to write a converter are those intimately familiar with
the assembler (ie: Chip, John, and now, Tech Tools). Chip and John have
their `paws full' with SX. I'm not sure about Tech Tools but their CVASM
update is probably a low priority compared to their other products.

  I really would like a converter but I realize how hard it would be to
implement one. The main reason I rarely post code here is due to the fact
that I prefer the Parallax instruction set. I also know Microchip's but I
don't have time to manually convert from one to the other. I'm sure you
already know this but you can easily generate object files compatible with
other programmers and tools (/S Option) and you can use Microchip syntax
with few if any modifications.

  Just thinking about my comment; "The main reason I rarely post code...".
Actually, it's more related to our resident experts such as Andy W, Scott,
Dimitry, and many others. Anything I would post, other than Parallax-
specific, would seem rather silly ;-)

  - Tom

At 12:55 AM 7/27/98 -0400, you wrote:
>Are there any programs out there which can take a
>parallax format opcode .asm file and turn it to standard
>microchip opcodes?
>
>


'Setting label widths for MPASM'
1998\08\12@184220 by Richard A. Smith
flavicon
face
It appears that the lable width size for MPASM's linker is only 6 characters wid
e.

Is there a way to make this larger?



--
Richard A. Smith                         Bitworks, Inc.
spam_OUTrsmithRemoveMEspamEraseMEbitworks.com               501.521.3908
Sr. Design Engineer        http://www.bitworks.com

1998\08\13@190841 by Claudio Rachiele IW0DZG

flavicon
face
                  Status Distribution August 12, 1998 22:37:49

The message regarding "Setting label widths for MPASM" sent on August 12, 1998 22:37:49 was sent by

Status Recipient
         Type                To
         Native Name         TakeThisOuTPICLISTRemoveMEspam@spam@MITVMA.MIT.EDU
         Foreign Native Name EraseMEPICLISTRemoveMEspamMITVMA.MIT.EDU\n\n\nINTERNET



Recipients

Status Reporters
         Type                From
         Initials            CR
         Name Domain         NOTES
         Native Name         CN=Claudio Rachiele IW0DZG/OU=Italy/O=IBM@IBMIT
         Foreign Native Name CN=Claudio Rachiele IW0DZG/OU=Italy/O=IBM\nIBMIT\n\n
         Organization        IBM
         Org Unit 1          Italy
         Last Name           IW0DZG
         First Name          Claudio



Status          769
Explanation     Invalid recipient

X.400 Status    769
Explanation     Router: Unable to open mailbox file D14HUBM1/14/H/IBM mail.box: Remote system no longer responding

1998\08\14@024607 by Caisson

flavicon
face
> Van: Richard A. Smith <spamrsmith.....spamspambitworks.com>
> Aan: PICLISTspam_OUTspam@spam@MITVMA.MIT.EDU
> Onderwerp: Setting label widths for MPASM
> Datum: woensdag 12 augustus 1998 23:50
>
> It appears that the lable width size for MPASM's linker is only 6
characters wide.
>
> Is there a way to make this larger?

Yes, there is.
 Options, Environment setup (or Ctrl-F7)  at the lower right.

Greetz,
 Rudy Wieser

'What«s mpasm ? What«s mplink ?'
1998\08\28@185128 by Ricardo Ponte G

flavicon
face
       Hi,

       I«m using the mplab IDE software runing under Windows 95.

       But I was thinking:

       If I only would have DOS I got to make the job different:

       What«s mplab function ? , doing the hard work of creating the Hex. fil
e ?

       What«s mplink function ?, linking the  " *.inc " files used in the sou
rce
file ?

       please Can you clear my teory ?, thanks.

1998\08\28@195601 by Darrel Johansen

picon face
>What's mplab function ? , doing the hard work of creating the Hex. file
>What's mplink function ?, linking the  " *.inc " files used in the source
>file ?

    MPASM is the assembler.  It can create the .HEX file from your source
    code using .ASM source files and .INC header files.  The .INC header
    files are the names and addreses of the PICmicro registers.

    If you download the MPASM User's Guide, you can use it from DOS
    without MPLAB.  There are some examples of its use in this manual.

    You do not need to use MPLINK, but you can see and example of how to
    use it if you download the MPLAB v3.40 Project Manager tutorial from
    the web page.

    Darrel


'AN512 - Huh?? - MPASM Pseudo instructions.'
1998\09\17@072754 by Andy David
flavicon
face
>
>SKPNC, CLRC, SKPZ, SKPC, SETC.
>
>It's got me totally confused. Is it macro's? If so, then where is it
>defined?
>If I run the program in MPSIM I see that they do something, but I got no
>idea what.
>
>As confused as a chameleon on a comic strip.


Quentin,

SKPNC   - Skip if no carry      [btfsc  STATUS,C]
CLRC    - clear carry           [bcf    STATUS,C]
SKPZ    - Skip if zero  [btfss  STATUS,Z]
SKPC    - Skip if carry [btfss  STATUS,C]
SETC    - set carry             [bsf    STATUS,C]


They are MPASM pseudo instructions and all translate to a single
instruction. There's no real benefit to using them over the normal
instructions except that they're easier to read.


- Andy.

----------------------------------------------------------
Andrew David, Software Manager, Ultronics Ltd, Cheltenham.
.....akdavidspamspam.....Ultronics.co.uk          http:\\http://www.ultronics.com
----------------------------------------------------------

1998\09\17@095445 by Quentin

flavicon
face
Andy David wrote:
>

>
> They are MPASM pseudo instructions and all translate to a single
> instruction. There's no real benefit to using them over the normal
> instructions except that they're easier to read.
>
Or to confuse you. Thanks to all that replied. I now replaced it with the
normal instructions.

Quentin


'SPASM TO MPASM'
1998\10\06@184301 by Claton Cadmus
flavicon
face
Is there a way to easily convert code written with PARALLAX SPASM to MPASM?

Claton Cadmus

'SPASM <-> MPASM'
1998\10\12@131726 by Craig Webb

flavicon
face
Claton,

Parallax offers a program called "Transxlator" that converts source code
(with labels and comments intact) from MPASM to SX-key/SPASM format.

I have a version that converts the other way also, e-mail me if you're
interested.

Craig

At 05:12 PM 10/6/98 -0500, you wrote:
>Is there a way to easily convert code written with PARALLAX SPASM to MPASM?
>
>Claton Cadmus
>


'Parallax to MPASM'
1998\11\18@183807 by Robert M. Piper
picon face
Anybody know a quick way to translate code for Parallax's assembler to
code for MPASM



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

'Parallax code to MPASM code'
1998\11\19@010750 by Ivan Cenov

flavicon
face
Hi,

I have an include file "parallax.inc" in my web page
for MPASM, where parallax instructions are "macrosed".
May this will help.

http://www.geocities.com/SiliconValley/Network/9276/downld.htm

Ivan Cenov
okto7KILLspamspamEraseMEbotev.ttm.bg
ICQ: 17221948
Do what have to do, let happens what it wants.

{Original Message removed}

'Parallax to MPASM'
1998\11\19@061935 by Robert M. Piper

flavicon
face
Does anybody know a quick and eay way to convert Parallax code to MPASM
code?

Robert

'Parallax code to MPASM code'
1998\11\19@081824 by Andy Kunz

flavicon
face
>I have an include file "parallax.inc" in my web page
>for MPASM, where parallax instructions are "macrosed".
>May this will help.
>
>http://www.geocities.com/SiliconValley/Network/9276/downld.htm

Thanks, Ivan.  Those will be a big help!

Andy


==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================


'Parallax to MPASM'
1999\02\23@184610 by Carlos Leguizamon
flavicon
face
Hello Piclisters

Have someone a utility to convert *.src (parallax assembler ) to *.asm
(MPASM ) or Parallax assembler sintax .

Thanks in advance
Best regards


'Fwd: [MPLAB] New MPASM and PICmicro Quick Referenc'
1999\04\27@222736 by Eaejrphd
picon face
part 0 2169 bytes content-type:text/plain; charset=us-ascii (decoded 7bit)

Return-Path: <EraseMEMPLAB-owner@spam@spam@spam@mail.microchip.com>
Received: from  rly-yd05.mx.aol.com (rly-yd05.mail.aol.com [172.18.150.5]) by
       air-yd01.mail.aol.com (v59.4) with SMTP; Tue, 27 Apr 1999 17:29:22
       -0400
Received: from mail.microchip.com (mail.Microchip.COM [198.175.253.70])
         by rly-yd05.mx.aol.com (8.8.8/8.8.5/AOL-4.0.0)
         with SMTP id RAA23601 for <@spam@EaejrphdspamspamKILLspamaol.com>;
         Tue, 27 Apr 1999 17:29:21 -0400 (EDT)
Received: from prometheus.Microchip.COM [198.175.253.66] by
       mail.microchip.com
 (SMTPD32-4.06) id AB7354301DC; Tue, 27 Apr 1999 14:09:39 CDT
Received: by prometheus.Microchip.COM; id AA08869; Tue, 27 Apr 99 13:30:21
       MST
Received: from loghost(172.16.245.37) by prometheus.Microchip.COM via smap
       (3.2)
       id xma008763; Tue, 27 Apr 99 13:30:00 -0700
Received: from microchip.com ([172.16.249.212]) by titan.Microchip.COM
       (8.6.12/8.6.12) with ESMTP id NAA10379; Tue, 27 Apr 1999 13:29:07
       -0700
Message-Id: <spamBeGone37261E10.2BFA4EF2RemoveMEspamEraseMEmicrochip.com>
Date: Tue, 27 Apr 1999 13:29:05 -0700
From: Darrel Johansen <RemoveMEcnKILLspamspamRemoveMEMicrochip.COM>
Reply-To: TakeThisOuTcnspamMicrochip.COM
X-Mailer: Mozilla 4.51 [en] (Win95; I)
X-Accept-Language: en
Mime-Version: 1.0
To: MPLAB LIST SERVE SERVE <spamBeGonemplabKILLspamspamTakeThisOuTmail.microchip.com>,
       Compilers LIST SERVE SERVE <EraseMEcompilers.....spamKILLspammail.microchip.com>
Subject: [MPLAB] New MPASM and PICmicro Quick Reference Card
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Precedence: bulk
Sender: spamMPLAB-ownerspammail.microchip.com

A new MPASM, MPLINK and MPLIB quick reference card is posted at:

http://www.microchip.com/10/Tools/picmicro/code/mpasm/index.htm

This card also contains the instruction sets for the 12-bit, 14-bit,
16-bit
and the new enhanced 16-bit PICmicros.


               ******************************
This list is managed by Microchip Technology Inc.
     (602) 786-7200 http://www.microchip.com
To unsubscribe from this list, send a message to: listservSTOPspamspammail.microchip.com
with the following as the body: unsubscribe mplab yourname
Here is an example: unsubscribe mplab John Doe



''btfss(c) fileA, fileB' or 'do case' in mpasm'
1999\05\17@105501 by Sebasti‡n Dols
flavicon
face
Hello PIClisters

First of all, I apologize if i am restarting a previously finished thread.
I got two questions with the same face but different body:


*the first is: i am trying to resolve a code trouble with a
   'btfss(c) file, bit'
statement, but I need to reference the bit via the contents of other file
(contents will be always 0-8), in order to achieve something like a
   'btfss(c) fileA,fileB'
The assembler do not show any complaint about it except with a 'less
significant bits used', but do not simulate well...Is this statement
codeable in any way or simply is bad coded?

**the second is: If the prior statement is not possible, then what is, in
your opinion, the (as usual) more clock-efective way to program a 'C-like'
do-Case statement (without buying a C compiler, of course <g>)?

Thanks in advance
Keep on PICing

Sebastian Dols

1999\05\18@070323 by Caisson

flavicon
face
> Van: Sebasti‡n Dols <sdolsSTOPspamspamKILLspamESEGI.ES>
> Aan: @spam@PICLIST.....spamspamMITVMA.MIT.EDU
> Onderwerp: 'btfss(c) fileA, fileB' or 'do case' in mpasm
> Datum: maandag 17 mei 1999 16:52
>
> Hello PIClisters

Hello Sebasti‡n,

> *the first is: i am trying to resolve a code trouble with a
>     'btfss(c) file, bit'
> statement, but I need to reference the bit via the contents of other file
> (contents will be always 0-8), in order to achieve something like a
>     'btfss(c) fileA,fileB'
>  The assembler do not show any complaint about it except with a 'less
> significant bits used', but do not simulate well...Is this statement
> codeable in any way or simply is bad coded?

It's badly coded (sorry :-).  The second argument ("FileB") is taken as a
Constant.  And because the File-adress (_not_ contents !) is not within the
range 0 thru 7 it display's the warning about the "less significant bits"
..

> **the second is: If the prior statement is not possible, then what is, in
> your opinion, the (as usual) more clock-efective way to program a
'C-like'
> do-Case statement (without buying a C compiler, of course <g>)?

Convert the contents of FileB to a Bit-mask, than AND them with the
contents of FileA ...

Solutions where discussed in the thread "Using a variable to clear a bit"
about 2 weeks ago.

Greetz,
 Rudy Wieser


'Looking for MPASM User's Guide'
1999\09\02@161803 by John Piccirillo
flavicon
face
  I have searched the Microchip site for a
MPASM User's Guide without luck.  I also sent an
enquire to the contact given (literature@mail.
microchip.com) and it bounced.  Where can I find
this?

Thanks,

John-

1999\09\02@163252 by Nick Taylor

picon face
John - - do a search for document DS33014F.
- Nick -

John Piccirillo wrote:
{Quote hidden}

1999\09\02@163457 by eplus1

flavicon
face
www.microchip.com/10/Tools/PICmicro/Code/MPASM/33014g/index.htm

Which I got to from Microchips WebSite at http://www.microchip.com by
clicking on:
"Development Tools" then
"PICmicro Tools, Code Generation Tools, MPASM, MPLINK, and MPLIB" then
"MPASM User's Guide with MPLINK and MPLIB"

James Newton, webmaster http://get.to/techref
(hint: you can add your own private info to the techref)
spamjamesnewton.....spam.....geocities.com
1-619-652-0593 phoneÊ



-----Original Message-----
From: pic microcontroller discussion list
[PICLIST.....spamMITVMA.MIT.EDU]On Behalf Of John Piccirillo
Sent: Thursday, September 02, 1999 1:04 PM
To: KILLspamPICLISTspam_OUTspamMITVMA.MIT.EDU
Subject: Looking for MPASM User's Guide


  I have searched the Microchip site for a
MPASM User's Guide without luck.  I also sent an
enquire to the contact given (literature@mail.
microchip.com) and it bounced.  Where can I find
this?

Thanks,

John-

1999\09\03@150817 by John Piccirillo

flavicon
face
  Thanks for the pointers to the MPASM User's Guide.
I was looking in the literature path instead of
the tool development path.

John-


'SX extensions to MPASM'
1999\10\12@121943 by jeff
flavicon
face
I'm trying to use the "sxdefs.inc" file off of svtehs.com's Scenix
resource list. I'm having trouble getting the DEVICE parameter defined,
though it looks as though provisions are there for it.

Does anyone have a VERY simple code example I can look at? I'm looking
for something that defines the part, ports, reset vector, etc on an
SX28AC using MPASM. The body of the code can just be something dumb,
like an infinite loop.

TIA,
Jeff
spam_OUTjeffspamTakeThisOuTtravisura.com


'MPLAB v MPASM/MPSIM'
1999\11\04@091721 by JP.BROWN
flavicon
face
Hi Folks, to people with experience of >both< the above packages,
if you were starting out using pic chips would you bother with
mpasm/mpsim or would you just go straight for mplab?.

I may be involved with teaching pic techniques to students soon and I
wondered if the older packages had any advantages over the newer ones
for example shorter learning curve or quicker to use?.

Thank you for any comments or opinions   ........ John

         -----  John P. Brown      .....J.P.Brown.....spamRemoveMEbradford.ac.uk ----
          \            --- Witty remark goes here ---         /
           --------------------------------------------------

1999\11\04@104513 by James Paul

flavicon
face
J.P.,

Both are relatively easy to use.  At least for me they seem to
be anyway.  But if you are going to teach students about uC's
in general, and PIC's in particular, I'd go with MPLAB because
it represents the latest and greatest from Microchip, and it
runs under Windows which is the platform that most people are
going to come in contact with upon entering the job market.
On the other hand, if these students are already in the work
force and are the engineering types, then it probably
wouldn't matter one way or the other.  But I'd say go with the
Windows platform and MPLAB.

                                       Regards,

                                         Jim



On Thu, 04 November 1999, "JP.BROWN" wrote:

{Quote hidden}

EraseMEjimspamBeGonespamKILLspamjpes.com

'Bank Usage message from mpasm'
1999\11\30@152137 by Martin McCormick

flavicon
face
       I have something wrong, here, but I am not sure what.

       I put in the following code which I closely plagerized from
the example given in the 16C71 data sheet.  Code snippet follows:

;from EXAMPLE 5-2: INITIALIZING PORTB
       BCF STATUS, RP0 ;
; clearing output data latches
       BSF STATUS, RP0 ; Select Bank 1
       clrw    ;Set w to 0 to make all outputs.
; initialize data direction
       MOVWF TRISB ;All 8 bits are now outputs.


       In the example, they set W to a mixture of inputs and outputs,
but otherwise, it is pretty much the same sequence.  My source
assembles with the following message which I have broken in to more
lines to make reading a bit easier:


Message[302] C:\PICWORK\VOX\VOX.ASM 136 :
Register in operand not in bank 0.  Ensure that bank bits are correct.

       What am I doing wrong?  This isn't an error, but it obviously
means that something doesn't look right to mpasm and I am not trying
to do anything unusual at all.

Martin McCormick

1999\11\30@163723 by Dwayne Reid

flavicon
face
>;from EXAMPLE 5-2: INITIALIZING PORTB
>        BCF STATUS, RP0 ;
>; clearing output data latches
>        BSF STATUS, RP0 ; Select Bank 1
>        clrw    ;Set w to 0 to make all outputs.
>; initialize data direction
>        MOVWF TRISB ;All 8 bits are now outputs.

Not a problem - just a warning message that MPASM noticed that you were
writing to a register with an address higher than 0x7F.  The message is
remind you to check that you have set the ram page bits correctly.

I use macros to ensure that the message is generated only if I've been
careless.  I'll give a couple of them here - you can extend them to all the
opcodes that you may use or email me privately and I'll send the whole lot
to you.

In your case above, I'd set the ram page bits, then use
   movwf1      TRISB

No more error message.

The reason for inverting the MSB in the following macros instead of just
masking it is to make sure that I'm paying attention to what page I'm in -
if I am in page 0 and use a page 1 macro, I get the warning message.

Macros follow:

rampg0          MACRO                   ;set RAM page 0
   bcf         _RP0
   endm

rampg1          MACRO                   ;set RAM page 1
   bsf         _RP0
   endm

rampg2          MACRO                   ;set RAM page 2
   error Ram Page 2 not available on this part
   endm

rampg3          MACRO                   ;set RAM page 3
   error Ram Page 3 not available on this part
   endm


bcf1            MACRO   reg,bit         ;diddle bits in RAM bank 1
   bcf         (reg^0x80),bit          ;invert MSB
   endm

bsf1            MACRO   reg,bit         ;diddle bits in RAM bank 1
   bsf         (reg^0x80),bit          ;invert MSB
   endm


movwf1          MACRO   arg             ;diddle regs in RAM bank 1
   movwf       (arg^0x80)              ;invert MSB
   endm

movfw1          MACRO   arg             ;diddle regs in RAM bank 1
   movfw       (arg^0x80)              ;invert MSB
   endm

swapf1          MACRO   arg,d           ;diddle regs in RAM bank 1
   swapf       (arg^0x80),d            ;invert MSB
   endm

andwf1          MACRO   arg,d           ;diddle regs in RAM bank 1
   andwf       (arg^0x80),d            ;invert MSB
   endm


Dwayne Reid   <RemoveMEdwaynerspamBeGonespamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 15 years of Engineering Innovation (1984 - 1999)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
My posting messages to Usenet neither grants consent to receive
unsolicited commercial email nor is intended to solicit commercial
email.


'Bank Usage message from mpasm'
1999\12\01@013530 by paulb
flavicon
face
Dwayne Reid wrote:

> Not a problem - just a warning message that MPASM noticed that you
> were writing to a register with an address higher than 0x7F.  The
> message is remind you to check that you have set the ram page bits
> correctly.

 .. and proceeds to detail a set of macros for the general case.  In
the specific case given:

>>;from EXAMPLE 5-2: INITIALIZING PORTB
>>        BCF STATUS, RP0 ;

 Is there some code between this and the following?  Otherwise it is
redundant.  It should appear *after* the setting of TRISB.

>>; clearing output data latches
>>        BSF STATUS, RP0 ; Select Bank 1
>>        clrw    ;Set w to 0 to make all outputs.
>>; initialize data direction
>>        MOVWF TRISB ;All 8 bits are now outputs.

 And that said, in the specific case, the optimum solution is to not
jiggle the RP0 bit at all as there is an opcode specifically to perform
the job.  Use these two lines only:

       clrw             ;Set w to 0 to make all outputs.
       tris    portb    ;All 8 bits are now outputs.

 This generates a quite spurious warning which can however be dealt
with most elegantly by editing the directive "  errorlevel -224" into
the P16C71.INC file (and any other 16C7x(x) or 16C(F)8x(x) includes you
may use).  It's cleaner, faster to execute and has no troublesome side
effects on banking.

 Also note the corresponding OPTION opcode to set the option register
without banking problems, and that the TRIS opcode only operates on the
TRISA, TRISB and TRISC registers.  Fortunately this covers the vast
majority of cases.

</FAQ>
--
 Cheers,
       Paul B.

1999\12\01@070731 by Martin McCormick

flavicon
face
"Paul B. Webster VK2BZC" writes:
>>>        BCF STATUS, RP0 ;
>
>  Is there some code between this and the following?  Otherwise it is
>redundant.  It should appear *after* the setting of TRISB.
>
>>>; clearing output data latches
>>>        BSF STATUS, RP0 ; Select Bank 1
>>>        clrw    ;Set w to 0 to make all outputs.
>>>; initialize data direction
>>>        MOVWF TRISB ;All 8 bits are now outputs.

       No.  That is how I have it in the original source code and it
seemed a bit strange to me.  This is the first PIC code I have
actually written even though I have been on this list for about 5
years.  I have written assembly code for other processors, so this
experience is like having a chat with someone from another
English-speaking country.  It's all familiar, but the differences can
throw one for a loop, sometimes.

       Warnings are usually there for a purpose even though they may
not immediately shut down what one is doing, so I figured I had better
find out what sort of trouble I was starting.

       Sorry about reviving one of those cyclic topics again.

Martin McCormick WB5AGZ  Stillwater, OK
OSU Center for Computing and Information Services Data Communications Group

1999\12\01@071602 by Andy Baker

flavicon
face
Martin,

Even if your code is completely correct, this warning will still be present
at every point in the code where you use a register which isn't in bank 0.

If you want pristine code, you should carefully check each of these messages
to make sure you have the correct bank selected before using the registers,
and once you are completely sure of this, disable the warning altogether
using the directive

ERRORLEVEL -302

I think that's the best that can be done.

Andy

{Original Message removed}

1999\12\01@162808 by paulb

flavicon
face
Martin McCormick wrote:

>         Warnings are usually there for a purpose even though they may
> not immediately shut down what one is doing, so I figured I had better
> find out what sort of trouble I was starting.

 True enough, though 302 and 305 are really style reminders and 224 is
total nonsense.

 Andy Baker reccomends suppressing 302.  I would prefer to reccomend
suppressing 224 globally as I stated, but making a point of coding to
avoid 302 and 305.  305 is avoided by never defaulting the destination
of an operation, but always explicitly using F or W (*NEVER* 0 or 1!).

 302 is avoided either by macros or by using labels such as TRISB^HIBIT
where HIBIT is defined as $80.  With that blatant marker, you will tend
to remember to check bank bits.
--
 Cheers,
       Paul B.

'Specifing EEPROM contents win MPASM'
1999\12\04@155748 by Mark Farver

flavicon
face
In MPASM how does one specify the contents of the user EEPROM area in the
.asm file so that it can be programmed along with the program ROM for the
16x84?

Mark

1999\12\04@181143 by Nick Taylor

picon face
You use the DATA or DW or IDATA directive.  See pages 30, 32, and
40 of the MPASM User's Guide.  If you don't have the documentation,
you can get it from Microchip ... DS33014F ... at their site:
  http://www.microchip.com
or you can find it on their CD.

Good luck and have fun,
- Nick -

Mark Farver wrote:
>
> In MPASM how does one specify the contents of the user EEPROM area in the
> .asm file so that it can be programmed along with the program ROM for the
> 16x84?
>
> Mark

'help Mpasm'
1999\12\05@124046 by felix centeno

flavicon
face
part 0 844 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi, Piclisters,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>What's do the following sentence:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>addlw&nbsp; 0 - 1</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>is in assembler file and i can not understand it</FONT></DIV>
<DIV><FONT size=2><BR></FONT>&nbsp;</DIV></BODY></HTML>

</x-html>

1999\12\05@213215 by Mike Keitz

picon face
On Tue, 7 Sep 1999 10:16:30 -0400 felix centeno <@spam@fcentenospamspamIAMNET.COM>
writes:
> Hi, Piclisters,
>
> What's do the following sentence:
>
> addlw  0 - 1

This adds -1 to W.  -1 in two's complement notation is 0xFF, so you could
use "addlw h'0ff'" instead.  I've had some (I think very old) versions of
MPASM not process 'addlw -1' correctly.  So using the 0 - 1 construction
is safer.

After the instruction executes, the value in W will be 1 less than it was
before.  Consider it a "decrement W" operation.  It will also roll under
from 00 to 0xFF.  The Z flag will be set if the new value of W is zero.
The C flag will be set if the old value of W was not zero.  Or, you could
say that the C flag will be clear only if the new value of W is 0xFF.
The DC flag is also affected.




___________________________________________________________________
Why pay more to get Web access?
Try Juno for FREE -- then it's just $9.95/month if you act NOW!
Get your free software today: dl.http://www.juno.com/dynoget/tagj.

1999\12\06@030550 by Dr. Imre Bartfai

flavicon
face
Hi,

it subtracts one from the actual content of W, as the famous SUBLW
instruction does the opposite (subtracts W from literal). It is a trick
how to realize subtraction from W as normal in other processors.

I hope this helps.

Regards,
Imre


On Tue, 7 Sep 1999, felix centeno wrote:

{Quote hidden}


'Help with number notation for MPASM'
2000\02\27@183200 by John Mullan
picon face
I thought I knew how to specify numeric notation in my source, now I'm
confused :(

This is what I thought

       9       =       Single digit 0-7 don't care

       d'9'    =       Decimal notation

       b'1'    =       Binary notation

       FFh     =       Hex notation

       0xFF    =       Hex notation

I get errors using either HEX notation.

Can somebody list what exactly I should be using??

John

2000\02\27@192715 by Lee Jones

flavicon
face
> I thought I knew how to specify numeric notation in my source,
> now I'm confused :(
>
> This is what I thought
>
>         9       =       Single digit 0-7 don't care
>
>         d'9'    =       Decimal notation
>
>         b'1'    =       Binary notation
>
>         FFh     =       Hex notation
>
>         0xFF    =       Hex notation
>
> I get errors using either HEX notation.

The first hex notation needs to have a leading digit (0FFh)
so the parser can differentiate it from a symbol.  The second
variant follows the C syntax and should work.  See the sample
code in the listing -- all forms generate the same instruction.


MPASM 01.30.01 Intermediate    TEMP99.ASM   2-27-2000  16:21:04         PAGE  1


LOC  OBJECT CODE     LINE SOURCE TEXT VALUE

                   00001         list p=16c84, f=inhx8m
                   00002
0000                00003         org     0
0000 30FF           00004         movlw   0xFF
0001 30FF           00005         movlw   d'255'
0002 30FF           00006         movlw   o'377'
0003 30FF           00007         movlw   b'11111111'
0004 30FF           00008         movlw   .255
0005 30FF           00009         movlw   0FFh
                   00010         end

MPASM 01.30.01 Intermediate    TEMP99.ASM   2-27-2000  16:21:04         PAGE  2


SYMBOL TABLE
 LABEL                             VALUE

__16C84                           00000001


MEMORY USAGE MAP ('X' = Used,  '-' = Unused)

0000 : XXXXXX---------- ---------------- ---------------- ----------------
0040 : ---------------- ---------------- ---------------- ----------------

All other memory blocks unused.

Program Memory Words Used:     6
Program Memory Words Free:  1018


Errors   :     0
Warnings :     0 reported,     0 suppressed
Messages :     0 reported,     0 suppressed

                                               Lee Jones

2000\02\27@192916 by Robert Rolf

picon face
John Mullan wrote:
>
> I thought I knew how to specify numeric notation in my source, now I'm
> confused :(
>
> This is what I thought
>
>         9       =       Single digit 0-7 don't care
>
>         d'9'    =       Decimal notation
>
>         b'1'    =       Binary notation
>
>         FFh     =       Hex notation
>
>         0xFF    =       Hex notation
>
> I get errors using either HEX notation.

You need a leading 0 on your first hex, otherwise the
assembler thinks you have a label beginning with the
letter 'F'. E.G. 0FFh will work

Your second example may have a typo. You need '0' numeral not 'O'
letter. Your asm may have a broken parser and need 0x0ff.


> Can somebody list what exactly I should be using??

Look at your assemblers 'help' file for example of 'notations'.

> John

Robert

2000\02\28@174222 by John Mullan

picon face
Thanks.

In another post, Lee mentioned that the 0xFF needed a trailing 'h' to
clarify.

John


-----Original Message-----
From: pic microcontroller discussion list
[TakeThisOuTPICLISTKILLspamspam@spam@MITVMA.MIT.EDU]On Behalf Of Robert Rolf
Sent: Sunday, February 27, 2000 7:30 PM
To: .....PICLISTRemoveMEspamMITVMA.MIT.EDU
Subject: Re: Help with number notation for MPASM


John Mullan wrote:
{Quote hidden}

You need a leading 0 on your first hex, otherwise the
assembler thinks you have a label beginning with the
letter 'F'. E.G. 0FFh will work

Your second example may have a typo. You need '0' numeral not 'O'
letter. Your asm may have a broken parser and need 0x0ff.


> Can somebody list what exactly I should be using??

Look at your assemblers 'help' file for example of 'notations'.

> John

Robert

'another MPASM question'
2000\02\28@184754 by Alice Campbell

flavicon
face
Is there a way to load a file instead of a literal using a table:

for example
a_table
       movwf   pcl
       return-with-in-work  buffer1
       return-with-in-work  buffer2
       return-with-in-work  buffer3
       return-with-in-work  buffer4

thanks,
alice

2000\02\28@201554 by Jason Harper

picon face
> Is there a way to load a file instead of a literal using a table:
>
> for example
> a_table
>         movwf   pcl
>         return-with-in-work  buffer1
>         return-with-in-work  buffer2
>         return-with-in-work  buffer3
>         return-with-in-work  buffer4

There is no PIC instruction that both loads W with a register and returns.
However, you could do these with two separate instructions, doubling your
index into the table since each entry is now two words:

       movwf temp
       addwf temp,w    ; w = w * 2
       addwf pcl,f
       movf buffer1,w
       return
       movf buffer2,w
       return
       movf buffer3,w
       return
       movf buffer4,w
       return

Note that this won't work on 12-bit core PICs, which lack a plain RETURN
instruction.  Also, this is quite inefficient assuming that the various
registers that you're trying to load are in sequential addresses: that's
exactly what the FSR register is for.  Try this:

       addlw buffer1   ; w = index + address of buffer1
       movwf fsr
       movf indf,w     ; w = value at address in FSR

       Jason Harper

2000\02\28@201557 by Tony Nixon

flavicon
picon face
Alice Campbell wrote:
>
> Is there a way to load a file instead of a literal using a table:
>
> for example
> a_table
>         movwf   pcl
>         return-with-in-work  buffer1
>         return-with-in-work  buffer2
>         return-with-in-work  buffer3
>         return-with-in-work  buffer4
>
> thanks,
> alice

Maybe this....

       movf Offset,w
       call RAM_AD
       movwf fsr
       movf indirect,w
       ......

RAM_AD
       addwf pcl
       retlw RAM_AD_1
       retlw RAM_AD_2
       retlw RAM_AD_3
       retlw RAM_AD_4



--
Best regards

Tony

http://www.picnpoke.com
KILLspamsalesspamTakeThisOuTpicnpoke.com

2000\02\29@010724 by Regulus Berdin

picon face
Or if RAM_AD_X are contigous:

       movwf   fsr
       movlw   RAM_AD_1
       addwf   fsr,f
       movf    indf,w
       .
       .
       .

Best regards,
Reggie


Tony Nixon wrote:
{Quote hidden}


'another MPASM question'
2000\03\01@122340 by Alice Campbell
flavicon
face
I have tried this.  My code has sprouted bank select errors like
dandelions.  I think there is something I dont understand about the
way the memory is organized.  If I set:

       cblock 0x10
       buf1    :1
       buf2    :2
       buf3    :3
       etc             :4
       endc
and then call for the contents of buf2,
and then say:

> Or if RAM_AD_X are contigous:
>

               movlw .2                ;choose the second buffer
>         movwf   fsr
>         movlw   RAM_AD_1
               movlw   0x11
>         addwf   fsr,f
>         movf    indf,w
>

then shouldnt the contents of indf be the 2 from buf2???
all it does is yell at me about being in the wrong bank.  im still in
bank0, am i not??

alice
{Quote hidden}

2000\03\01@142559 by Alice Campbell

flavicon
face
Hi tony,

im still working on the indf question, still in confusion but it will
work out.  However, i have another, different question:

what is the rom loader discussion about?
whats a rom loader?
sorry for my ignorance, but its probably reversible.

alice

{Quote hidden}

2000\03\01@144837 by M. Adam Davis

flavicon
face
The rom loader is a method of re-programming the PIC without a programmer and in
circuit.

The newer flash chips (16f87x) have the ability to write to their own program
memory.  Other flash chips (16f84, etc) could only write to a special data
memory.

Since these newer chips can write their own program memory, then we can install
a tiny program in the chip which will act as a loader for the program.  In other
words, connect the chip to a computer and send the new program code straight
over.  No programming voltages, no special sockets, and easy to accomplish
remotely (over telephone, radio, internet, etc) so you don't have to be
physically present to re-program a chip.

Generally the setup is as follows:

A pin is set apart such that when the PIC powers up, it checks this pin.  If the
pin is in a pre-defined state (low) it starts the user program (the program
which was last stored in the chip) if the pin is in the other state (high), it
starts the bootloader code, which accepts commands to read and program the user
program area of the chip.  Once programming is complete the bootloader either
resets the chip, or starts the user program.  One could also provide options
inside the user program which will call the bootloader so you don't have to be
at the hardware setting/clearing pins.

An example of where this might be useful:
Datalogging equipment.  Instead of having a chip which has set functions (which
really means set limitations) you can use, you can reprogram the entire chip to
do some data processing as well as logging.  You could update the program as
your research continues and you discover that your data isn't complete, and you
need to change some parameters remotely.

Home automation, process control industry, anywhere where functionality might
need to be upgraded.

Rapid prototyping, making devices which need to be deployed yesterday with a few
basic functions, but need to provide more complex functions ASAP.  (or following
software company models of releasing buggy product, and sending out service
packs, er, I mean software upgrades... ;-)

Development environments.  I'm doing home automation right now, but I realize
that I want to change the program as I go.  I don't want to uninstall and
reprogram my lightswitches everytime I change the program, so I make my bootload
operate with a basic network protocol.  When the next big thing comes along
(CAN, LON, etc) (as long as I plan my hardware ahead of time) I can reprogram
all of my nodes to use and interface with the new protocol.

-Adam

Alice Campbell wrote:
> what is the rom loader discussion about?
> whats a rom loader?
> sorry for my ignorance, but its probably reversible.
>
> alice

2000\03\01@171004 by Tony Nixon

flavicon
picon face
Alice Campbell wrote:
>
> I have tried this.  My code has sprouted bank select errors like
> dandelions.  I think there is something I dont understand about the
> way the memory is organized.  If I set:
>
>         cblock 0x10
>         buf1    :1
>         buf2    :2
>         buf3    :3
>         etc             :4
>         endc


I haven't tried this but

cblock 0x10    ; check address >= lowest ram location for chosen chip.
 buffer: X    ; X = number of bytes needed for buffer
endc


To access buffer through indirect addressing
Eg.
10 bytes in buffer block starting at RAM address 0x10
Offset can vary from 0 to 9

       movf offset,w   ; W = 0 - 9
       addlw buffer    ; W = 0x10 + (0 - 9)
       movwf fsr       ; set indirect address
       movf indf,w     ; W = data from buffer



M. Adam Davis gave a pretty good description of a boot loader.

Learning changes ignorance to knowledge. No appologies needed :-)

I hope this helps.


--
Best regards

Tony

http://www.picnpoke.com
spamBeGonesalesspamRemoveMEpicnpoke.com


'Elementary MPASM's bug !'
2000\04\11@004745 by Yves Chamberland
picon face
part 0 16 bytes
</x-html>

'elementary MPASM bug1'
2000\04\11@030803 by Yves Chamberland

picon face
part 0 16 bytes
</x-html>

'Elementary MPASM's bug !'
2000\04\11@051258 by Martin SchŠfer

flavicon
face
part 0 7942 bytes content-type:application/octet-stream;
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>The
problem is that the include path is not for including files, but
only</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>for
looking if the secified include file is up to date. If a source code
file</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>is
dependent on any include file, it has to be rebuild if the include
changes.</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>But
even this is not correctly working. If your includes are in another
path</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000>as&nbsp;the source you have to include the full path
name </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000>&nbsp;&nbsp;&nbsp; include
&lt;e:\software\myincludes\header.inc&gt;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>This
is nessecary because the include path setting doesnt work for
including</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000>files.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>But
now the dependency checking isnt working neither. It seems</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>that
the dep. check is only active, if you dont specify the full
path.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>So for
ex. this is working:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000>&nbsp;&nbsp; include
&lt;..\functions\includes\header.inc&gt;</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>It
will include the file and make a correct dependency check. But this is
only</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>a
workaround, because you dont want to specify your includes relative
to</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>the
project directory.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=764140109-11042000>We
are&nbsp;waiting for an update of MPLAB in the near future
:-)</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=764140109-11042000>Martin&nbsp;</SPAN></FONT></DIV><BR>
<P><FONT face=MONOTYPE.COM
size=1>;**********************************************</FONT> <BR><FONT
face=MONOTYPE.COM size=1>;**&nbsp;&nbsp; name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Martin
Schaefer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
**</FONT> <BR><FONT face=MONOTYPE.COM size=1>;**&nbsp;&nbsp;
company:&nbsp;&nbsp; elektronik 21 GmbH, Germany **</FONT> <BR><FONT
face=MONOTYPE.COM size=1>;**&nbsp;&nbsp; e-mail:&nbsp;&nbsp;&nbsp;
.....schaeferEraseMEspamelektronik21.de&nbsp;&nbsp;&nbsp; **</FONT> <BR><FONT face=MONOTYPE.COM
size=1>;**********************************************</FONT> </P>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
 <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma
 size=2>{Original Message removed}

'elementary MPASM bug1'
2000\04\11@234557 by Yves Chamberland

picon face
part 0 16 bytes
</x-html>

'PAGESEL problem with MPASM (16C74)'
2000\04\17@130119 by Martin SchŠfer

flavicon
face
Hello,

my problem is that I'm not understanding what the assembler is doing in my
little code. I try to call my init routine on page 1 (0x800). But the
PAGESEL directive is not correctly assembled. Anybody who knows this problem
? What am I doing wrong ?

================file.asm =====================
RESET CODE
       goto    Start

PAGE0 CODE
Start
           PAGESEL    Hardware_Init
           call               Hardware_Init
Loop    goto            Loop

================file.lst=======================
                                       RESET CODE
000000   2808     GOTO      0x8                             goto
Start

                                       PAGE0 CODE
                                       Start
000008   3008     MOVLW     0x8                        PAGESEL
Hardware_Init
000009   0000     NOP                                           call
Hardware_Init
00000a   280a     GOTO        0xa            Loop       goto    Loop

Thank you

Martin

;**********************************************
;**   name:      Martin Schaefer             **
;**   company:   elektronik 21 GmbH, Germany **
;**   e-mail:    spamschaeferspam_OUTspam@spam@elektronik21.de    **
;**********************************************

2000\04\18@102230 by KŸbek Tony

flavicon
face
Hi,

>my problem is that I'm not understanding what the assembler is doing in
my
>little code. I try to call my init routine on page 1 (0x800). But the
>PAGESEL directive is not correctly assembled. Anybody who knows this
problem
>? What am I doing wrong ?

not really sure what You are upto, but im guessing you want this:

================file.asm =====================
RESET CODE
----->  PAGESEL Start  <---------- sets to page where start is located
!!!
       goto    Start

PAGE0 CODE
Start
----->     ;  PAGESEL    Hardware_Init; remove, redundant, on same page
!!!!
           call               Hardware_Init
Loop    goto            Loop



So you will have:


================file.asm =====================
RESET CODE
         PAGESEL       Start  
       goto    Start

PAGE0 CODE
Start
           call               Hardware_Init
Loop    goto            Loop




Then it should work,

/Tony

Tony KŸbek, Flintab AB            
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ
E-mail: spamtony.kubek@spam@spamSTOPspamflintab.com
ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓ

'Is CCS C compiler able to generate .ASM file MPASM'
2000\04\21@024039 by hanjay chen

picon face
<x-flowed>Hi! Everyone,
   is CCS C compiler able to generate .ASM file for MPASM?  i am trying to
learn both language at the same time. if it generates .ASM file i can use
MPLAB to step over the codes and simulate the program.

Thanks for the help!


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

</x-flowed>


'[PIC]: MPASM-question'
2000\07\05@164117 by H.P. de Vries
flavicon
face
Hi all, I was wondering, is it possible in MPLAB to do something like :

IORDY   EQU     portb,3

, eg. define a portbit for use in let's say

       BTFSC   IORDY
       CALL    DO_IO_STUFF

Hans

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\05@170127 by Francisco Armenta

flavicon
face
Hans

use

#DEFINE IORDY PORTB,3

Francisco Armenta

"H.P. de Vries" wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\05@174145 by Andre Abelian

picon face
Hans,

no you can't use  EQU like that but you can use DEFINE instead

#DEFINE    IORDY        PORTB,3

Andre Abelian






{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\07\05@195534 by Bob Ammerman

picon face
Yep: only don't use 'EQU'. Use #define instead:

#define     IORDY    portb,3

Bob Ammerman
RAm Systems
(high performance, high function, low-level software)

{Original Message removed}


'[PICLIST] [PIC] MPASM, PCL and interrupts!'
2000\09\02@064235 by Paul Reilly
picon face
Hi all,

Thanks to everyone who answered my questions about what to do with
unused ports. I've tied them low and set them as inputs as suggested.

I've run in to another weird problem with my project which I'm porting
from the 'F84 to the 'F877. The fact that it happens again has made me
quite suspicious of my code. I obviously don't fully understand the PCL
and interrupts too well :(

I'm using the PIC as a sidereal timer and it's interfaced to a keypad
(soon) and an 2x16 Hitachi type LCD. The various LCD lines of text are
defined with dt" " type macro's which are shown below. The problem is, if
I make a call to the fourth or subsequent lines, ie "st_text" or
"message3" the device causes an interrupt. Even though I've disabled
interrupts! On the 'F84 I thought the fourth message text might have
crossed some bank boundary, but this can't be. On the F877 all my code
fits easily within the first program memory bank.

Here's the code:

               clrf    char_count      ; char_count=0
loop            movf    char_count,w    ; char_count --> W
               call    message1        ; get ASCII value in W
               iorlw   D'0'            ; is that ascii value = 00 (NUL)
               btfsc   STATUS, Z       ; if so, ==> end of string
               goto    nextline        ;        ==> nextline!
               call    send_ascii      ; else display char in W
               incf    char_count,1    ; char_count = char_count + 1
               goto    loop            ; next char...

nextline        etc etc etc

message1
               addwf PCL, f
               dt "   STARTIMER!   ",0
message2
               addwf PCL, f    ;
               dt " by Paul Reilly ",0
text_ut
               addwf PCL, f
               dt " UT  --:--:--   ",0
st_text
               addwf PCL, f
               dt " ST  --:--:--   ",0



I figure it has to do with the PCL. On some sample code I have I often see
a "sethi" routine of

sethi           addwf PCL,f
               dt H'A',H'6',H'A',H'6',H'A',H'A'

and I figure maybe this has something to do with it. What does sethi do?
The example programs never seem to call it. It's just there. And what do
the numbers mean (which differ from example to example!) ?

And lastly in MPASM, can anyone tell me what the RETDATA function
is equivallent to in assembly. Or what the . means, as in:

ADDLW   .32

I presume it indicates a decimal?

Sorry for all the newbie questions! I really do appreciate all the help
that you guys have given me so far :)

Paul

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spamBeGonelistservspamBeGonespam@spam@mitvma.mit.edu?body=SET%20PICList%20DIGEST>

2000\09\02@065721 by Scott Dattalo

face
flavicon
face
On Sat, 2 Sep 2000, Paul Reilly wrote:
<snip>

Paul,

Look at your .LST output. You're most certainly passing across the 256 byte
boundary in your table look up and wrapping around to address 4+x into your
interrupt routine. Olin provided a convenient table look up routine the other
day, but here's another analogous to yours that doesn't suffer from the 256 byte
PCL limitation.

BTW, the package from which this comes is available:

http://www.dattalo.com/gnupic/lcd-0.1.1.tar.gz

This package in cooperation printed this output to a virtual LCD:
http://www.dattalo.com/gnupic/t.gif
Also, you may want to take a peak at:
http://www.dattalo.com/gnupic/lcd.html


But of immediate interest is the string routine. Notice how the offset into the
table is a 16-bit addition. (Also watchout for the comments that wrap around -
you'll probably need to clean the comments up before you attempt to compile the
code.)

;*******************************************************************
;write_string
;
;  The purpose of this routine is to display a string on the LCD module.
;On entry, W contains the string number to be displayed. The current cursor
;location is the destination of the output.
;
; Memory used
;    buffer2, buffer3
; Calls
;    LCD_WRITE_DATA
; Inputs
;    W = String Number
;
write_string
       clrf    buffer2                 ;Used as an index into the string table
       andlw   WS_TABLE_MASK           ;Make sure the string is in range
       call    ws2                     ;First call is to get string offset in
table
       movwf   buffer2

ws1:    movf    buffer2,w
       call    ws2
       andlw   0xff
       skpnz                           ;If the returned byte is zero, we've
reached the end
        return
       call    LCD_WRITE_DATA
       incf    buffer2, F              ;Point to the next character in the
string
       goto    ws1


ws2
       addlw   LOW(ws_table)
       movwf   buffer3                 ;Save a copy of which string we're to
write
       movlw   HIGH(ws_table)
       skpnc
        movlw  HIGH(ws_table)+1

       movwf   PCLATH
       movf    buffer3,w
       movwf   PCL

#define WS_TABLE_MASK  1   ; This should equal 2^number of strings
ws_table:
       retlw   string0-ws_table
       retlw   string1-ws_table


string0:        dt      "GPSIM WROTE THIS",0
string1:        dt      "A STRING ON ROW 2",0



Scott

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use RemoveMElistservRemoveMEspamRemoveMEmitvma.mit.edu?body=SET%20PICList%20DIGEST>

2000\09\02@083711 by Paul Reilly

picon face
Okay - I figured it out!
I was only using PCL and 8 bit computed goto's when I should have been
using 13 bit addresses! Doh!

Paul

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use listservKILLspamspamspammitvma.mit.edu?body=SET%20PICList%20DIGEST>

2000\09\02@102625 by Dan Michaels

flavicon
face
Paul Reilly wrote:
>
>Thanks to everyone who answered my questions about what to do with
>unused ports. I've tied them low and set them as inputs as suggested.
>

The one thing you want to be careful of, when using this technique,
is best to tie inputs via resistors, rather than hard-wiring
- in case your s.w. "accidentally" configures them to outputs
sometime down the road. If unwilling to use the extra components,
then probably better to leave the pins open and configure as
outputs from the start - as BobA said.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spam_OUTlistserv@spam@spammitvma.mit.edu?body=SET%20PICList%20DIGEST>

'[PIC]: How to use MPASM generated "cod" files with'
2000\09\14@061209 by Wojtek Zabolotny

flavicon
picon face
Hi All,

Because of the bug in macro implementation in GPASM (discussed in the
"Global symbols in macros don't work in gpasm?" thread), I had to use MPASM
last time. However the debbugging facilities of MPLAB simulator are very
poor, and I really had to do the job in GPSIM (USART & SPI simulation).
MPASM (DOS version) runs smoothly under DOSEMU in Linux, so there is no
problem with using MPASM & GPSIM together, however one problem exists:
GPSIM does not accept the MPASM generated "cod" files. As I've found in the
GPSIM's documentation the reason is the inclusion of OS dependent filenames
in the cod file. I've checked it and this is what I found:

To make the MPASM generated cod files you need:
1. Change the processor name to one accepted by GPSIM
  (in my case I had to change "16F877" to "16f877")
2. Change all the filenames from the DOS versions into their UNIX
  equivalents.
  Eg. I have my sources in "~/dos/pic2" directory which is "F:\PIC2" under
  DOSEMU.
  If my source is "F:\PIC2\PICTEST1.ASM" and it uses the
  include file "F:\PIC2\P16F877.INC", then I change this strings
  to "pictest1.asm" and "p16f877.inc" (however I have to start the gpsim
  in the "~/dos/pic2" directory.

One more remark about the string format in "cod" files. I have stated that
the strings in "cod" files are written in following form:
length_of_string (1 byte)
string_itself (array of bytes)
zero_padding (array of zero bytes)
I've stated, that it is safe to change the strings, when changing the length
byte respectively, and padding the new string with zeros.
Up to now I did it just with Midnight Commander (F3 to view -> F2 to edit ->
repeatedly F2 to switch hex/text edit -> F6 to save), but I'm
considering to write a simple C program or Perl script to make it
automatically (making chnages "by hand" after each compilation is rather
boring & tiring).
--
                       HTH & Greetings
                     Wojciech M. Zabolotny
       http://www.ise.pw.edu.pl/~wzab  <--> TakeThisOuTwzabspam_OUTspamise.pw.edu.pl

http://www.freedos.org  Free DOS for free people!

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\14@082739 by Scott Dattalo

face
flavicon
face
On Thu, 14 Sep 2000, Wojtek Zabolotny wrote:

{Quote hidden}

What a coincidence! In the GPL spirit of things, Daniel Christian needed the
same feature (supporting MPLAB generated .cod files in gpsim), so he sent a
patch that supposedly does it for him. I haven't personally tested it since I
don't have any MPLAB formatted .cod files lying around on /dev/sda. But I've
checked his changes into CVS and could make a tar ball if you want.


Scott

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\14@094820 by wzab

flavicon
picon face
On Thu, Sep 14, 2000 at 07:29:11AM -0500, Scott Dattalo wrote:
>
> What a coincidence! In the GPL spirit of things, Daniel Christian needed the
> same feature (supporting MPLAB generated .cod files in gpsim), so he sent a
> patch that supposedly does it for him. I haven't personally tested it since I
> don't have any MPLAB formatted .cod files lying around on /dev/sda. But I've
> checked his changes into CVS and could make a tar ball if you want.
>
I'd be glad to receive the patches (or the new sources). BTW I'm very
interested how does he solve the problem of mapping DOS dirs <-> Unix dirs?
My idea was to give in the command line of the script something
like this:
./script -d "F:\PIC2" -u "~/dos/pic2" file.cod

--
                              Thanks & Greetings
                             Wojciech M. Zabolotny

       http://www.ise.pw.edu.pl/~wzab  <--> KILLspamwzab.....spamTakeThisOuTise.pw.edu.pl

http://www.freedos.org  Free DOS for free people!

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


'[PIC]: SOLUTION: How to use MPASM generated "cod" '
2000\09\14@174902 by Wojtek Zabolotny

flavicon
picon face
part 1 1504 bytes content-type:text/plain; charset=us-asciiOn Thu, Sep 14, 2000 at 11:57:27AM +0200, Wojtek Zabolotny wrote:
> Up to now I did it just with Midnight Commander (F3 to view -> F2 to edit ->
> repeatedly F2 to switch hex/text edit -> F6 to save), but I'm
> considering to write a simple C program or Perl script to make it
> automatically (making chnages "by hand" after each compilation is rather
> boring & tiring).

Well, so this is the C program for automatic modification of DOS-MPASM
generated COD file, so that it can be used by the GPSIM.
I attached the gzipped (to spare the bandwidth) C sources to this message.

There are however some conditions, which must be met:
1. All sources and include files must be in the same directory (and the
  gpsim must be later called from that directory)
2. All sources and include files must be in lower case.

This solution allows for assembling of files with the DOS-MPASM (ran under
DOSEMU) and simulating of programs with GPSIM.

The source requires the "cod.h" included in GPSIM sources.
The program should be compiled with
gcc -o codmpasm codmpasm.c
And run with
codmpasm filename.cod

WARNING! The program modifies the cod file with name given as it's argument.
The original contents gets destroyed.
--
                       HTH & Greetings
                       Wojciech Zabolotny
                       http://www.ise.pw.edu.pl/~wzab

When buying any hardware, ask the dealer if it is Open Source friendly!!!
http://www.openhardware.org


part 2 1580 bytes content-type:application/octet-stream (decode)

part 3 184 bytes
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\15@113736 by Scott Dattalo

face
flavicon
face
On Thu, 14 Sep 2000, Wojtek Zabolotny wrote:

> On Thu, Sep 14, 2000 at 11:57:27AM +0200, Wojtek Zabolotny wrote:
> > Up to now I did it just with Midnight Commander (F3 to view -> F2 to edit ->
> > repeatedly F2 to switch hex/text edit -> F6 to save), but I'm
> > considering to write a simple C program or Perl script to make it
> > automatically (making chnages "by hand" after each compilation is rather
> > boring & tiring).
>
> Well, so this is the C program for automatic modification of DOS-MPASM
> generated COD file, so that it can be used by the GPSIM.
> I attached the gzipped (to spare the bandwidth) C sources to this message.

I'll try to package this with gpsim in the next major release. Perhaps I'll
create a `utils' subdirectory and place it there.

BTW, I've place the latest copy of gpsim on the web:

http://www.dattalo.com/gnupic/gpsim-0.20.4.tar.gz

This includes Daniel Christian's patch for reading MPLAB formatted .cod files.
So you may wish to play with it to see how it compares to the utility you've
created.


In addition, this version of gpsim has the ability to log the trace buffer to a
file. As I said on the gnupic list (this is cc'd to the PICLIST), this creates
enormous files (e.g. 70Megs in a few seconds!). Needless to say, the feature is
currently inhibited.

Scott

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


'[PIC]: How to use MPASM generated "cod" files with'
2000\09\15@140939 by Peter L. Peres

picon face
>use cod files with gpsim

MPASM can generate object files in any format you want, including INHX16
and INHX32. Use a LIST F=... directive in your source to do that. I have
gpsim but I did not get around to check it out so I don't know what file
formats it will take. I have standardized all my pic tools to INHX16 since
1996 or so.

hope it helps,

Peter

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


2000\09\15@142740 by Scott Dattalo

face
flavicon
face
On Fri, 15 Sep 2000, Peter L. Peres wrote:

> >use cod files with gpsim
>
> MPASM can generate object files in any format you want, including INHX16
> and INHX32. Use a LIST F=... directive in your source to do that. I have
> gpsim but I did not get around to check it out so I don't know what file
> formats it will take. I have standardized all my pic tools to INHX16 since
> 1996 or so.

But the symbolic information in .cod files makes debugging SO much easier.

Scott

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


2000\09\15@172505 by Olin Lathrop

flavicon
face
> MPASM can generate object files in any format you want, including INHX16
> and INHX32. ...

No, MPASM uses some sort of private format for object files that are
definitely not HEX files.  HEX files were originally intended for prom
programmer use, so they only contain address and data information.  Object
files need to contain relocatable and other linker input information.  Try
looking at a .O file with notepad or something.  It's not even a text file.
MPASM only creates HEX files when producing absolute code.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, TakeThisOuTolinEraseMEspamRemoveMEcognivis.com, http://www.cognivis.com

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


2000\09\16@085558 by Peter L. Peres

picon face
>But the symbolic information in .cod files makes debugging SO much easier.

In 1996 MPASM did not generate CODs so I had to parse the listing file for
my 16C54 debugger/simulator ;-) Also the Microchip simulator crashed my
system regularly for some reason so I could not use that. I still don't
know where the problem was/is.

Peter

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


'[PIC]: custom mpasm mnemonics'
2000\09\20@113115 by staff

flavicon
face
Roman wrote:
>
> I especially like the skpz, skpnz, tstf etc. These are great and
> really make the code easy to read. If there was one tip I had to
> give to a pic newbie it would be to get used to using these
> special mnemonics.
>
> Does anyone have home-made instructions they like to use?
>
> I quite like:
>
> incw
> decw
> setbank0
> setbank1


Am I the only person here who uses custom instructions?
Nobody has a comw or incw in their code??

Curious. :o)

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


2000\09\20@124850 by Sam Linder

flavicon
face
Roman:
<snip>
Sam, the skpc, skpnc etc are official Microchip mnemonics that
simply equate to the ridiculous "btfsc STATUS,C" stuff that
mightmares are made of. You actually prefer that??
<snip>

I agree that the Microchip mnemonics are the "stuff that nightmares are made
of." Do I prefer them? No.

<snip>
The incw and decw are my custom ones... I find it hard
to believe that you would have difficulty interpreting my
"incw" instruction... :o)
<snip>

It isn't so much a case of interpreting your custom mnemonics, it's a case
of trying to learn everyone's custom mnemonics. If everyone created a
different custom instruction for a basic Microchip mnemonic, I'd go nuts
trying to remember all the variations.

It's somewhat akin to what happened with Unix. By making the source of their
utility programs available for modification, everyone and their brother
created variations on a theme. So, anytime you went to a different Unix
shop, you would encounter similar utilities under a wide range of names.
(Any Unix folks who take umbrage to this, please don't respond, I've been
down that road too many times)

Since you correctly pointed out that "skpc, skpnc etc are official Microchip
mnemonics", I can't argue that those would be acceptable in a PIC assembly
language program. However, as I discovered, not all compilers accept them as
such. For example, Hi-Tech C does not recognize the special instruction
mnemonics, thus I must always use the basic Microchip instruction set.

       Sam....



{Original Message removed}

2000\09\20@131827 by staff

flavicon
face
Sam Linder wrote:
{Quote hidden}

I really do respect your personal preferences Sam, I just find it
amazing that someone prefers "btfss STATUS,z" to skpz...

Anyone else care to comment? Or does this remain a black/white
argument? Surely the point of good programming practices is to
make the code easier to read, and less errors in the interpretation
of the code by another person. And of course make it easier to
type it in!

To my way of thinking the skpz etc mnemonics are far superior to
the btfss STATUS,z equivalent and my personal preference to use
custom mnemonics like incw is superior to addlw 0x01??

Comments?

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


2000\09\21@084333 by Olin Lathrop

flavicon
face
> > SKIP_WLE  ;skip if W less than or equal from last SUBLW or SUBWF
> > SKIP_WGT  ;skip if W greater than ...
>
> I really like those skip_wle and skip_wgt mnemonics! Thanks,
> will make good use of those in the future! Does anyone else
> have any other good ones?

Since you plan on using them, I have included the source code below to save
you the trouble of re-creating them.

;
;********************
;
;   Macro SKIP_WLE
;
;   Skip the next instruction if W was less than or equal to the value
;   it was subtracted from.  This assumes that the carry flag has been
;   preserved from the last SUBWF or SUBLW instruction.
;
skip_wle macro
 if fam_17
        btfss   alusta, c
        exitm
   endif

        btfss   status, c   ;skip if no borrow occurred
        endm
;
;********************
;
;   Macro SKIP_WGT
;
;   Skip the next instruction if W was greater than the value
;   it was subtracted from.  This assumes that the carry flag has been
;   preserved from the last SUBWF or SUBLW instruction.
;
skip_wgt macro
 if fam_17
        btfsc   alusta, c
        exitm
   endif

        btfsc   status, c   ;skip if a borrow occurred
        endm
;
;********************
;
;   Macro SKIP_Z
;
;   Skip the next instruction if the zero flag is set.
;
skip_z   macro
 if fam_17
        btfss   alusta, z
        exitm
   endif

        btfss   status, z
        endm
;
;********************
;
;   Macro SKIP_NZ
;
;   Skip the next instruction if the zero flag is not set.
;
skip_nz  macro
 if fam_17
        btfsc   alusta, z
        exitm
   endif

        btfsc   status, z
        endm
;
;********************
;
;   Macro SKIP_CARR
;
;   Skip the next instruction if a carry occurred.
;
skip_carr macro
 if fam_17
        btfss   alusta, c
        exitm
   endif

        btfss   status, c
        endm
;
;********************
;
;   Macro SKIP_NCARR
;
;   Skip the next instruction if no carry occurred.
;
skip_ncarr macro
 if fam_17
        btfsc   alusta, c
        exitm
   endif

        btfsc   status, c
        endm
;
;********************
;
;   Macro SKIP_BORR
;
;   Skip the next instruction if a borrow occurred.
;
skip_borr macro
 if fam_17
        btfsc   alusta, c
        exitm
   endif

        btfsc   status, c
        endm
;
;********************
;
;   Macro SKIP_NBORR
;
;   Skip the next instruction if no borrow occurred.
;
skip_nborr macro
 if fam_17
        btfss   alusta, c
        exitm
   endif

        btfss   status, c
        endm
;
;********************
;
;   Macro INTR_OFF
;
;   Globally disable interrupts without changing which interrupts are
;   individually disabled.  This macro together with INTR_ON can be used
;   around small sections of code that need to run with interrupts off.
;
intr_off macro
 if fam_16
        bcf     intcon, gie
   endif
 if fam_17
        bsf     cpusta, glintd
   endif
        endm
;
;********************
;
;   Macro INTR_ON
;
;   Globally enable interrupts without changing which interrupts are
;   individually enabled.  This macro together with INTR_OFF can be used
;   around small sections of code that need to run with interrupts off.
;
intr_on  macro
 if fam_16
        bsf     intcon, gie
   endif
 if fam_17
        bcf     cpusta, glintd
   endif
        endm



*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spam_OUTolinRemoveMEspam.....cognivis.com, http://www.cognivis.com

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


2000\09\21@132137 by staff

flavicon
face
Thank you Olin! You are a true gentleman.
:o)
Roman



Olin Lathrop wrote:
{Quote hidden}

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


2000\09\22@045318 by Simon Nield

flavicon
face
having recently looked through Thomas McGahee's PICUART code (thankyou whoever it was who posted the
URL btw)
I think the interrupt off macro may be improved as follows:


WAS:
> intr_off macro
>   if fam_16
>          bcf     intcon, gie
>     endif
>   if fam_17
>          bsf     cpusta, glintd
>     endif
>          endm


BETTER?:
intr_off macro
  if fam_16
foo:
         bcf     intcon, gie
         btfsc   intcon, gie
         goto    foo
    endif
  if fam_17
bar:
         bsf     cpusta, glintd
         btfss   cpusta, glintd
         goto    bar
    endif
         endm


the _16 code certainly makes sense to me. no idea about th _17 code as I have not used this family


cut & paste of the reasoning behind the code from Thomas' code:
;If an IRQ happens when the "bcf intcon,gie" line is executing,
;the GIE bit will be cleared, but the interrupt will still occur.
;If the interrupt routine has a RETFIE instruction at the
;end, (which is the usual state of affairs),then GIE will
;be set to 1 again.


Regards,
Simon

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spamlistservspam_OUTspammitvma.mit.edu?body=SET%20PICList%20DIGEST


2000\09\22@094400 by Olin Lathrop

flavicon
face
{Quote hidden}

I was the one who posted the original macro.  Is this true!?  Can an
interrupt really happen immediately after the instruction that disables
interrupts?  This seems hard to believe.  I've never seen any mention of
this issue in the Microchip docs, and yes, I DO read the manual.  If this
were really true I would expect at least a one of those gray boxes
mentioning this issue.

I just re-read the interrupt section of the 16F87x and 17C7xx data sheets
and didn't see any mention of this issue.  Both mentioned a possible
interrupt latency of up to 2 or 3 cycles from external conditions, but I am
assuming the interrupt still can't take place if they are globally disabled.
Someone from Microchip please confirm/deny this?

By the way, if you are going to put labels in a macro like this, you really
should declare them LOCAL.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, STOPspamolinspam_OUTspamspamBeGonecognivis.com, http://www.cognivis.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use spam_OUTlistservspamspamBeGonemitvma.mit.edu?body=SET%20PICList%20DIGEST


2000\09\22@100243 by Alan B. Pearce

face picon face
>I was the one who posted the original macro.  Is this true!?  Can an
>interrupt really happen immediately after the instruction that disables
>interrupts?  This seems hard to believe.  I've never seen any mention of

Apparently yes. I have not experienced it, but have seen code with this sort of construct in it. The scenario seems to be that the interrupt occurrence is tested separately during the execution of the disable instruction, without the enable flag being checked immediately at the end of the instruction. This can occur because the instruction is a general purpose one which could be setting or clearing any bit anywhere in the chip, and hence cannot lockout testing of the interrupt line during its execution. Hence there could be a leap off to the interrupt routine before executing the next instruction.

On processors that have a specific instruction to disable interrupts, it would be possible in the decoding of the instruction to not test the interrupt line, and hence not require this jiggery pokery operation to ensure the  interrupts are disabled when you believe they are.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use EraseMElistservspamKILLspammitvma.mit.edu?bodyT%20PICList%20DIGEST


2000\09\22@182028 by Olin Lathrop

flavicon
face
>>
>I was the one who posted the original macro.  Is this true!?  Can an
>interrupt really happen immediately after the instruction that disables
>interrupts?  This seems hard to believe.  I've never seen any mention of

Apparently yes. I have not experienced it, but have seen code with this sort
of construct in it. ...
<<

Hmm.  I'm trying to separate true fact from urban legend?  Does anyone have
proof one way or the other regading this behaviour?

Microchip, are you out there?


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, EraseMEolinRemoveMEspamcognivis.com, http://www.cognivis.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
use .....listservspamspam_OUTmitvma.mit.edu?body=SET%20PICList%20DIGEST


'[PIC]: Interrupt disable macro (was custom mpasm m'
2000\09\22@215436 by Bob Ammerman

picon face
There was a long discussion on this topic on the PICBOARD over at uChip.

Apparently this was a bug in at least some versions of some PICs and was so
documented in the datasheet.
One poster there insisted, rather strongly, that the problem continues in
current chips. No one was able to convincinly refute him.

I think it is _most_ likely that this has been fixed for a long time now,
but I'd sure like some indication from uChip that it has!

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)



One poster insisted that this problem
{Original Message removed}

'[PIC]: custom mpasm mnemonics'
2000\09\24@161429 by John

flavicon
face
Hello PIC.ers,

A subtle gotcha, this one.
BTDT, got the T-shirt.

After disabling interrupts i.e.
   bcf    intcon,gie
complete safety is not assured unless you check the global enable
bit to see that it *really* is as expected (clear, that is).

My trouble with this magically vanished when I started to use macros
for int. enable/disable:


int_off         MACRO                ;disables all interrupts
                    bcf intcon,gie
                    btfsc intcon,gie  ;make sure bit cleared (int could
                                                  ;have occurred 1/2way
thru instruction)
                    goto $-2
          ENDM

int_on         MACRO               ;re-enable interrupts
                    bsf intcon,gie
          ENDM

best regards,   John


{Quote hidden}

e-mail from the desk of John Sanderson, JS Controls.
Snailmail:          PO Box 1887, Boksburg 1460, Rep. of South Africa.
Tel/fax:            Johannesburg  893 4154
Cellphone no:   082 469 0446
email:                jsandTakeThisOuTspamKILLspampixie.co.za
Manufacturer & purveyor of laboratory force testing apparatus, and related
products and services.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\24@211826 by Tony Nixon

flavicon
picon face
Olin Lathrop wrote:
>
> >>
> >I was the one who posted the original macro.  Is this true!?  Can an
> >interrupt really happen immediately after the instruction that disables
> >interrupts?  This seems hard to believe.  I've never seen any mention of
>
> Apparently yes. I have not experienced it, but have seen code with this sort
> of construct in it. ...
> <<
>
> Hmm.  I'm trying to separate true fact from urban legend?  Does anyone have
> proof one way or the other regading this behaviour?
>
> Microchip, are you out there?

It doen't matter in this code using MPLAB

That suggests that the bcf INTCON,GIE kills the IRQ even if TMR0
overflows on that instruction. External IRQ's may have a different
mechanism.

To check it, I dumped the code into ROMzap and it worked the same.

I still remember reading something about it however, but it may be
because of externally genertaed interrupts.

       org 0h

       goto start

       org 4h

       bcf INTCON,T0IF
       retfie

start   bsf STATUS,RP0
       clrf OPTION_REG
       bcf STATUS,RP0

       clrf TMR0
       bcf INTCON,T0IF
       bsf INTCON,T0IE
       bsf INTCON,GIE

       movlw 0xA8
       movwf temp
loop    decfsz temp
       goto loop

       nop
       nop
       nop
       nop
       nop

; this NOP EXcluded, TMR0 IRQ fires on bcf INTCON,GIE
; this NOP INcluded, TMR0 IRQ fires on NOP

;       nop
       bcf INTCON,GIE
       goto loop


--
Best regards

Tony

ICmicro's
http://www.picnpoke.com
RemoveMEsalesTakeThisOuTspampicnpoke.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\09\25@003536 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

Just had a quick look and I can not find any reference to this in the 16F87X
data sheets.  However, this was a known problem with the 16C6X and 16C7X
devices.  The datasheet says:
"If an interrupt occurs while the Global Interrupt Enable (GIE) bit isbeing
cleared, the GIE bit may unintentionaly be re-enabled by the users Interrupt
Service Routine (the RETFIE instruction)."
It then goes on to describe the work around which is as per the macro's
above.

Perhaps this has been fixed in later silicon?

Mike

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


'[PICLIST] MPASM-LCALLk and LGOTOk'
2000\09\26@022145 by Keishiro Tabe

flavicon
face
Hi, all.


I have a question about 14bit core instruction set in MPASM.
Each instruction are so useful to write a code for some assembler users.
But I could not found a knowledge of two special instructions, LCALLk
and LGOTOk. They are not illustrated the detail information in Microchip
web site or other knowledge bases.

I want to know them, what mean, how to use, and so on.
Can anybody answer my question?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Shuji Hashimoto Laboratory.
     Waseda.Univ.Dept.of.Applied Physics.

  Keishiro Tabe spam_OUTtabspamspam.....shalab.phys.waseda.ac.jp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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



'[PIC]: MPASM and MESSG with assembler symbol'
2000\11\02@150352 by Tom Crane
flavicon
face
Dear All,
       I want to do something like the following in MPASM,

-----------------------------------------------------------------
; Some assembler code follows
MY_SYMBOL       equ     .42

       MESSG   "Assembled with MY_SYMBOL=", MY_SYMBOL

       movlw   MY_SYMBOL
       ..... < more code follows >
       END
-----------------------------------------------------------------

and have something like the following appear in the .err / .lst file

MESSAGE: (Assembled with MY_SYMBOL=42)

The MESSG directive requires a text string argument and I cannot see
any MPASM commands for evaluating an assembler symbol to a text string.
Any ideas?

Thanks
Tom.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-request.....spam@spam@mitvma.mit.edu




2000\11\02@152932 by Bob Ammerman

picon face
In a macro:

#v(nn)

evaluates to the text equivalent of nn.

Don't know if this will do what you want.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

{Original Message removed}

2000\11\02@162531 by Olin Lathrop

flavicon
face
> In a macro:
>
>  #v(nn)
>
> evaluates to the text equivalent of nn.

This works outside macros too.  And yes, it can be used in MESSG directives:

n  equ  27
  messg  The magic value is #v(n).

Produces a message with the #v(n) replaced by "27".


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamBeGoneolinspamspam_OUTcognivis.com, http://www.cognivis.com

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




2000\11\03@131304 by Tom Crane

flavicon
face
> This works outside macros too.  And yes, it can be used in MESSG directives:
>
> n  equ  27
>    messg  The magic value is #v(n).
>
> Produces a message with the #v(n) replaced by "27".

That does exactly what I was after.
Thanks
Tom.

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




'[PIC]:Question on MPASM FILL command'
2000\11\08@141621 by karl

flavicon
picon face
Sorry if this is a dumb question. but please tell me how I can fill
remaining program words with "goto restart" commands fo in case the program
counter (PC) gets corrupted. In absolute code I do "FILL (goto
RESTART),H'100'-$" but I want to use relative code and MPASM complains
because it doesn't know the current address ($) at compile time.

regards
Karl Skinner (gas turbine engineer not electronics guru)

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




2000\11\09@051010 by Simon Nield

flavicon
face
Another way of acheiving your goal is to fill any spare memory with NOPs (or andlw 0xff - which
seems to be the state of erased memory... could be wrong about that though) and then put a goto to
your reset code below each block of code you have and at the end of memory.
That way any rogue jumps to blank memory end up back at the reset routine.

Hope this helps...

Simon

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





'[PIC]: mpasm vs. cvasm16 (newbie)'
2001\01\14@012215 by Aart
picon face
Hello,

I'm new to programming the pic and have two questions:

- what is the difference between the mpasm and the cvasm16 assembler?
- and which assembler is to prefer?

Thx,
Aart.

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


2001\01\14@111456 by Olin Lathrop

face picon face
> - what is the difference between the mpasm and the cvasm16 assembler?

MAPASM is the assembler provided for free and supported by Microchip.  Given
that, I see the others as irrelevant.



*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamolinKILLspamspam@spam@embedinc.com, http://www.embedinc.com

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


'[PIC]: MPASM conditional assembly'
2001\01\14@135417 by David VanHorn

flavicon
face
Is it possible to do something like this, for N cases?

;Set which codeset you'd like to generate:
;
FALSE           equ     0       ;Universal Truths
TRUE            equ     1       ;
;
;These equates ARE MUTUALLY EXCLUSIVE.
;
Case1           equ     FALSE   ;These classes of device are mutually exclusive
Case2           equ     TRUE    ;They define I/O pin assignments, and the inclusion/
Case3           equ     FALSE   ;exclusion of source modules
                               ;Set exactly ONE to true, or wierd things will happen.

 if Case1              ;Force an error in case someone sets more than one
X       equ     0       ;to true.
 else                  ;
 if Case2              ;
X       equ     1       ;
 else                  ;
 if Case3              ;
X       equ     2       ;
 endif                 ;

Two cases seems to work, but three seems to be a problem, or I'm not doing
it right..
--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

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


'[PIC]: mpasm vs. cvasm16 (newbie)'
2001\01\14@144628 by Bob Ammerman

picon face
----- Original Message -----
From: Olin Lathrop <olin_piclistspamspamTakeThisOuTEMBEDINC.COM>
To: <RemoveMEPICLISTRemoveMEspamMITVMA.MIT.EDU>
Sent: Sunday, January 14, 2001 11:02 AM
Subject: Re: [PIC]: mpasm vs. cvasm16 (newbie)


> > - what is the difference between the mpasm and the cvasm16 assembler?
>
> MAPASM is the assembler provided for free and supported by Microchip.
Given
> that, I see the others as irrelevant.
>

Unless you want to develop in an environment other than Windows.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

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


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