CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

simple Input/output question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dais



Joined: 03 May 2004
Posts: 11

View user's profile Send private message

simple Input/output question
PostPosted: Fri Jun 04, 2004 1:10 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jun 04, 2004 1:27 pm     Reply with quote

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








PostPosted: Fri Jun 04, 2004 2:26 pm     Reply with quote

PCM, Thanks for quick reply, I will use standard IO.

Simin
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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