??? 07/25/05 12:05 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#97976 - Using port read backs Responding to: ???'s previous message |
I've always been suspicious of reading an output port's state and using to determine the next state. I much prefer to have a variable keep the current state and copy this to the output port. Many years ago there was a story about some micros (motorola's specifically) that would loose the output register's contents if hit by an ESD event. As to how true it was then and if this relates to the latest crop of micros, I'm not sure. Nevertheless I use this as an excuse for my paranoid programming! Also, in this instance, is the code not reading the state of the port pin rather than the port register? |