1 Reply Latest reply on Oct 11, 2018 11:54 PM by docs_3756686

    PORTD ouput does not work

    docs_3756686

      Hy,

      I am ver new in this topic and I want to use PORTD for general output.

      I define DO_MEASUREMENT_BIT t 0x02;

      set PORTD1 to output by OED|= DO_MEASUREMENT_BIT by #define DO_MEASUREMENT_BIT 0x02

      and init to low by IOD = 0x00;

      I want to check that PD2 is 0 or 1 (low or high) by   IOD & DO_MEASUREMENT_BIT, but it always true

      ( it true if i do the following:

      IOD = 0x00;

      if IOD & DO_MEASUREMENT_BIT

      )

      Can someone explain what is wrong? How should I set and check the value of out PORTD?

      My code is attached.

      Thanks

      Domonkos