Dave,
I've loaded your TX code into one 12F675 and connected to the Linx TX and it is transmitting data. ( I changed the interval from 15 seconds to 1.5 seconds)
I then loaded your RX code as seen below into another 12F675 and I'm not getting anything out of GPIO.2. I connected a LED to the data out of the receiver and it does flash in sync with the TX data going out.
I connect GPIO.2 of the RX PIC to Hyperterminal set at 8N1, 9600 and get nothing at all and I connected an LED to GPIO.2 and nothing there either.
Shouldn't I be getting something on the RX PIC ?
Code:
'==============================RECEIVER============================
'-----PIC12F675-----
'USE PIC12F675 if you need to measure linear output (e.g. to tune)
'Receives 32 bits of NEC protocol RF with initial lead-in of 8.8mS
'outputs received codes via RS232 @ 9600bps on GPIO.2
'12F675
_CONFIG
@ DEVICE PIC12F675
_NOCLKOUT
_WDT_ON
_PWRTE_ON
_MCLRE_OFF
_BODEN_ON
DEFINE OSC 4
INCLUDE "modedefs.bas"
DEFINE PULSIN_MAX 968 '>968 RETURNS 0
DEFINE DEBUG_REG GPIO
DEFINE DEBUG_BIT 2 'GPIO.2
DEFINE DEBUG_MODE 1 'Inverted
DEFINE DEBUG_BAUD 9600
DEFINE OSCCAL_1K 1
RF VAR byte[4]
space VAR byte
i VAR byte
bits VAR byte
stx VAR word 'start of transmission
CMCON = 7 'comparators off
init: RF[0]=0:RF[1]=0:RF[2]=0:RF[3]=0
bits=0:i=0
PulsIn GPIO.1, 1, stx
If (stx<792) Then init
While GPIO.1=0:Wend 'wait pulse
'use SerIn here instead of Repeat loop & $FF tests
Repeat
PulsIn GPIO.1, 0, space
If (space<40) Or (space>175) Then init
If (space>75) Then
RF.0(i)=1 'set bit
EndIf
i=i+1
Until (i>31)
If RF[0]+RF[1]<>$FF Then init
If RF[2]+RF[3]<>$FF Then init
For i = 0 to 3
Debug (RF[i] REV 8)
Next
GoTo init
End
Bookmarks