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?
Code:
'=======================| 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
Bookmarks