Page 2 of 2

Re: I/O pin interrupt

Posted: Thu Jun 25, 2015 8:18 am
by davecove
That is all working quite well for me.

How do I set a pin high or low? I have tried:

Pins[RED_LED_PIN].function(PINX_GPIO); // RED_LED_PIN = 3
Pins[RED_LED_PIN].drive();
Pins[RED_LED_PIN] = TRUE;
Pins[RED_LED_PIN] = 1;
Pins[RED_LED_PIN].set(true);

Dave

Re: I/O pin interrupt

Posted: Thu Jun 25, 2015 9:27 am
by dciliske
uh... that's strange. Setting a pin is just

Code: Select all

Pins[YOUR_PIN_NUMBER_HERE] = 0; // make pin go low
Pins[YOUR_PIN_NUMBER_HERE] = 1; // make pin go high
You sure you're working with the correct pin number?

Re: I/O pin interrupt

Posted: Thu Jun 25, 2015 10:25 am
by davecove
"You sure you're working with the correct pin number?"

Pretty sure, yeah... I am using pins 3 and 4 of J8 on a SLB2E Carrier Board and measuring the voltage against pin 11 of J8 (GND).

I am currently trying this code with all 4 possible combinations and then measuring the voltage between 3 & 11 and 4 & 11.

Code: Select all

Pins[3].function(PINX_GPIO);
Pins[4].function(PINX_GPIO);
Pins[3] = x;
Pins[4] = y;

Pin values |  Pin Voltage (ref pin 11)
   (x,y)     |   3   |  4
-----------------------------
  (0.0)      |  0v   | 0v
  (0,1)      |  0v   | 0.58v
  (1,0)      |  3.3v | 1.5v
  (1,1)      |  3.3v | 3.3v
Pin 3 seems fine, pin 4 seems kinda wacky...

I have tried this with a couple of different SLB2E boards and gotten the same results.

Dave

Re: I/O pin interrupt

Posted: Thu Jun 25, 2015 12:55 pm
by dciliske
Remove JP4 and retest.

Re: I/O pin interrupt

Posted: Fri Jun 26, 2015 5:48 am
by davecove
That worked... voltages on pin 4 are now the expected values for 0 and 1.

Dave

Re: I/O pin interrupt

Posted: Fri Jun 26, 2015 9:05 am
by dciliske
Yea, pin 4 is tied to the CTS pins of the RS-232 buffer or the USB-serial bridge if that jumper is connected. Hence where your troubles came from. A'int hardware fun?

-Dan

Re: I/O pin interrupt

Posted: Fri Jun 26, 2015 9:09 am
by davecove
It is fun... but only when you get great support like you guys provide.

I be like'n da NetBurner. (And I let my bosses know that too :)

Dave