Main Site Documentation

Are Tristate Ports supported on FEZ?


#1

I tried to use the TristatepPort but get InvalidOperation exception when Active property is set:


_port = new TristatePort((Cpu.Pin)GHIElectronics.NETMF.FEZ.FEZ_Pin.Digital.Di9, false, false, Port.ResistorMode.Disabled);
_port.Active = false; // this line throws exception

It looks like this problem was also discussed on GHI forums for Embedded Master:
http://www.ghielectronics.com/forum/index.php/topic,1450.0.html

Is this supposed to work on FEZ?


#2

Doesnt it need to be a interrupt capable port for tristate. I don’t believe di9 is interrupt capable.

Page 41 of the ebook they provide

Note: Due to internal design, TristatePort will only work with interrupt capable digital pins.


#3

I tried this on FEZ Mini. Looking in the Broch_FEZ_Mini.pdf table on page 2 this port is interrupt capable. I also tried few other ports with same result.


#4

Can we get a copy of the exception?


#5

Tristate port only work on interrupt capable inputs. I think this is already pointed out in the ebook.


#6

Try the example provided in ebook.
You will get an exception if the pin is input already and you set it to input again. Same for output.


#7

That was exactly the problem. Thanks for your help.