Furthermore, if you look at the block diagram in the datasheet from the HiMark RX3310A chip, you will see the comparator in the output circuit. Adding another will not help.
Furthermore, if you look at the block diagram in the datasheet from the HiMark RX3310A chip, you will see the comparator in the output circuit. Adding another will not help.
Wow that really is some sloppy output stage. Try sending a continuous data stream of an
equal number of 1's & 0's like 55h with a 1mS pause between each byte of data, and capture
a scope shot of this.
I'm curious is this data-slicer is ever squaring anything.
Hello Guys..Thanks for all the advice
Now my Rx module works fine in a short distance around 5-6 feet.I just add 10k pull up resistor at Rx data pin and 10uF at Vcc.But If I move more than 6 feets, my Rx module start receiving noise and my LCD will display wrong counting numbers.But It's fine to me.At least it's work.I think maybe the problem is from the antenna.I just use a small wire with length 10cm each for my Tx an Rx.So anyone here have any ideas about the antenna??
Now I'm moving foward to send a data from my keypad. IF I pressed pad1,pad2 and so on..my LCD at transmitter board will display BUS01,BUS02....What I want to do is send the word "BUSxx" each time I pressed the keypad and display it on my LCD at receiver board. So with help and some advice from mister_e..I wrote the code below.But It's not work even I Connect the transmitter and receiver pin directly.
The FAct Is..I'm very poor with the coding..please help me guys..
Tx part
@ device HS_OSC, LVP_OFF
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
' Define program variables
col var byte ' Keypad column
row var byte ' Keypad row
key var byte ' Key value
TransmitterPIN VAR PORTA.0
YourByteVar var byte
INCLUDE "modedefs.bas"
Synk VAR BYTE
Synk = $55
DEFINE CHAR_PACING 500
ADCON1 = 7 ' Make PORTA and PORTE digital
Pause 100 ' Wait for LCD to start
Lcdout $fe, 1, "Key In Bus ID" ' Display sign on message
loop:
Gosub getkey ' Get a key from the keypad
Lcdout $FE, $C0, "BUS",DEC2 key ' Display ASCII key number
PAUSE 200
Goto loop ' Do it forever
' Subroutine to get a key from keypad
getkey:
Pause 50 ' Debounce
getkeyu:
' Wait for all keys up
PORTD = 0 ' All output pins low
TRISD = $f0 ' Bottom 4 pins out, top 4 pins in
If ((PORTD >> 4) != $f) Then getkeyu ' If any keys down, loop
Pause 50 ' Debounce
getkeyp:
' Wait for keypress
For col = 0 to 3 ' 4 columns in keypad
PORTD = 0 ' All output pins low
TRISD = (dcd col) ^ $ff ' Set one column pin to output
row = PORTD >> 4 ' Read row
If row != $f Then gotkey ' If any keydown, exit
Next col
Goto getkeyp ' No keys down, go look again
gotkey: ' Change row and column to key number 1 - 16
key = (col * 4) + (ncd (row ^ $f))
Return ' Subroutine over
Main:
High TransmitterPin
pause 200
SEROUT TransmitterPIN,T2400,[Synk,Synk,"~",YourByteVar]
pause 500
GOTO Main
END
Rx part
@ device HS_OSC, LVP_OFF
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"
ReciverPIN VAR PORTA.0
ADCON1 = 7 ' Alla digitala
YourByteVar var byte
pause 100
LCDOUT $FE,1, " Receiving Bus ID"
Main:
SERIN ReciverPIN,T2400,["~"],YourByteVar
GOSUB LCD
GOTO Main
LCD:
LCDOUT $FE,1
Lcdout $FE,$C0,"BUS",DEC2 YourByteVar
PAUSE 500
RETURN
END
Try those with direct connection.
Notice the change in the Keypad scanning routine... this one seems to never have any erratic results now.Code:' ' TX code ' ======= ' @ device HS_OSC, LVP_OFF 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 TransmitterPIN VAR PORTA.0 DEFINE CHAR_PACING 500 TRISA = 0 'Set port A as output TRISB = 0 'Set port B as output TRISC = 0 'Set port C as output TRISD = 0 'Set port D as output ' Define program variables INCLUDE "modedefs.bas" col var byte ' Keypad column row var byte ' Keypad row key var byte ' Key value Synk VAR BYTE Synk = $55 ADCON1 = 7 ' Make PORTA and PORTE digital low PORTB.6 'Set the R/W bit to low High TransmitterPin Pause 500 ' Wait for LCD to start Lcdout $fe, 1, "Key In Bus ID" ' Display sign on message loop: Gosub getkey ' Get a key from the keypad Lcdout $FE, $C0, "BUS",DEC2 key ' Display ASCII key number SEROUT TransmitterPIN,T2400,[Synk,Synk,"~",KEY] Goto loop ' Do it forever ' Subroutine to get a key from keypad getkey: PORTD = 0 ' All output pins low TRISD = $f0 ' Bottom 4 pins out, top 4 pins in WHILE PORTD != $F0 : wEND ' Wait 'till all key=up PAUSE 50 ' Debounce ScanKeypad: For col = 0 to 3 ' TRISD=~(DCD COL) ' Set one I/O to output PAUSEUS 5 ' wait a little bit to avoid ' erratic results ' ROW=ncd((~(PORTD>>4)) & $f) ' read row ' IF ROW THEN ' Any key pressed? key = ((row-1)*4)+ col+1' --- YES convert key value return ' and getout of here ENDIF ' NEXT ' Goto ScanKeypad ' No keys down, go look again
Side note...There's no major advantage to use LCD in 8 bit mode.. R/W pin could also be tied directly to ground. This done you save 5 I/Os.Code:' ' RX code ' ======= ' @ device HS_OSC, LVP_OFF 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 TRISA = 1 ' PORTA.0 input, other as output TRISB = 0 ' Set port B as output TRISC = 0 ' Set port C as output TRISD = 0 ' Set port D as output ReciverPIN VAR PORTA.0 ADCON1 = 7 ' Alla digitala INCLUDE "modedefs.bas" YourByteVar var byte low PORTB.6 'Set the R/W bit to low pause 500 'wait until the LCD initializes LCDOUT $FE,1, " Receiving Bus ID" Main: SERIN ReciverPIN,T2400,["~"],YourByteVar Lcdout $FE,$C0,"BUS", DEC2 YourByteVar GOTO Main
Last edited by mister_e; - 6th April 2008 at 00:25.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
To start learning about antennas, go here
http://www.linxtechnologies.com/Supp...ication-Notes/
and read app notes AN-00500 and AN-00501.
Let us know if you need anything clarified.
Dave
Always wear safety glasses while programming.
Forgot to answer you question.
It looks like you could have the 315 or 434 MHz
The antenna length for
315 MHz = 22.63 cm
434 MHz = 16.43 cm
The above figures are just "ball park" starting lengths. Use the one for your frequency and even with out a good ground plane you should see improvement.
Dave
Always wear safety glasses while programming.
Hello Steve,
Since I still receive noise..I decide to use Holtek encoder/decoder which is HT12E/HT12D. I construct the circuit following your advice and connect all data pins at HT12E/HT12D to port A0-PortA3.The decoder works fine but the encoder have a little bit problem.That's why I'm not receiving any signal because When I check OSC pin at encoder using logic probe,it show logic low at OSC 1 and show nothing at OSC 2.For your Information, I put 1M resistor between these 2 pins. Don't know what's really happen with my encoder. If you have any idea about the problem..can you please share it with me??![]()
I never used those ICs... maybe you could some something in this document
http://rentron.com/remote_control/remotes.pdf
It show different value for the resistor. I didn't read the according datasheet to see if it affect anything though.
Maybe you screw the OSC signal with your probe.. use a scope instead, set your probe to 10X (or 100X if you have any) and see what happen.
TE pin should be tied low too unless the oscillator won't run.. as per Their Block Diagram (page 2) in their datasheet.
http://www.holtek.com/pdf/consumer/2_12ev110.pdf
As usual, Before you attach your RF modules, try direct connection, Dout to Din of your Holtek ICs.
HTH
Last edited by mister_e; - 8th April 2008 at 18:02.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks