Hello everyone,
I have a problem with sending data using my RF module, I don't know what the problem is.I try to change the baud rate but nothing happens.Actually I want to send a character using my RF module.But before I accomplish that, I want to test my RF module whether it's function or not.So I use this simple program to test it but my LCD at the receiver board display nothing. I don't know how to troubleshoot the problem because I'm new to this thing.Please help me guys.
Here is the code and the schematic of my hardware.
Transmitter part
CMCON = 7 'Alla I/O Digitala
LEDPin VAR PORTB.4
TransmitterPIN VAR PORTA.0
INCLUDE "modedefs.bas"
Counter VAR BYTE
Synk VAR BYTE
Synk = $55
DEFINE CHAR_PACING 500
Counter = 0
Main:
HIGH LEDPin
PAUSE 100
LOW LEDPin
PAUSE 100
SEROUT TransmitterPIN,T2400,[Synk,Synk,9,Counter]
HIGH LEDPin
PAUSE 100
LOW LEDPin
PAUSE 100
Counter = Counter + 1
PAUSE 600
GOTO Main
END
Receiver part
Define LOADER_USED 1
' Define LCD connections
define OSC 20
DEFINE LCD_DREG PORTC 'LCD data port
DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
DEFINE LCD_RSREG PORTB 'LCD register select port
DEFINE LCD_RSBIT 7 'LCD register select bit
DEFINE LCD_EREG PORTB 'LCD enable port
DEFINE LCD_EBIT 5 'LCD enable bit
DEFINE LCD_RWREG PORTB 'LCD read/write port
DEFINE LCD_RWBIT 6 'LCD read/write bit
DEFINE LCD_BITS 8 'LCD bus size 4 or 8
DEFINE LCD_LINES 2 'Number lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time in us
TRISC = %00000000 'Set port B as output
TRISB = %00000000 'Set port D as output
low PORTB.6 'Set the R/W bit to low
pause 1000 'wait until the LCD initializes
INCLUDE "modedefs.bas"
Counter VAR WORD
ReciverPIN VAR PORTC.0
ADCON1 = 7 ' Alla digitala
PAUSE 500
Main:
SERIN ReciverPIN,T1200,[9],Counter
GOSUB LCD
GOTO Main
LCD:
LCDOUT $FE,1
LCDOUT $FE,$80,#Counter
PAUSE 500
RETURN
END
Bookmarks