PDA

View Full Version : Need Old Ver 1 XIO abilities


BitManip
02-28-2008, 09:20 AM
Has the ability to talk to the XIO register 8000 like I had in Portal Ver 1 to turn off some of the things (Like dissable the A/D, Serial Ports etc) and recover the GPIO lines on the RF Module that were dedicated to it been carried over into Ver 2? If so please give me an example.

Thanks

mgenti
02-28-2008, 10:58 AM
Out of the box the GPIO lines are only tied to the serial port but can be turned off using the configuration bits. In our evalBase script we explicitly have to setup monitoring the pins tied to the ADC or button. As long as you don't use the evalBase script (such as "from evalBase import *") these pins will not be setup for anything by default.

BitManip
02-28-2008, 03:48 PM
OK, I just took a new out of the package RF Engine and programmed it with the new firmware. I inserted it into my own proto board and was able to wiggle every pin (Except for the UART1 pins 9,10,11 & 12), I am amazed! You and everyone there did an EXCELLENT job. I applied the built in function to set each pin direction then set it hi or low with the second function. Q: Now that all but the UART1 pins that I setup as outputs have been programmed, does this stay the fact till changed (Non Volitile)? Q: Can I clear the UART1 pins also and use those as GPIO outputs or inputs? Q: If so, then what do I do if I loose communications with the device? Q: How do I do a master reset to get back my RFE or is it lost? Q: Do you support software hadshaking on UART1?:)

kbanks
02-28-2008, 05:45 PM
Q) Can I access/control all 19 GPIO pins?
A) Yes. Some of the pins are also used by the two UARTs. This does not mean that you cannot use those pins, it just means you might have to disable/disconnect the UART first.

To make it easier to connect to the nodes, some NV parameters have been set to force auto-initialization of the ports. If you look in the Configuration Parameters, you will see a field called Feature Bits. Quoting the "SNAP Reference Manual" (which was posted today!):

Feature Bits control some miscellaneous hardware settings. The individual bits are:

Bit 0x0001 – Enable Serial Port 1 (USB port on a SN111 board)
Bit 0x0002 – Enable hardware flow control on Serial Port 1
Bit 0x0004 – Enable Serial Port 2 (RS-232 port on a SN111 or SN171 board)
(the only serial port on a SN171 Proto Board)
Bit 0x0008 – Enable hardware flow control on Serial Port 2
Bit 0x0010 – Enable the radio Power Amplifier (PA)

So, one thing you might have to do is turn off the bits of the UART(s) you do not want.

BE CAREFUL NOT TO MAKE IT WHERE YOU CANNOT TALK TO THE UNIT, IF YOU ARE ACCESSING THE UNIT OVER ONE OF THE UARTS. This is not an issue if you are accessing the node over the air.

There is also a Default UART field. It can be 0, 1, or 255 (0xFF). Set it to 0xFF to make Default Uart essentially be "none".

Calling setPinDir() should override any UART settings anyway, but if you are having trouble then turning off the feature bits should help.

Also remember that initUart(uart,0) (in other words, with a baudrate of 0) disables the UART data path. and flowControl(uart,False) disables the use of the RTS/CTS pins

kbanks
02-28-2008, 06:02 PM
Q) Are pin settings non-volatile?
A) No. If you want pins to be set a certain way (input, output, high, low) at startup, then in your SNAPpy script you should put the corresponding setPinXXX functions. You probably want to do this in your "startup hook" code.

kbanks
02-28-2008, 06:09 PM
Q) What do I do if I lose communications with the device?
A) If you lost serial access do to a "live" change (you invoked a function manually from Portal), then just reboot the unit (since these settings are NOT non-volatile)

If you have PROGRAMATICALLY cut yourself off (you actually put code in your script that is locking you out), then you need to use the "Erase SNAPpy script" function under the options menu in Portal. You can then adjust your script before you re-upload it into the unit.

Q) How do I do a master reset to get back my RFE or is it lost?
A) As stated above, if you have locked yourself out of a unit via a SNAPpy script, there is a way to erase the script from the unit.

You also might be able to access the unit Over The Air, using a different node as your "bridge".

If erasing your script does not give you access to the node, you can also erase the NV params of the unit (which include the UART settings). Look for a "Factory Default NV Params" choice under the Options menu.

kbanks
02-28-2008, 06:13 PM
Q) Do you support software hadshaking on UART1?
A) No, the only handshake choices are OFF and HARDWARE HANDSHAKE.

However, since SNAPpy scripts can talk directly to the UARTs, you could implement some software handshake schemes in SNAPpy.

For instance, when your SNAPpy script gets the HOOK_STDIN, it could send some sort of "pause" character or command (using the print command, with STDOUT redirected to the serial port).

When your SNAPpy script wanted more data, it could use another print statement to send some sort of "resume" character or command.

BitManip
03-07-2008, 12:12 PM
I did as you told me to do, turning off the default UART with 255 (not 0xFF) in the Default UART field and set the feature bits to 0x0. I then did a fresh power up and I still see the GPIO 8 line go high afterward. Turning off Pin Pull up made no diff, turning pin to Low made no diff, only after setting the GPIO 8 Output as true did was my commands to set the line Low followed. My question then is: If the startup is reading the NV area that should contain the default UART and the Feature Bits and after having set these conditions to NONE, what is happening to overide the Configuration setup that I performed after power shutdown and on power up? I guess what I am also trying to really get at: What is the purpose of the Configuration window of the Node if it does not truely reflect the condition of the End Device after a Power Shutdown has happened and the device has then Re-Powered up? By the way your idea about using the initUart(uart,0) did the job of taking the pin from a high state to a low state imediately after a power up. I am trying to figure a way to put the RF End Device on a Serial Adressable Bus while being able to power down the RF End Device.

kbanks
03-10-2008, 09:54 AM
My guess from here is that you do not yet have a SNAPpy script loaded into your node.

If you have no script loaded, then we override both the Default UART setting and the Feature Bits settings, to ensure the node can be talked to over its serial port.

We did this because certain Beta customers kept locking themselves out of their units.

If you have a script loaded, then this "override" code is skipped. The unit will behave as you have configured it.

Sorry for the confusion, I will make a note to add more to the documentation.