PDA

View Full Version : Help RF engines not detect state pin change


diego_beltran
08-12-2010, 12:59 PM
I need to clarify questions concerning the function monitorPin, i can not detect a simple logic level in a RF engine input, I want to do something when a pin changes from 0 to 1, but the RF Engine not responding, try running the function test readPin from Portal but I always returned true, so the input is 0, I am working with version 2.2 and I've tested with several RF engine.
What could be happening?
What should I do?

Thanks

kbanks
08-12-2010, 04:53 PM
Did you make the pin an input pin? (setPinDir())
Did you enable the internal pullup resistor,or provide an external one in hardware (setPinPullup())
Did you tell SNAPpy you wanted the pin to be monitored? (monitorPin())
Did you declare a subroutine as the handler for said monitoring (@setHook(HOOK_GPIN).

Also, if readPin() is returning True, then the pin is a 1 not a 0.

diego_beltran
08-12-2010, 11:23 PM
yes, I I did all the tests but the node is not replied, that can happen?.
no problem if I run the built-in functions directly in Portal without loading a script on the node?

even with a loaded script execution did not work ...

Help me.

Thank u very much

kbanks
08-13-2010, 04:38 PM
What type of SNAP Engine exactly?

What is your "platform" NV Parameter set too?

Please post your script source code so we can take a look at it.

diego_beltran
08-15-2010, 11:03 PM
I am using a RF Engine 100P86, this is the code of what I want to do
from synapse.switchboard import *
from synapse.platforms import *

@setHook(HOOK_STARTUP)
def startupEvent():
setPinDir(GPIO_5, False)
setPinDir(GPIO_6, True)
monitorPin(GPIO_5, True)
setRate(3)


@setHook(HOOK_GPIN)
def buttonEvent(pinNum, isSet):
if isSet:
writePin(GPIO_6,True)

I have tried in various ways, but I have not worked. What do you recommend?

Jheath
08-16-2010, 08:22 AM
I think the key is what Kbanks mentioned: Why does you pin read '1' even if you believe it to be low?

Have you verified with a O-Scope (or a multimeter) that the pin is actually transitioning and not being held high be an another device/component?

Jheath
08-16-2010, 08:27 AM
Oh, you are also missing a call to setPinPullup(GPIO_5, False) from your script. This is typically needed to help with the transition (low to high).

diego_beltran
08-16-2010, 08:26 PM
no, I have set pull-up resistor externally, in addition, I did with setPinPullup (GPIO_5, False), and did not work.

I want to do the test with the built-in functions from Portal, without loading a script, but still does not work. what process should I follow to achieve my goal?

I'm a little confused by this stuacion, the RF engines work on the portal's note correctly, and I have made wireless transmission tests and they work well, but the physical ports do not give me an answer.

Thanks.

diego_beltran
08-16-2010, 08:28 PM
Off-topic, I am interested in the RF engines for 900MHz and 2Mbps, you can help me to know how to get them?.
thank you very much.

mgenti
08-17-2010, 08:01 AM
Have you tried this with more than one node? It's possible you have a bad node, although every node's GPIO is tested before leaving the factory.

As for the other modules, they are still finishing up FCC testing. Once they are certified they should be available for purchase. I would contact your sales person or Future Electronics.

kbanks
08-17-2010, 08:57 PM
I am using a RF Engine 100P86

But what sort of board do you have it plugged into?

Don't forget that on many boards GPIO_3/4/5/6 are used by the first UART, and GPIO_7/8/9/10 are used by the second UART.

Do you have a hardware conflict on GPIO_5 and/or 6?

kbanks
08-17-2010, 09:08 PM
I tested your script on a SN171 Proto Board, and it works on my hardware.

Are you aware that your script (as currently written) will not set GPIO_6 True until AFTER you RELEASE the button attached to GPIO_5?

Also keep in mind that monitorPin() will only act on TRANSITIONS. For example, if GPIO_5 starts out low, and remains low, then no HOOK_GPIN event will be generated.

gre7g
08-18-2010, 08:30 AM
Off-topic, I am interested in the RF engines for 900MHz and 2Mbps, you can help me to know how to get them?.
thank you very much.

I don't believe the RF200 and RF300 have completed FCC testing yet. Contact the sales department and see if a demo unit can be shaken loose early.