Sensing a Negetive Input on an I/O Pin?
Frog Man
Posts: 6
The title is slightly unclear, it's common sense how to tell whether an I/O pin is high or low, but a wireless receiver I have sends a negative charge out its data terminal (it's not the Xbee, it is a simple setup I found on http://www.seeedstudio.com/depot/433mhz-rf-link-kit-p-127.html). When connected to an I/O pin and using the simple "if (ina[0] == 0)" command, the Propeller does not respond to its charge.
The receiver runs at 5vdc. I am aware of voltage discrepancies(and have used appropriate resistors) and that I can easily set my system up as illustrated in the book(but thats for sending data to readable monitor), but I am developing my own system of transcending by measuring how many times I can record an input pulse in a 2 second period. Depending on how many pulses the propeller records, is what the response will be by the alarm system. (Just to give you a little context)
If anyone has any experience in possibly external transistors or some peripheral set-up which will allow me to convert that negative pulse into a positive one, I would greatly appreciate it.
Thank You
Module: http://www.seeedstudio.com/depot/433mhz-rf-link-kit-p-127.html
________________
|CURRENT SETUP|
GND o
(-)
DATA o
/\/\/\/\/(3.9k)
>pin0
Vcc o
+5vdc
**Not responding to a "if (ina[0] == 0)" code, when receiving and producing a Negative charge on DATA
The receiver runs at 5vdc. I am aware of voltage discrepancies(and have used appropriate resistors) and that I can easily set my system up as illustrated in the book(but thats for sending data to readable monitor), but I am developing my own system of transcending by measuring how many times I can record an input pulse in a 2 second period. Depending on how many pulses the propeller records, is what the response will be by the alarm system. (Just to give you a little context)
If anyone has any experience in possibly external transistors or some peripheral set-up which will allow me to convert that negative pulse into a positive one, I would greatly appreciate it.
Thank You
Module: http://www.seeedstudio.com/depot/433mhz-rf-link-kit-p-127.html
________________
|CURRENT SETUP|
GND o
(-)
DATA o
/\/\/\/\/(3.9k)
>pin0
Vcc o
+5vdc
**Not responding to a "if (ina[0] == 0)" code, when receiving and producing a Negative charge on DATA
Comments
Don't forget, though, with these simple transmitters and receivers, you may need to transmit equalizing pulses or a long mark ahead of any data, so the receiver's data slicer can operate with the correct threshold. Ideally, you would use a balanced encoding scheme, like Manchester, that has an equal amount of highs and lows to keep the receiver's data slicer straddling the center level.
-Phil
Thank You
But show us your code. Maybe it's something else. As things stand, you haven't given us much to go on.
-Phil
Looking at the link to that RF module it says "Receiver Data Output: High - 1/2 Vcc, Low - 0.7v"
But I think they are using the - as a "dash" symbol rather than as a "minus" symbol. In other words, with a 5V supply, high is +2.5V and low is +0.7V.
As such, I think you might be able to feed this into a propeller pin with a current limiting resistor, eg the 3.9k which you already have.
If it is not working, I suspect this is a code problem. These "raw RF" modules are not the easiest to work with - as PhiPi says, you need to balance the highs and lows, eg Manchester coding, or send a series of ascii "U" characters, (12 works) which is binary 01010101 before the packet and then keep the packets short. There are pages and pages of discussions on this on other forums.
The propeller officially received and acted based upon the 4 dollar transceiver package!
Now that I take a closer look at the info page, it does appear to say HIGH Vcc/2 and LOW .7v.
What confused me:
The other aspect to take into account is that when I connect the negative side of and LED to the DATA and the positive to Vcc, it lights up at the correct frequency of the transmitter. When reversed to the polarity stated in the data(+>DATA, ->GND) it doesn't work.
***I also got multiple circuits to function well based on the fact that that was putting out a negative signal...I don't know how...HA!
For your future use:
My current coding is very preliminary for testing purposes, it is as follows:
When connected to a Pull-Down Resistor it makes the LED on pin4 blink exactly with the frequency.
GND o
>GND_______________pin0
DAT o
^
/\/\/\/\/(10K)
>GND
Vcc o
+5vdc
pin4
|>|
>GND
__________________________________________________________________
Thanks for the help!
Frog Man