PDA

View Full Version : Warning and Message



dhouston
- 10th September 2009, 11:33
PBP2.50
MPASM
PIC12F509

I'm seeing...Warning[202] ... Argument out of range. Least significant bits used.
Message[306] ... Crossing page boundary -- ensure page bits are set.

What do they mean? What, if anything, need I do?

'=======================| RF RECEIVER |=========================
'MR26X.BAS
'PIC12C509A @ 4MHz 529 words uses MPASM

'Pin 1 - Vdd
'Pin 2 - GPIO.5
'Pin 3 - GPIO.4
'Pin 4 - GPIO.3
'Pin 5 - GPIO.2 RS232 output @ 9600bps
'Pin 6 - GPIO.1 Receives up to 48 bits of PDM/PWM RF with lead-in of 2-9mS
'Pin 7 - GPIO.0
'Pin 8 - Vss

'TMR0 1:64 30=1.9mS, 145=9.3mS - 1:16 50=0.8mS, 94=1.5ms, 155=2.5ms
'================================================= ==============

@ __config _IntRC_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF

DEFINE OSCCAL_1K 1
DEFINE OSC 4

RF VAR byte[6]
i VAR byte
bytes VAR byte
sof VAR byte

SerOut GPIO.2,2,["MR26X",13,10]
SerOut GPIO.2,2,["Copyright © 2009 dlh",13,10]

init: RF[0]=0:RF[1]=0:RF[2]=0:RF[3]=0:RF[4]=0:RF[5]=0
OPTION_REG=%01000101 'TMR0 1:64 prescaler, no PU
While !GPIO.1:Wend 'wait rising edge
TMR0=0 'clear TMR0
While GPIO.1:Wend 'wait falling edge
sof=TMR0 'read TMR0
If (sof<30) Then init '1920µS
If (sof>145) Then init '9280µS
OPTION_REG=%01000011 'TMR0 1:16 prescaler, no PU
While !GPIO.1:Wend 'wait rising edge
TMR0=0 'reset TMR0
i=0
Repeat
While GPIO.1 'wait falling edge
If TMR0>155 Then break '2480µS
Wend 'falling edge
While !GPIO.1 'wait rising edge
If TMR0>155 Then break '2480µS
Wend 'rising edge
If (TMR0<50) Then init '800µS
If (TMR0>94) Then '1500µS
RF.0(i)=1
EndIf
TMR0=0
i=i+1
Until (i>47)
break: If (i<12) Then init
bytes=i/8
If i//8 Then
bytes=bytes+1
EndIf
SerOut GPIO.2,2,[i]
For i = 0 to bytes-1
SerOut GPIO.2,2,[RF[i]]
Next
SerOut GPIO.2,2,[32,sof,13,10]
GoTo init

End

Dave
- 10th September 2009, 12:49
dhouston, I would look at the .LST file and find the occurance of "warning" and then see what variable it is trying to manipulate. This should give you a clue...

Dave Purola,
N8NTA

dhouston
- 10th September 2009, 13:42
Here's the .LST file section...
00F9 0918 M call SEROUT
00078 SEROUT?C 0FFA9h
Warning[202]: Argument out of range. Least significant bits used.
00FA 0CA9 M movlw 0FFA9h
M L?CALL SEROUT
By commenting out each SerOut instance (one-by-one) and recompiling, I isolated it to the copyright message. Without it, both the warning and message go away.

I'll have to wait until Digikey ships my 12F509 chips to test it.

Dave
- 10th September 2009, 16:30
dhouston , I just ran your code and if you get rid of the copyright character the code compiles... Where are you getting the copyright symbol anyways? I don't think the assembler understands it....

Dave Purola,
N8NTA

dhouston
- 10th September 2009, 16:57
Where are you getting the copyright symbol anyways? I don't think the assembler understands it....It was copied and pasted from my source code for an Atmel AVR compiler. The ASCII chart in Appendix D of the PBP manual only goes to 127 so any extended character is likely to cause this. © is ascii 169 (depending on the font).

EDIT: The same copyright line compiles and works OK with a 12F629. It must be a limitation of the 12-bit cores. Anything greater than Ascii 126 causes the error.