PDA

View Full Version : Serout And Serin Via Rf Link



MARAD75
- 27th April 2007, 18:21
Hi everyone
I am using multiple 12f629s running with internal 4 meg clocks in this idea.
First I need to:
Send a simple 2 or 3 digit number via serout from one 12f629, to an rf transmitter. This will be received by an rf receiver, then serin to another 12f629.
Never done Serout/Serin code. Does anyone have any sample serout/serin code that would help me build on?
Secondly:
There will be a pulse sent by the Xmit a few msec. prior to sending the serial code so the pic on the receiver end wakes up from either sleep or nap.
Normally, I'd like the pic to check the receive line for the above pulse, then go into the serin receive routine. If the pulse is absent then it goes back to sleep or nap for another period. (just to save power) I can use the pulse to either bring MCLR low, or simply wait for the nap period to end.
Which would be better? - a sleep that ends when MCLR is brought low, or a nap that just checks the receive each time after its short time out period?
This is another area of Pic Basic Pro that I am not clear on!
Thanks for any help!
Ron

kenpo
- 27th April 2007, 18:35
SEROUT2 1,396,[dec din]
SERIN2 0,396, [dec din]

sends at 2400

works fine for me.

your rf chips prob won't need a max232 so it should hopefully be easy, but I've never first hand used an rf transmitter

dhouston
- 27th April 2007, 19:22
First, you need to decide what transmitter and receiver you will use. AM? FM? If AM, superheterodyne or superregenerative receiver? What range is required? Outdoors? Indoors? What's the biggest number you will send? What's the biggest number you are willing to spend on hardware?

Second, the RF receiver power use will likely dwarf the 12F629 power use so your sleep idea is probably not worth pursuing unless you also plan to power down the receiver while the PIC sleeps. How frequent are the transmissions?

I think SerOut/SerIn overly complicates this type of communication. Check this recent thread for ideas.http://www.picbasic.co.uk/forum/showthread.php?t=6212

languer
- 27th April 2007, 21:07
I would add one more thing to what's been said. Whatever protocol you use for the communications, test it through wires first. Only after you have everything working through wires, you should add the wireless element.

MARAD75
- 27th April 2007, 22:19
Hi all
Lot of good stuff in these posts. I already have ideas about how to accomplish this.
Thanks again