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

problem with bit access of defined port

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



Joined: 09 Apr 2009
Posts: 29

View user's profile Send private message

problem with bit access of defined port
PostPosted: Fri May 14, 2010 3:05 pm     Reply with quote

Hi friends
I wrote #byte PORTE = 0xf84 to use PORTE in my program ( ie. PORTE = 0xff )
Now I want bit access to PORTE like PORTE.3 = 1;
What should I do to have bit access in this format?
I mean I don't want write bit_set(); function.
Regards
_________________
Sorry if i have much mistakes, my english is not good.
Thanks a lot for your helps.
Have a good time
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 14, 2010 3:27 pm     Reply with quote

That syntax isn't supported by CCS. Use #bit to create a named bit.
Then assign it a value with a line of code. Example:
Code:

#byte PORTE = 0xF84
#bit  my_bit = PORTE.1

void main()
{
my_bit = 1;

my_bit = 0;


while(1);
}
Study



Joined: 09 Apr 2009
Posts: 29

View user's profile Send private message

PostPosted: Fri May 14, 2010 3:37 pm     Reply with quote

Thanks PCM
As i see , i should define all SFR byte and bit in my device files to be comfort with PCWHD, can i download them anywhere?
_________________
Sorry if i have much mistakes, my english is not good.
Thanks a lot for your helps.
Have a good time
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 14, 2010 3:45 pm     Reply with quote

If you have the full CCS IDE (which it appears that you have), then you
can generate customized header files which have the register definitions
in them. Look on this page, about 60% of the way down:
http://www.ccsinfo.com/content.php?page=ideoverview
You will see this section:
Quote:

Ability to Generate Customized Include
Files with SFR Definitions
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