Tuesday, June 2, 2015

Testing Pmod gpio pins as inputs

Testing done on a Mac with Ubuntu 14.4.  Terminal window in SDK doesn't work, so using gtkterm.

Three different tests.

1.  With the data direction set as 0b11111011  (output is 1, input is zero),

With nothing connected I get 251.  When I connect each of the pins to ground (on the pmod), I get the following:
pin 1:  250
pin 2:249
pin 3: 251 (of course)
pin 4: 243
...
pin 8:  123

So, it's reading the pins data direction setting as an input, unless there's an actual input on the pin.  Why would it read all of them as inputs and not just JA3?

2.  When I set the data direction as 0b00000000, I only get zeros as an input.  If I connect 3.3V from the pmod, to each of the pins, I never get a nonzero number. There is a 200 ohm resistor on those pins. 

I also tried adding the write statement back in to write all pins as high and then read.  That didn't work.  When I input a 0 on any of the pins, they all read high. 

3.  When I set the data direction os 0b11111111, I get 255 as an input and connecting any of the pins to 0, output is 255.

So, it's working, sort of.  But, you throw away one pin to set the input to zero.  Does this make sense?

No comments:

Post a Comment