|
|
View previous topic :: View next topic |
Author |
Message |
dais
Joined: 03 May 2004 Posts: 11
|
simple Input/output question |
Posted: Fri Jun 04, 2004 1:10 pm |
|
|
Hi,
I have a question about input and output mode.
SET_TRIS_B( 0x0F ); // B7,B6,B5,B4 are outputs
// B3,B2,B1,B0 are inputs
When I do INPUT_B()
Does it change b7,b6,b5,b4 into input mode then read or it only read B0-B3, and ignore B4-B8.
Thanks
Simin |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jun 04, 2004 1:27 pm |
|
|
Quote: | SET_TRIS_B( 0x0F ); // B7,B6,B5,B4 are outputs
// B3,B2,B1,B0 are inputs
When I do INPUT_B()
Does it change b7,b6,b5,b4 into input mode then read
or it only read B0-B3, and ignore B4-B8. |
If you are using Standard i/o Mode, then yes, the compiler will set
the TRIS for all of Port B to be inputs, before it reads the port.
It will leave all the pins in that state.
If you are using Fast i/o mode for Port B, then the TRIS
state will not be changed by the compiler. |
|
|
Guest
|
|
Posted: Fri Jun 04, 2004 2:26 pm |
|
|
PCM, Thanks for quick reply, I will use standard IO.
Simin |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|