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 CCS Technical Support

Reading Port B

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



Joined: 01 Nov 2007
Posts: 9

View user's profile Send private message

Reading Port B
PostPosted: Mon Dec 03, 2007 8:13 am     Reply with quote

I'm using an 18f2520 PIC and would like to read the whole of port B. Ive tried to read using the following code within main()

portb = get_tris_b();

The read does not work. Is there additional port setup required? I will post my source when i get home if required.
Foppie



Joined: 16 Sep 2005
Posts: 138
Location: The Netherlands

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Mon Dec 03, 2007 9:41 am     Reply with quote

with the get_tris_b(); function you will get the setting of the TRIS register of port B, not port B itself.

You can try the input_b(); function for this purpose.

Hope this helps
Guest








PostPosted: Mon Dec 03, 2007 1:23 pm     Reply with quote

Foppie wrote:
with the get_tris_b(); function you will get the setting of the TRIS register of port B, not port B itself.

You can try the input_b(); function for this purpose.

Hope this helps


ah i see. input_b() works fine. thanks foppi, u rock!
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