Russell McMahon wrote... >As described it's faily safe as the ISR writes the flag but never resets it. >The "main" task will never inspect the data until it is definitely ready. >Also the main task will never clear the flag until after it is read. The >"semaphore" flag is sepearted in time by the reading andwriting of 4 bytes. [...] There's nothing "fairly" safe about it; it's safe, absolutely, provided only that the main code and the ISR faithfully obey the basic discipline of never grabbing the resource for themselves, only relinquishing it to the other. As to whether this is the best solution to the OP's problem, that's another matter; if interrupt latency is not an issue, there's no point in going to all this bother- just clear the GIE bit before reading the variable and set it again afterwards, and be done with it. Dave D. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body