I apologize for repeatedly posting on this subject but I am continually running into problems. I am using the RX433 and TX33 modules for my project. My project essentially has four buttons that trigger four different ports on the receiving end. I am basically using a cheap version of Manchester by filling up the four extra bits within the byte (because there are only four buttons), every other "real bit" (the ones that trigger the ports). That way every other byte is at least a one. See the code below to understand what I mean. Unfortunately it does not work wirelessly. I hooked it up using a wire and it worked. Is their something wrong with my "Manchester"? Or am I messing something else up with the modules?
I appreciate any responses.
-----------------
Transmitter Code:
-----------------
define HSER_TXSTA 20h
define HSER_BAUD 4800
cmcon = 7
Current var byte
Laststate var byte
input PORTA.0
input PORTA.1
input PORTA.2
input PORTA.3
Current.0 = 1
Current.2 = 1
Current.4 = 1
Current.6 = 1
Main:
current.1 = PORTA.0
Current.3 = PORTA.1
Current.5 = PORTA.2
Current.7 = PORTA.3
if (Current <> Laststate) then
hserout [$A5,"~",Current]
Laststate = Current
endif
goto main
--------------
Receiver Code:
--------------
define HSER_CLROERR 1
define HSER_RCSTA 90h
define HSER_BAUD 4800
cmcon = 7
Current var byte
output PORTA.0
output PORTA.1
output PORTA.2
output PORTA.3
output PORTB.4
low PORTA.0
low PORTA.1
low PORTA.2
low PORTA.3
low PORTB.4
@ DEVICE PIC16F628A, MCLR_OFF
@ DEVICE PIC16F628A, WDT_OFF
@ DEVICE PIC16F628A, PROTECT_OFF
@ DEVICE PIC16F628A, BOD_OFF
@ DEVICE PIC16F628A, CPD_OFF
Main:
high PORTB.4 //this is just so I can debug whether the PIC is being "browned out" by the other components
pause 250
low PORTB.4
goto loop
loop:
Hserin 20,loop,[WAIT("~"),Current]
Current = ~ Current
PORTA.0 = Current.1
PORTA.1 = Current.3
PORTA.2 = Current.5
PORTA.3 = Current.7
goto loop
============================
Thank you.
-Mike
Bookmarks