I/O pin interrupt

Discussion to talk about software related topics only.
davecove
Posts: 17
Joined: Fri Apr 24, 2015 8:26 am

Re: I/O pin interrupt

Post 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
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: I/O pin interrupt

Post 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?
Dan Ciliske
Project Engineer
Netburner, Inc
davecove
Posts: 17
Joined: Fri Apr 24, 2015 8:26 am

Re: I/O pin interrupt

Post 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
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: I/O pin interrupt

Post by dciliske »

Remove JP4 and retest.
Dan Ciliske
Project Engineer
Netburner, Inc
davecove
Posts: 17
Joined: Fri Apr 24, 2015 8:26 am

Re: I/O pin interrupt

Post by davecove »

That worked... voltages on pin 4 are now the expected values for 0 and 1.

Dave
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: I/O pin interrupt

Post 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
Dan Ciliske
Project Engineer
Netburner, Inc
davecove
Posts: 17
Joined: Fri Apr 24, 2015 8:26 am

Re: I/O pin interrupt

Post 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
Post Reply