|
Ellen, You are thinking of the ports as a "single register", which will lead to confusion when you are splitting port functions. I'd suggest you re-read the section of the manual that describes the port logic. When dealing with ports that are configured for I/O, consider input bits to be "missing" from write operations and output bits to be "missing" from read cycles. It (used to be) good software practice to avoid "writing to inuts" or "reading from outputs" - either of which can cause problems in some circumstances. Calamity Jane __________________________________ |
|
|
|
Thanks, you and Emmett made things more clear. However, I wasn't thinking of the ports as a single register. That's why i asked why the code tried to store a value (Ex: $EE)in the four most significant bits of PORTC when DDRC was initialized as $0f. I suppose the code just did that so as to save instructions since register B would already have the value i'm trying to compare with in PORTC. Now...just gotta figure out why the code in my book isn't working for me. Ugh....more questions later when i can pinpoint the problem, but my guess is my hardware. Eileen --- In , Calamity Jane <winnonad@y...> wrote: > Ellen, > > You are thinking of the ports as a "single register", > which will lead to confusion when you are splitting > port functions. I'd suggest you re-read the section of > the manual that describes the port logic. > > When dealing with ports that are configured for I/O, > consider input bits to be "missing" from write > operations and output bits to be "missing" from read > cycles. > > It (used to be) good software practice to avoid > "writing to inuts" or "reading from outputs" - either > of which can cause problems in some circumstances. > > Calamity Jane > __________________________________ |