I'm trying to read the temperature of a DS18S20 with the dallas 1-wire protocol. I want to make the protocol myself using the datasheet so i can fully understand it. However i stumbled upon a problem that i can't resolve.
In my code i need to switch the tris of portd.6 from output to input (to detect the DS18s20) this is where my pic18f452 gets stuck. I have no idea what i'm doing wrong so if anybody can help i would be grateful.I copied the code related to this section below.
The problem is at line: dq_dir=1; //set the data pin to input //stuck here
#define dq portd.6