Fex Hydra Analog Read...missing something

Ok great! Is there a way to ensure that those pins are not used anywhere else in for my application? The board won’t just be doing the multiplexing.

If you use the Gadgeteer designer then it is not possible to use/assign a pin in multiple places in your application.

Thanks for the help, all working so far :-).

I have a few more questions:

In order to define objects for serial ports in the Hydra how do I know which COM port is which? Is it according to the schematic, in which case, for example, Socket 4 is COM1 and Socket 6 is COM 2? And if that is the case, what would be Socket 5 be?

In terms of using a real time clock battery with the Hydra, I assume I would use Socket one which contains an RTC_VBat pin for the physical implementation. I have some code for the FEZ Rhino, but I’m not sure how to use it for the Hydra. There are Objects like ‘BatteryRam’ and ‘RealtimeClock’ that do not seem to be defined within the Hydra Hardware dll: GHIElectronics.OSH.NETMF.Hardware. Any ideas on how to do things with the RTC such as using the GetTime and SetTime methods?

I believe you only need to know the COM port number if you are not using the Gadgeteer API?

[quote]In order to define objects for serial ports in the Hydra how do I know which COM port is which? Is it according to the schematic, in which case, for example, Socket 4 is COM1 and Socket 6 is COM 2? And if that is the case, what would be Socket 5 be?
[/quote]

Take a look at the Hydra mainboard code. There is defintition for all sockets. Socket has a property SerialPortName, that will give you the answer.

http://gadgeteer.codeplex.com/SourceControl/changeset/view/17974#165325

Hi FEZter,

For non-gadgeteer applications the com ports are as follows:

COM1 = Socket 5 -->> On Schematic it is DTXD\DRXD
COM2 = Socket 7 -->> On Schematic it is TXD0\RXD0
COM3 = Socket 4 -->> On Schematic it is TXD1\RXD1
COM4 = Socket 6 -->> On Schematic it is TXD2\RXD2

Thanks, the port names are sorted and all working.

I have connected an RS232 level shifter to one of the serial ports and the then done a loopback test by connecting the Tx and Rx pins on the RS232 board, but the test is not working. I tried just connecting the Rx and Tx of the socket and that worked fine. Any ideas?

Also, does anyone know what I can do about using an RTC battery with the Hydra? (see earlier post)

sounds like you have reversed wiring to rs232 board.

the pin for the RTC battery is usually on the Z socket. check the hydra schematic to see if it there. if it is there, connect a 3.3v battery to that pin and ground.

@ Mike: For the RS232, I have connected the pins 2 (Rx) and 3(Tx) from the DB9. If there are just these two lines connected how is a reversal possible? Or maybe I misunderstood you.

With Regard to the RTC Battery, The physical implementation is fine, it’s just that I have found some objects in the code to be missing with the hydra: the ‘BatteryRAM’ and ‘RealTimeClock’ methids. I get the errors:

Error The name ‘BatteryRAM’ does not exist in the current context
Error The name ‘RealTimeClock’ does not exist in the current context

I cannot find these objects under the GHIElectronics.OSH.NETMF.Hardware.dll, for the Hydra whereas they do exist under the Hardware dll for the Spider: GHIElectronics.NETMF.Hardware.dll. Any ideas on what I can do there?

Reversal of serial lines is a common mistake, so it’s always worth testing it out (and it isn’t damaging on RS232 lines). The reason this is often done is that you consider it from two different points of view, in your case the Fez board and the other end of the RS232 module; the Fez view is that Rx is it’s incoming line, which is really the outgoing signal from the other device, or it’s TX. The DB9 pin 2 and pin 3 are the relevant pins, so just swap the connection over and see if that helps, you may find it does.

The other thing you need connected is GNDs, make sure that is connected between the Fez and the other side.

The Hydra is an OSHW and may not have the same features as the Spider (the Premium library). Here’s the list of supported APIs: http://www.ghielectronics.com/downloads/NETMF/OSHW%20Library%20Documentation/Index.html plus it’s not “finished” and can be added to as people want.

@ Brett: Sorry, I realize that was not clear. I have connected Tx and Rx to each other to do a loop back test and so in that case it would not matter which way round they were. When I do a loop back test with Tx and Rx from the Socket that works fine, but when the RS232 is connected it does not work. The ground is common throughout the circuit.

No, I think we’re talking about the RX/TX pins on the INPUT TO THE FEZ, not the ones on the output of the other device. What “level shifter” have you used?

I used the Sparkfun board for level shifting: http://www.sparkfun.com/products/449. At first, I did not use the level shifter and connected Tx and Rx directly in the Socket and that worked fine. Then I connected the level shifter and connected the output Tx and Rx, which did not work.

There can only be two explanations for that then. Either your wiring is wrong, or your level shifter is cactus.

You have tested the Fez pins directly. They work when you tie them together. If you have all 4 wires plugged in correctly (I assume you have some form of header soldered to the sparkfun board?) and you have the DB9 RX/TX shorted together, then this should just work.

Do your LEDs work at all? I assume they flash as RX and TX signals are sent.

Remember, the RX-I pin on the sparkfun board must be connected to the TX OUT pin on the Fez, and TX-O to RX IN on Fez. VCC should be connected to 3v3 and GND-GND.

I love the UART Dyslexia comment on that item. I remember reading it years ago and saying, yep, that is just too true.

Oh and there is one more possible explanation for why it doesn’t work. Are you sure you got the right pins in the DB9 tied together? Where is your Pin 1 on the socket? Have you tried with Pin 3 and Pin 4 tied together instead, just to humour us?

Great, I’ve got the Sparkfun boards working. The header Tx and Rx were the wrong way around. Gets confusing who’s talking to who :-).

I have another problem where if I plug in the RTC Battery to Socket1 with Vcc(3V) connected to pin5 and Gnd connected to pin10 the USB Client Module’s PWR LED flashes and the program says that the USB device is not recognized.

I have the same problem, if I plug battery to socket1 (pin5 vcc pin10 Gnd) Fez Hydra (v1.2) doesn’t work.

any suggestions?

Thanks

Hi David, and welcome to the forum !

it’s probably unlikely that your situation will have any relevance to this old 1 year + thread, so i’d start your own thread and tell us more about what you’re seeing and what works. .

It’s an old thread but here it is: you need 32.768 kHz crystal & 1.2V battery (not 3.3V as on Spider). See here: https://www.ghielectronics.com/community/forum/topic?id=6993

Topic solved, the problem was the battery, I have to use a 1.5 vdc

Thanks Hyperlisk