PORTD ouput does not work

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
docs_3756686
Level 2
Level 2
5 replies posted Welcome! 5 questions asked

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

0 Likes
1 Solution
docs_3756686
Level 2
Level 2
5 replies posted Welcome! 5 questions asked

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

View solution in original post

0 Likes
1 Reply