Hello All,
What can anyone tell me about filtering as describe below. Or is this not filtering?
Here is the scenario. I have a receiving radio and a transmitting radio. When the receiving radio receives a strong enough signal, the squelch “opens” and someone’s voice comes out of the speaker. At this same instant, there is a point inside the receiving radio that goes from 0VDC to 5 VDC. This is what I am using on an input pin to tell my PICAXE project that it is time to go and key up the transmitting radio and also patch the audio from the receiving radio, into the transmitting radios microphone input. All at the same instant. Yes, the receiver and transmitter are on different frequencies. They must be!
This works fine 95 percent of the time unless there is some sort of interference. (like today!)
I experienced some sort of electrical interference via the antenna system, not the power supply, that was opening the receiving radios squelch and makeing the radios, key up, un key, key up, un key, key up un key etc. etc. All because of some sort of interference that would only last milliseconds at a time, but enough to be detected by the receiving radio and the appropriate PICAXE pin. Hence the reason for trying to filter out the noise in the code rather then just increasing the threshold of the Squelch control to almost maximum on the receiving radio. (which does fix things but tends to make the receiving radio a bit deaf)
So what I would like to do is add some sort of filtering in my code. What I have now is a line that basically says:
Do
If pin #N is high Goto KeyUpTxRadio (no filtering???)
Loop
What about checking the pin status multiple times over a short period of time with short pauses in between checks? What is this? Filtering in its simplest form?
Do
If pin #N is high Goto Filter
Loop
Filter:
Check Pin #N
Pause N (maybe Pause 5 )
Check Pin #N
Pause N
Check Pin #N
Pause N
Check Pin #N
Pause N
Check Pin #n
(hope you all get my drift)
If any on these checks of the pin fail, then bail out anywhere in the “filter” and return to the loop and don’t go and key up the transmitter. Is this filtering? What is the best way to go about this? Will it introduce any other problems? I can tolerate up to 255 milliseconds of total Pause’s.
What is the best way? Possibly to use For Next? I’m a bit lost at which direction to attack this. Oh, this is not for profit and it’s not my high school homework project.
Comments on a good direction to take would be most appreciative. (I only have 200 bytes left in my 18X)
“Hammy"
What can anyone tell me about filtering as describe below. Or is this not filtering?
Here is the scenario. I have a receiving radio and a transmitting radio. When the receiving radio receives a strong enough signal, the squelch “opens” and someone’s voice comes out of the speaker. At this same instant, there is a point inside the receiving radio that goes from 0VDC to 5 VDC. This is what I am using on an input pin to tell my PICAXE project that it is time to go and key up the transmitting radio and also patch the audio from the receiving radio, into the transmitting radios microphone input. All at the same instant. Yes, the receiver and transmitter are on different frequencies. They must be!
This works fine 95 percent of the time unless there is some sort of interference. (like today!)
I experienced some sort of electrical interference via the antenna system, not the power supply, that was opening the receiving radios squelch and makeing the radios, key up, un key, key up, un key, key up un key etc. etc. All because of some sort of interference that would only last milliseconds at a time, but enough to be detected by the receiving radio and the appropriate PICAXE pin. Hence the reason for trying to filter out the noise in the code rather then just increasing the threshold of the Squelch control to almost maximum on the receiving radio. (which does fix things but tends to make the receiving radio a bit deaf)
So what I would like to do is add some sort of filtering in my code. What I have now is a line that basically says:
Do
If pin #N is high Goto KeyUpTxRadio (no filtering???)
Loop
What about checking the pin status multiple times over a short period of time with short pauses in between checks? What is this? Filtering in its simplest form?
Do
If pin #N is high Goto Filter
Loop
Filter:
Check Pin #N
Pause N (maybe Pause 5 )
Check Pin #N
Pause N
Check Pin #N
Pause N
Check Pin #N
Pause N
Check Pin #n
(hope you all get my drift)
If any on these checks of the pin fail, then bail out anywhere in the “filter” and return to the loop and don’t go and key up the transmitter. Is this filtering? What is the best way to go about this? Will it introduce any other problems? I can tolerate up to 255 milliseconds of total Pause’s.
What is the best way? Possibly to use For Next? I’m a bit lost at which direction to attack this. Oh, this is not for profit and it’s not my high school homework project.
Comments on a good direction to take would be most appreciative. (I only have 200 bytes left in my 18X)
“Hammy"