one wire protocol

Paul's comments can be a bit harsh, but they're usually good advice. The first step to creating good code is to make is readable, use standard conventions, use meaningful variable names, and put in comments where they would help. All of this is especially true if you are expecting someone else to give you some free help in a public forum.

So... As Paul stated, mixing direct port manipulation with the Arduino pin functions is not a good idea. Pick one or the other and stick to it.

Comments would help immensely. We can easily see what the code does, but that doesn't tell us what you think the code is doing. The comments would tell us what you are thinking so we can see if the code is appropriate.

It would also be helpful if you provide a reference for your comment "...as I understand it..." regarding the use of the direction register to change the signal level. This statement is what you are trying to confirm, but without knowing the source of that, we can't determine if you are actually trying to do what the original source is saying.

Also, how are you checking the output? Are you using an oscilloscope to see any transitions, or just checking the final state with a multimeter or LED?