I think that you are not checking the input port value properly. Try the following code instead:
if ((PRT2DR &= 0x20) > 0)
{
// put the bit toggling code here.
}
Hi,
In PSoC Designer, first confirm that your inputs are set to "HIGH Z", not "HIGH_Z Analog".
Next, check that the output pins are set as outputs, eg, "Strong Slow".
Then to read the inputs use
while (1)
{
if (PRT2DR & 0x20) //if pin P2.5 is set
{
PRT0DR |= 0x20; // set pin P0.5
}
else
{
PRT0DR &= ~0x20; // clear pin P0.5
}
}
This should get you started. For more on GPIO see the following url:
http://www.planetpsoc.com/component/content/article/13-basics-of-psoc-gpio.html