- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had to set all EPs (4, 6, 😎 to 0 (WORLDWIDE = 0)
EP4FIFOCFG = 0x00; SYNCDELAY;
EP6FIFOCFG = 0x00; SYNCDELAY;
EP8FIFOCFG = 0x00; SYNCDELAY;
And do all EP config before set IFCONFIG to FIFO Slave