Is it true that there is no Timeout type of feature for RFIN?

To save battery power, I plan on having my 433 MHz radio receiver turn on only when needed, but I noticed that RFIN is a blocking command that appears to have no "time out" feature. Is that true or am I missing something somewhere?

If such a timeout feature is needed so that the PicAxe can nap or do other tasks, then is the serin command the only way to do this if using a 14M2 chip? I would like to keep the parts count to a minimum, so I want to avoid using something like the NKM2401.

Thanks.
 
Last edited:

Goeytex

Senior Member
You re correct. There is no timeout for RFIN. The options are to use serin / serout with a preamble and qualifier, or to use the NKM2401.
Another option is to use better RF devices like smart transceivers from Hope, Dorji, Apcon, etal....
 

hippy

Ex-Staff (retired)
You could perhaps monitor the RX signal then enter the RFIN command but that would lock up until there is an RF command seen as there is no timeout You would need something else to reset or power-cycle the PICAXE to get it out of that.

You'd be better off with the RX signal to a PICAXE and NKM2401 so you can power-up the NKM2401 when you think there's a packet coming, use a SERIN timeout or some other means to power-it down when done or there isn't.

You could glue the NKM2401 on top of the PICAXE to save space ;-)
 
Thanks for confirming this for me. Looks like I'm back to using the "old-fashioned" serin commands after all. No big deal, but I just liked the idea there is an in-built feature on the PicAxe M2's that provided Manchester encoding.
 

premelec

Senior Member
Perhaps a next iteration of the editor could incorporate RFIN timeout? Is there some reason not to?
 

hippy

Ex-Staff (retired)
It's the same as with SERIN timeouts when doing bit-banged RF that way; there's so much RX noise that there would never be any timeout event.
 
It's the same as with SERIN timeouts when doing bit-banged RF that way; there's so much RX noise that there would never be any timeout event.


hippy,

could you please elaborate on this statement a little more? Are you saying that the serin command would simply read the noise and then move on to the next line in the program? If so, would that be true even with a qualifier in the serin command?
 

hippy

Ex-Staff (retired)
SERIN timesout on a prolonged idle state so any character or noise that might be a character resets the timeout.

With qualifiers the SERIN won't progress to the next command until the incoming data has matched the qualifiers, but it won't timeout if there are characters or noise.

Unfortunately it's the nature of dumb RF modules to be noisy when they aren't receiving RF data.
 
SERIN timesout on a prolonged idle state so any character or noise that might be a character resets the timeout.

With qualifiers the SERIN won't progress to the next command until the incoming data has matched the qualifiers, but it won't timeout if there are characters or noise.

Unfortunately it's the nature of dumb RF modules to be noisy when they aren't receiving RF data.
So is there no way to use the serin timeout feature with the cheap RF modules? Would it matter if the units are set to idle high vs. low or something like that?

I would think the serin's timeout would never reset - that instead it would either timeout (and the program would move on) or the qualifier would be satisfied and the data would then be accepted. But if I understand you correctly, then the mere presence of bits flipping around (noise) continuously resets the timeout. That makes me question the whole purpose of qualifiers and timeouts. What good are they if they are so susceptible to noise?
 

srnet

Senior Member
That makes me question the whole purpose of qualifiers and timeouts. What good are they if they are so susceptible to noise?
The PICAXE implementation of the serin command, timeouts and the like, makes complete sense in relation to the normal use of serial or RS232 type communications.

What standard serial\RS232 communication cannot do, and were never intended to do, is cope with large amounts of noise.
 
So, to summarize:

rfin has no timeout capability, so unless it gets exactly what it's looking for, the program just hangs at that line for eternity and the PicAxe can not put itself into a low power mode.

serin, on the other hand, has a timeout capability, but it will get reset each time it sees something - anything - flipping around on the input line. So a noisy line could keep resetting the timeout forever, effectively causing the program to just hang at that line for eternity, therefore the PicAxe can not put itself into a low power mode.

Based upon this summary, am I to conclude that a PicAxe would be a poor choice for effecting a low-power mode if used with cheap RF receivers powered by batteries?
 

manuka

Senior Member
There's nothing poor about the using PICAXEs as the MCU. Rather it's horses for courses -simple ASK/OOK modules are ideal starters but usually do not cut the mustard for demanding data work. To make a US analogy, it's perhaps akin to selecting the family car for the Indy 500 !

RF noise susceptibility -especially impulse type- is an AM (Amplitude Modulation) "feature", & was a major reason why FM (Frequency Modulation) broadcasting arose back in the 1930s of course. At 433 MHz a switch from ASK/OK data modules to FM types often eases things wonderfully.

However,as already near endlessly mentioned, far superior GFSK types (which increasingly also incorporate inbuilt error handling routines) are considered the norm for serious 433 MHz data applications. Numerous makers both Asian (Dorji, Sunray, HoperRF) & EU (Ciseco etc) offer high class transceiver modules in the US$20 range. At such modest prices it's just not worth mucking around with ASK types if your application is demanding.
 
... At such modest prices it's just not worth mucking around with ASK types if your application is demanding.
Thanks, Stan, so for me it's just a matter of finding out how much noise my system can tolerate (since my application is not very demanding, and is comparable to a garage door opener). I was just wondering if there might be some sort of pseudo-parallel processing technique or something that the PicAxe could use to assure it wouldn't get hung by noise and eat its batteries.
 

manuka

Senior Member
Ahem- it'd greatly help our collective brains trust if you'd more fully specify details of your "application"...

Established battery saving techniques naturally relate to your -ahem- application, but could involve schemes that use TX beacons, RX wake up & listen every ~10 seconds,a small PV "top up" solar panel, directive antenna & simple squelch,several PICAXEs or even (dare-I-say-it-yet-again) far superior GFSK narrow band half duplex (2 way) data transceivers. These typical retail for US$20 & - ahem- at such attractive prices make it hardly worth mucking around with ASK cheapies.

I've done a lot with swish HopeRF, Yishi, Appcon, & Dorji GFSK offerings, but some of these can be a beggar to configure. Fellow Kiwi Grogster is a great fan of Sunray modules that use either/both hardware (jumpers) & software (PC) configuration.
 

jedynakiewicz

Senior Member
since my application is not very demanding, and is comparable to a garage door opener). I was just wondering if there might be some sort of pseudo-parallel processing technique or something that the PicAxe could use to assure it wouldn't get hung by noise and eat its batteries.
I am a little puzzled by your purpose; in your first post you say "To save battery power, I plan on having my 433 MHz radio receiver turn on only when needed..." but now you seem to be concerned about the PICAXE itself eating its batteries. So, may I propose a possible solution to this enigma.

If your application only requires the transmission of a short command, why not place a dedicated decoder chip such as the Holtek HT12D between the radio module and the PICAXE? The Holtek chip will monitor the incoming signal from your radio receiver module and wait for valid data; this is encoded at the transmitter by a Holtek HT12E chip. Whilst in this "wait state" the PICAXE chip can actually be powered down completely. The encoder and decoder chips use an eight bit address that is set with DIL switches and can transmit a four bit code over the radio link. When the HT12D hears its address correctly it validates this again three times, to make really sure! It then sets an output pin high to announce "valid data received". This can be used to wake the PICAXE via an interrupt. The PICAXE will awake to find a validated four-bit code sitting on its input port. I use the HT12D/E system for various radio links and they have eliminated all previous problems that I had with data validity and dodgy interference. The datasheet indicates that the HT12D uses only 2uA in standby and 200uA when active. I think that using this chip combination with the radio modules and PICAXE is a very effective way of achieving a robust radio command link. You have an eight bit address so that your receiver is selective and you have fifteen command options transmissible over the four bit link. If you need to transfer more information, you can send one data frame to wake the system up; then send a fixed number of validated data frames, however many you want, and then send a "go to sleep" frame to terminate the message.

Once you see the datasheet you will see how simple it is to design and program.
 
Ahem- it'd greatly help our collective brains trust if you'd more fully specify details of your "application"... ....
It's for a small (15 cm diameter) consumer safety device intended to be mounted on top of portable trailers or RVs (in the US, they are known as Recreational Vehicles). These devices are not meant to be turned on very often and I was hoping to avoid using wires to power or activate them, so I've been hoping to power them with batteries, possibly augmented with a small built-in solar panel, and activate them with a cheap RF system, such as is used on cheap garage door openers. They are not life-critical devices or anything of that sort, so I am hoping a dirt-cheap RF unit could do the job. Oh, and did I mention the RF unit needs to be cheap? When designing consumer devices, there's always the problem of every $1 dollar you spend on parts translating into $10 cost to the consumer - thanks to all those evil sales guys and store owners out there who insist on earning enough money to make a living. I'm not an electrical engineer but I do have some limited experience working with some other chips, which cost more, so I've been hoping to learn how to use the PicAxe as a cheaper alternative to bring the consumer's cost down to something reasonable. I don't have the brains or patience to try to hammer this out with straight PICs and, besides, my kids are interested in these PicAxe things for their robots and such, so even if this safety gadget turns into a flop, I'll at least know what the kids are talking about when one of their water rockets punches a hole through my roof.

So far I haven't seen my serin timeouts getting hung up on anything, but I apparently don't live in an RF noisy neighborhood, so this timeout issue is something I need to keep in mind.
 
How exactly does it achieve consumer safety?


It's intended for an animal deterrent gadget, mounts on the top of campers, keeps the critters from scratching around the roof all night. I guess it achieves consumer safety by allowing people to get a good night's sleep. Nothing worse than a sleepy driver behind the wheel of something speeding down the road the size of this:

 

Dippy

Moderator
An interesting project.
It's always good to select a really impressive photo to get people's interest.

Basically, you want something which has the same 'performance' as your car key-fob -> car lock/unlock system BUT with far lower power consumption at the receive end.
In the olden days I'd have considered those Holtek chips. I didn't know you could still get them :)
I, too, had great success with them (with a 555 powering the RF Module - ah those were the days...).

But you should take more inspiration from what you've been told already.
You should use the Wake on Radio method described by Stan.
This is a simple structure.
1. Power the Rx (Wake).
2. Test for an RF carrier or genuine RF signal.
3. If something then stay on longer to process.
4. If nothing intelligible or rubbish then switch off.
5. Sleep delay and GOTO step 1.

You vary this Listen and Sleep time as a compromise between power consumption and how long the transmission is likely to be.
This is the 'duty' time.

With a modern PICAXE you should be able to do this with far lower power consumption than my ancient 555 based effort.
Just some good common sense design and code.
When you actually see signals on 'scopes it really does help.

I know nothing about the RF modules you are using as I tend only to use Modules from Manufs I know.

Just a comment...
If you are hoping to sell this as a product (OEM) for manufacturers or via reputable distributors then your radio gear will likely have to be proven as conforming to various standards. There may be other requirements too which would be up for discussion with your client.
And when budgeting you should look further than the price of a one-off.
Check out the 100off and more... and whether your manufacturer can supply regulalrly and/or is likely to exist next year.
Note: this will cost a bundle to get a pretty product to market.

How much power will this thing take to repel the scuttlers?
Have you really thought this through and done any calcs?

Good luck, if OEM supply doesn't work then you can always sell via Ebay.
Don't use counterfeit fuses or else Nick will nab you :)
(That's a little 'in' joke by the way).
 

sedeap

Senior Member
OOOOOppppppsssss !!!!

It's intended for an animal deterrent gadget, mounts on the top of campers, keeps the critters from scratching around the roof all night. I guess it achieves consumer safety by allowing people to get a good night's sleep. Nothing worse than a sleepy driver behind the wheel of something speeding down the road the size of this:

Good Lord.... dog german shepherd in driver seat !!!

(Hope was a joke...) :rolleyes:
 

hippy

Ex-Staff (retired)
Based upon this summary, am I to conclude that a PicAxe would be a poor choice for effecting a low-power mode if used with cheap RF receivers powered by batteries?
I would say you are probably correct but I'd say "poor choice" is overly negative. It's not really a defect with the PICAXE it's the way dumb RF modules work. Dumb RF modules will put out noise as they wind-up their AGC in the absence of incoming RF, produce noise through that, so there is never any 'silent period'.

I'm not sure there is any good choice for easy to implement low-power operations using dumb RF modules. You could monitor the noise and determine if it were noise at signal changes, sleep as much as possible while doing that, but it's not going to to be easy and RFIN and SERIN commands won't give you that.
 

srnet

Senior Member
The issue is not really a problem with the PICAXE at all, in effect you are requiring a program to be running continuously so that the program can differentiate between noise and real data.

You could run the PICAXE at 31Khz, and use pulsin to measure the incoming data, at that frequency a pulse would be measured in units of 1280us

Now if you are transmitting a byte of $00 at 300 baud, there ought to be a low pulse appearing at the receiver of around 25ms (a count of 19 at 31khz), so if the pulse measures shorter or longer, its noise so keep searching. If the pulse measures 19 then run the PICAXE at normal speed and read the serial data.
 

manuka

Senior Member
I'm near laughed out,& still pondering just just how the roof top critters are to be removed ! One hopes that the driver dog doesn't hit the brakes too hard,or that tail gating jeep may to take very evasive action.
 
...
It's always good to select a really impressive photo to get people's interest....
Dippy, thanks for all the advice. Your outline here makes sense, and I think it's probably the route I'm trying to take. And, yes, it looks like the picture woke up some people. Please be aware that it's not my RV. I don't own an RV. Never have. I'm a tent person, the type who always complains about these monstrous things clogging up the National Parks. But some people have asked me to look into their critter problem, so here I am. People will buy anything, you know, especially things they "need". Anyway, I've needed an excuse to learn about PicAxe, and this, I suppose, might be excuse enough.


...

I'm not sure there is any good choice for easy to implement low-power operations using dumb RF modules. ...
I think I'm beginning to see what you mean. This is where the trade-offs come into play: lots of batteries vs. more complex electronics and higher initial price, etc. I suppose one never knows until one begins to tinker.

...
You could run the PICAXE at 31Khz, and use pulsin to measure the incoming data, at that frequency a pulse would be measured in units of 1280us...
Interesting possibility. I'll have to keep it in mind. Thank you.

...One hopes that the driver dog doesn't hit the brakes too hard,or that tail gating jeep may to take very evasive action.
Actually, I think the jeep is being towed by the RV. It's not an uncommon sight to see these things towing cars. In fact, I once saw a large RV towing a helicopter.

I'm near laughed out,& still pondering just just how the roof top critters are to be removed! ....
It's very simple. Animals get on the roof and make scratching noises. The sleeping occupants wake up, grumble, and press a little button that activates the animal deterrent system mounted to the roof of their RV. The animal deterrent system (ADS) blows a dog whistle and deploys a gangplank. The German shepherd wakes up, runs up the gang plank and attacks the animals. Then the ADS issues a dog treat, and everyone goes back to sleep until the next wild animal comes along. It's sure to be a hit.


 
Last edited:

AllyCat

Senior Member
Hi,
The issue is not really a problem with the PICAXE at all, in effect you are requiring a program to be running continuously so that the program can differentiate between noise and real data.

You could run the PICAXE at 31Khz, and use pulsin to measure the incoming data, at that frequency a pulse would be measured in units of 1280us
Yes, and I would expect the radio receiver to consume more power than the PICaxe (which generally can also sleep when the receiver is off), so the main issue is what duty cycle can the receiver use? IMHO the simplest solution is to arrange that the "push-button" initiates a continuous audio "tone" transmission for (say) 10 seconds (i.e. the user is not required to hold in the button for 10 secs) and the receiver then only needs to be switched on briefly every 8 seconds. If the PICaxe discovers something which might be an appropriate tone then it can listen for longer.

But beware that PICaxes have a "feature" whereby, if operated below 2MHz, then PULSIN doesn't execute a timeout but a hardware reset, as I discovered in this thread.

It's very simple. Animals get on the roof and make scratching noises. The sleeping occupants wake up, grumble, and press a little button that activates the animal deterrent system mounted to the roof of their RV. The animal deterrent system (ADS) blows a dog whistle and deploys a gangplank. The German shepherd wakes up, runs up the gang plank and attacks the animals. Then the ADS issues a dog treat, and everyone goes back to sleep until the next wild animal comes along. It's sure to be a hit.
I hope that should have had a ;) at the end. :)

Oh, and BTW I presume that the RV does have a glass fibre (or similar) and not a metal roof?

Cheers, Alan.
 
That's very clever! I wonder if that can keep birds from pooping on my mailbox. :)


...
Oh, and BTW I presume that the RV does have a glass fibre (or similar) and not a metal roof?...
Alan, would it be a big problem if it's all metal? I tested this on a car the other day and got a reasonable transmission, but the car had lots of windows, so maybe there was plenty of RF leakage??? I always assumed this 433 MHz could make it through a thin sheet of metal since people have used them on garage door openers (at least I think so). But maybe the Faraday cage effect would kill this RF idea?
 

AllyCat

Senior Member
would it be a big problem if it's all metal?
Hi,

Yes, potentially. The thickness (or thinness) makes little difference, it doesn't even need to be "solid" if you consider the "reflectors" used for some antennas (e.g. rods, chicken wire or perforated satellite dishes, etc.) provided the "holes" are small compared with the wavelength. Even the very thin transparent metal films used in thermal (absorbing) windows can seriously reduce radio signal strength.

In an "urban" environment, radio signals may well escape through the windows and bounce off walls, etc., but a RV in the middle of a field might not be close to any reflecting objects. I'm not saying that it definitely will not work, but you may need to supply detailed installation instructions, e.g. to mount the ADS (or its antenna) on top of a (glass) "sunshine roof" panel.

Cheers, Alan.
 

manuka

Senior Member
NoEinstein: Relax- I'd realized that the tail-gating jeep was being towed. Such a combo is indeed quite common here too.

Alert: You perhaps should FIRST explore the actual effectiveness of "critter scare devices", as some are reputed to be useless. Curious animals may even consider them attractors! What's wrong with the old broom handle banged against the ceiling approach!? FWIW I've personally had far more broken nights sleep (in US outdoors) from wandering bears, drunken teens, noisy music & fireworks...

Re post 25: PULSIN indeed has signal detecting mileage-I once used it to good effect on a HopeRF based wireless link
 
...I'm not saying that it definitely will not work, but you may need to supply detailed installation instructions....
Sounds like good advice. Maybe a little pigtail hanging down over a window?




...

Alert: You perhaps should FIRST explore the actual effectiveness of "critter scare devices", as some are reputed to be useless. ...
That's above my pay grade. I've volunteered only for the electronic activation part of it. How - or if - this thing actually works is something the sales dudes will have to wrestle their consciences about.
 
Top