PDA

View Full Version : problem with RF receiver



nanami7702002
- 30th January 2005, 02:14
i have read a lot of discussions on "serin2" statements in this forum. i guess most people have come acrossed with the timeout problem in "serin2" . my project is simple as this: a 2*16 LCD is to work as a real time clock, besides, it also can receive a signal (a decimal number) from "DETECT" output of RF receiver and display the number on LCD as well as the number of times of the signal being received.

while i was using "SERIN2", the program was just hanging there without updating the real time clock. after getting some hints from the forum, i tried to put "SERIN2" in the timer1 interrupt(set to 100ms). this had really solved the " static" clock problem. however, "listening "process in every 100 ms made the # of time of signal being received not accurate.i know it was because of the noise at the "DETECT" output.
pls give me a hand to this. this question needs solving immediately. for all of the professions like u, it is just a piece of chicken. but for me, i am already at the end of the tether.

ps: 16f876 with osc at 20MHZ

mister_e
- 30th January 2005, 08:43
mmm, most than often you can solve your RF problem playing with Baudrate.

wich kind of RF module are you using ?

NavMicroSystems
- 30th January 2005, 22:33
nanami7702002

your code and schematic would help us to help you.

nanami7702002
- 31st January 2005, 02:46
i'm using FMRX1, 7 LEADS radiometrix receiver.
The transmitter is the R.F solutions rage of FM radiometrix TRANSMITTER. they r in a pair

nanami7702002
- 31st January 2005, 02:50
according to the module, the high data rate is up to 5kbps. but when i tried to adjust the baudrate higher, the receiver was not able to reveive
regarding to the schematic diagram. the circuit itself is not a complicated one. PORTC of the PIC is connected to the LCD datainput. RF "detect" is fed into PORTB.7

mister_e
- 31st January 2005, 03:14
What about if you try slower baudrate... as slow as you can ? simple thought here because i solve many of my noise problem with that...

AND NOW let's shrink this part of your code


'*****************************************
DISABLE

TIMER_INTERRUPT:
PIR1.0 = 0
TMR1TEMP.LOWBYTE = TMR1L
TMR1TEMP.HIGHBYTE = TMR1H
TMR1SET=TIMER1PRE+TMR1TEMP
TMR1L=TMR1SET.LOWBYTE
TMR1H=TMR1SET.HIGHBYTE

LCDOUT $FE,$C0
IF DAY = 1 THEN
LCDOUT "MON"
ENDIF
IF DAY = 2 THEN
LCDOUT "TUE"
ENDIF
IF DAY = 3 THEN
LCDOUT "WED"
ENDIF
IF DAY = 4 THEN
LCDOUT "THU"
ENDIF
IF DAY = 5 THEN
LCDOUT "FRI"
ENDIF
IF DAY = 6 THEN
LCDOUT "SAT"
ENDIF
IF DAY = 7 THEN
LCDOUT "SUN"
ENDIF
LCDOUT $FE,$C3
LCDOUT #H2
LCDOUT #H1
LCDOUT ":"
LCDOUT #M2
LCDOUT #M1
LCDOUT ":"
LCDOUT #S2
LCDOUT #S1
LCDOUT $FE,$CC
LCDOUT #REC
LCDOUT " "
LCDOUT #T2
LCDOUT #T1

RESUME
ENABLE


it has to work but gives you a load of delay IMO.

this is my own version


'*****************************************
DISABLE

TIMER_INTERRUPT:
PIR1.0 = 0
TMR1TEMP.LOWBYTE = TMR1L
TMR1TEMP.HIGHBYTE = TMR1H
TMR1SET=TIMER1PRE+TMR1TEMP
TMR1L=TMR1SET.LOWBYTE
TMR1H=TMR1SET.HIGHBYTE

LCDOUT $FE,$C0
select case DAY
case 1
LCDOUT "MON"
case 2
LCDOUT "TUE"
case 3
LCDOUT "WED"
case 4
LCDOUT "THU"
case 5
LCDOUT "FRI"
case 6
LCDOUT "SAT"
case 7
LCDOUT "SUN"
end select
LCDOUT $FE,$C3,#H2,#H1,":",#M2,#M1,":",#S2,#S1
LCDOUT $FE,$CC,#REC," ",#T2,#T1

RESUME
ENABLE


and probably LCDOUT in one shot can also work


LCDOUT $FE,$C3,#H2,#H1,":",#M2,#M1,":",#S2,#S1,_
$FE,$CC,#REC," ",#T2,#T1

mister_e
- 31st January 2005, 03:25
one other thing about this part...

PIR1.0 = 0
TMR1TEMP.LOWBYTE = TMR1L
TMR1TEMP.HIGHBYTE = TMR1H
TMR1SET=TIMER1PRE+TMR1TEMP
TMR1L=TMR1SET.LOWBYTE
TMR1H=TMR1SET.HIGHBYTE


I always feel safer to stop the timer before reload it


T1CON.0=0 'stop timer1
PIR1.0 = 0
TMR1TEMP.LOWBYTE = TMR1L
TMR1TEMP.HIGHBYTE = TMR1H
TMR1SET=TIMER1PRE+TMR1TEMP
TMR1L=TMR1SET.LOWBYTE
TMR1H=TMR1SET.HIGHBYTE
T1CON.0=1 'start timer1

mister_e
- 31st January 2005, 03:43
and a last one... tired to heard me ?!?!?

Have you use the recommended circuit?!? I mean did you place a resistor in serie on the supply pin + capacitor ?!?

and, i'm sure you did, 47K to VCC on pin 3 to always unmute the device?

mister_e
- 31st January 2005, 03:57
Still me....

I have to apologize SERIN2 with 3313 give 300 bauds... you can't go slower... my fault for the very first time ;)

I know that SERIN2 will place the used pin to input automatic but it can be safe to set TRIS the right way... in your case TRISB=0

lets say we change it to TRISB=$80.

OK now i shut my mouth untill you post your result.

Cheers!

nanami7702002
- 31st January 2005, 04:44
NO. sorry to disapoint u . i did not connect the aditional rsistor to the supply. the supply is a single +5v .
I fOUND problem with the format of the code, i uploded it again.for those who have no problem reading it, pls ignore this

mister_e
- 31st January 2005, 04:48
NO. sorry to disapoint u . i did not connect the aditional rsistor to the supply. the supply is a single +5v .


they recommend a 10ohm + 10-47uF... you must install those to provide a better noise rejection from/to supply line. That's really important. And the other one is to set the device to normal operation...Un-Muted as they says.

If somebody here can second me on that... i'll appreciate.


PS... your previous attachement is blank... as now ;)

nanami7702002
- 31st January 2005, 12:50
as u said, i connected a 47kohm resistor to pin 3 before the power supply. but i am not sure how to connect the power SUPPLY-filtering part(10ohm+10uf). anyway, i tried putting them in series with the power supply and in parallel and no matter what kind of design.
actually, now all the circuits(transmitter part and receiver part) r patched up on the same breadboard. and the antenna is just a jumper wire. r these the factors of noise? i think so. but i have already fabricated the printed circuit board(PCB). as long as i am on the right track, there should be no problem when they r tested on the PCB.
oh, i also want to clarify that i am taking the output from pin 7 not pin 6. pin 6 is not used at all.
maybe there r some further problems with my receiver circuit, i describe it as below:
pin 1 is connected to a jumper wire(as antenna);
pin 2 and pin 4 are fed to the GRound
pin 3 is connected with a 47k resistor to the +5 vpower supply;
pin 5 is connected directly to the +5v power supply
pin 6 is not connected
pin 7 is the connected the PORTB.7
transmitter part will be posted upon request.
why is it so difficult to meet the requirement? i just want the LCD to show signal it received and no. of times.
and the signal is just a binary digit(2-8). ONLY!!!!!!!!!

mister_e
- 31st January 2005, 14:25
try to remove rf stuff and try it directly first.


the 10 Ohm must be in serie with supply line. The capacitor must be between the supply line of the rf device and ground.

I'm not sure that's a good practice to have everything on the same board... looks like a big amount of signal is creating something like *standing waves*

If you can send both code for emmiter and receiver it will be handy to help you on that.

don't give up!

NavMicroSystems
- 31st January 2005, 21:55
Sorry guys,

If I understand the problem correctly
you are still struggling with the RF connection
and I think you are on a wrong track.

presuming you have wired up the hardware correctly
it is a matter of Manchester Encoding the Data
before sending it to the Transmitter using SEROUT / SEROUT2 / HERROUT
(all 3 versions should work)

BTW
A Breadboard is not the best choice for this kind of application!


See the following Threads:

http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=702&highlight=manchester

http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=198&highlight=manchester

I'm sure you will have better results by "balancing" you RF-Devices.