13 Replies Latest reply on Mar 14, 2015 11:12 PM by user_14586677

    Anyone know how to read a digital input pin?

    user_343349849

       As silly as it sounds, I have been fiddling for hours to get my project to read a digital input pin.

         

      The device is a PSOC 4200 (SSOIC-28)

         

      I have a Digital Input pin on P4[0], P4[1] and P4[2].

         

      I see from the technical manual there are limitations on P4 with routing but it appears the pins can be used as GPIO.

         

      My Power supply is 3V

         

      The signals are slow (1 is a 100ms enable signal and the other a 2ms period clock and data pin)

         

      I have tried CMOS trip levels, transparency mode, buffer on and off, high impedance, pull down, initial value = 0, initial value = 1.

         

      I have a logic analyser connected to the input pins on the micro and the signal is stable and consistant, packets are being sent every 350ms.

         

      I have tried CyPins_ReadPin(PINALIAS) and PIN_Read() but neither is detecting the high level of pin.

         

      Earlier I did have an interrupt running on one of the pins and it was working but when single stepping the code, the interrupt remained being tripped by new packets coming in and causing the code to branch to isr. I changed back to pin read in an attempt to read the pin

         

      My last attempt is bundled up and attached.

         

      Surely, I have done something stupid, I cannot imagine reading a digital input pin would be so involved.

         

      I will attach the wavforms in next post