Searching \ for '16C74 Code Error. Help Needed!' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=16C
Search entire site for: '16C74 Code Error. Help Needed!'.

Truncated match.
PICList Thread
'16C74 Code Error. Help Needed!'
1997\01\14@130245 by Jim Johnson

flavicon
face
Hi Folks,

Being new to programming the PIC, and handed a sizable project here at work
I have run into a problem.  The previous programmer quit his job and seems
to have lost
or misplaced our databooks for the 16C74, and other various useful items I
could use the heck out of right about now!

Following is part of my code, and I am getting an 'Argument out of Range.
Lease significant bits used' error message upon building it.  I have marked
the placed
in the code the compiler points to.


list    p=16c74

#define chip_id 02

include p16cxx.inc

cblock                  0x25
rcv_byte                ; 25

endc

PORT_A          equ     PORTA
PORT_B          equ     PORTB
PORT_C          equ     PORTC
PORT_D          equ     PORTD
LED             equ     0
HYP_PWR         equ     2
CS8130_ON       equ     4
BUSY            equ     5
RESET           equ     6
D_C             equ     7
PORT_E          equ     PORTE

       org     0

       goto    start
;==========================================================
; Interrupt procedured go here, starting at 4
;==========================================================
       org     4

;==========================================================

start
       bcf     STATUS,RP0
       bcf     INTCON,7
       clrf    PORTA
       clrf    PORTB
       clrf    PORTC
       clrf    PORTD
       clrf    PORTE
       clrf    PIR1
       clrf    PIE1              <----------- Error.
       clrf    PIE2              <----------- Error.
       clrf    T1CON             <----------- Error.
       goto    initialize

Can someone tell me what it is I am doing wrong or overlooking?  Thanks in
advance!

Jim

1997\01\14@164542 by TONY NIXON 54964

flavicon
picon face
Put 'bsf status,rp0' before clrf PIR1
and 'bcf status,rp0' after clrf PIE1

These values may be defined as 8ch and 8dh in the include file at the
start of your program. The compiler will only accept 7 bit RAM
addresses so it truncates the 8th bit. This 8th bit is taken care of
when you set the rp0 bit in the status register.

Can't understand t1con giving an error unless it is defined wrong
somewhere.

Regards
Tony


Just when I thought I knew it all,
I learned that I didn't.

1997\01\14@190834 by Peter Grey

picon face
At 10:06 AM 14/01/97 -0800, you wrote:

Jim,

The data sheet for this is available at the Microchip web site. It appears
that you have not set the RP0 bit when addressing registers in bank
1(PIE1,PIE2).

Good luck,



{Quote hidden}

Peter Grey
Neosystems
Australia

1997\01\14@191420 by Jorge.Cabral

flavicon
face
Jim Johnson wrote:
{Quote hidden}

         bsf     INTCON,7
         ; switch to bank 1 of register file

>         clrf    PIE1              <----------- Error.
>         clrf    PIE2              <----------- Error.

         bcf     INTCON,7
         ; back to bank zero
         ; next line is correct
>         clrf    T1CON             <----------- Error.

>         goto    initialize

1997\01\15@014901 by Bob Fehrenbach

picon face
Jim Johnson <spam_OUTjjohnsonTakeThisOuTspamOWT.COM> wrote:
>
>Following is part of my code, and I am getting an 'Argument out of Range.
>Lease significant bits used' error message upon building it.


>        clrf    PIE1              <----------- Error.
>        clrf    PIE2              <----------- Error.
>        clrf    T1CON             <----------- Error.
>        goto    initialize

Jim,

First of all, I suggest you get some current documentation and an
up to date copy of MPASM or, better yet, MPLAB.  There will be a
more appropriate include file such as p16c74.inc.

PIE1 and PIE2 are in the upper ram page adn the page bit needs to
be set to access these two registers.  This will not, however,
suppress the warning message.  Try this:

  clrf    PIE1 ^ h'7f'
  clrf    PIE2 ^ h'7f'

Are you sure you are getting a warning on the T1CON line?  This
register is at address h'10' in the lower ram page and should not
produce an assembler warning.

--
Bob Fehrenbach    Wauwatosa, WI     .....bfehrenbKILLspamspam@spam@execpc.com

1997\01\15@020142 by fastfwd

face
flavicon
face
Bob Fehrenbach <PICLISTspamKILLspamMITVMA.MIT.EDU> wrote:

> Try this [to keep the "Address out of range" erroprs from
> appearing]:
>
> clrf    PIE1 ^ h'7f'
> clrf    PIE2 ^ h'7f'

   Not exactly, Bob... Those lines should either be:

       clrf    PIE1 & h'7f'
       clrf    PIE2 & h'7f'

   or (my preference):

       clrf    PIE1 ^ h'80'
       clrf    PIE2 ^ h'80'

   -Andy

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

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