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.
I had to set all EPs (4, 6, 8) to 0 (WORLDWIDE = 0)
EP4FIFOCFG = 0x00; SYNCDELAY;
EP6FIFOCFG = 0x00; SYNCDELAY;
EP8FIFOCFG = 0x00; SYNCDELAY;
And do all EP config before set IFCONFIG to FIFO Slave