RF module is widely used for wireless data transmission. It is a low cost module for short distance especially less than 5 meter . For long distance module, it comes with higher price. It is used in most of remote control applications, remote monitoring and sensing for example in controlling some machines or robots without connecting or use wires. Sometime we can use it for sending a string of codes or data wirelessly, wireless security alarm, digital signal transmission or for household electrical appliances . Normally the transmitter and receiver module operate at 315 MHz or 433 MHz. The common IC found in RF modules are PT2262(encoder/transmitter) and PT2272(decoder/receiver).
DEFINE OSC 20
@ device hs_osc
INCLUDE "modedefs.bas" ' Include serial modes
x VAR BYTE
y VAR BYTE
Synk VAR BYTE
Synk=$55
DEFINE CHAR_PACING 1000
loop:
SerOut PORTC.6,T2400,[Synk,Synk,Synk,Synk,Synk,Synk,9,x] 'transmit
Pause 100
SerIn PORTC.7, T2400,[9],y 'receive
Pause 100
Goto loop
315MHz Transmitter
315MHz Receiver
PBP Program
'program to transmite and receive a signal via RF module
DEFINE OSC 20
@ device hs_osc
INCLUDE "modedefs.bas" ' Include serial modes
x VAR BYTE
y VAR BYTE
Synk VAR BYTE
Synk=$55
DEFINE CHAR_PACING 1000
loop:
SerOut PORTC.6,T2400,[Synk,Synk,Synk,Synk,Synk,Synk,9,x] 'transmit
Pause 100
SerIn PORTC.7, T2400,[9],y 'receive
Pause 100
Goto loop
No comments:
Post a Comment