Shop OBEX P1 Docs P2 Docs Learn Events
Flip odd I/O behaviour. — Parallax Forums

Flip odd I/O behaviour.

Bobby1066Bobby1066 Posts: 34
edited 2018-12-23 21:50 in Propeller 1
Run on the Flip
input1 is pulsed at 1Hz, Pulse seen on led
input2 changes state with no input applied. No pulse seen on led.

330ohm resistor in series with low current led
connected between each pin and gnd.

*/
#include "simpletools.h" // Include simple tools
int main() // Main function
{

int input1 = 1 << 17; // Input pin mask
int input2 = 1 << 18; //
int Ticks = 0;
input(input1);
input(input2);

waitcnt(CLKFREQ/2 + CNT);
printf(" CLOCK Freq = %d \n\n" , CLKFREQ);

while(1)
{
waitpeq(input1, input1);
printf(" input1 High count %d \n\n" , Ticks);
printf(" input2 %d \n\n" , get_state(input2));
waitpne(input1, input1);
Ticks++;
}
}

Have monitiored input pin with logic probe and no change of input detected.

Am I doing something wrong or is there a problem.
I'm a newbie to both Propeller and C.

Thank you

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2018-12-23 22:22
    You're not doing anything wrong, nor is the FLiP module. When a pin is configured as an input, it has very high impedance. With nothing connected to it, it may couple capacitively to an adjacent pin and mirror that pin's state. By attaching a logic probe, you effectively lower the pin's impedance, so it no longer couples to the adjacent pin tightly enough to reflect that pin's state.

    -Phil
  • Think on an unconnected input pin as a near-field antenna or voltage probe.
    Unconnected inputs can cause a few mA of extra power consumption (regardless of system
    clockspeed), so its vital in a low power project to either ground unused pins or set them as
    outputs and leave unconnected.

    During development grounding unused pins is risky(*), so reserve this for the final version, or play
    safe and use pull-down resistors.

    (*) upload the wrong code and you might fry the pins...
  • Tied Input2 to Ov with 330ohm resistor.
    Same result.

    input2 0

    input1 High count 121

    input2 0

    input1 High count 122

    input2 0

    input1 High count 123

    input2 0

    input1 High count 124

    input2 1

    input1 High count 125

    input2 1

    input1 High count 126

    input2 1

    input1 High count 127

    input2 0

    input1 High count 128

    input2 0
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2018-12-24 17:23
    I don't have "simple_tools" in front of me. Are you sure that get_state operates on a bit mask and not on a pin number? If the latter, you've got it looking at P0, not pin P18.

    -Phil
Sign In or Register to comment.