Flip odd I/O behaviour.
Bobby1066
Posts: 34
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
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
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...
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