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

first Time to C programing

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



Joined: 09 Dec 2009
Posts: 37

View user's profile Send private message

first Time to C programing
PostPosted: Wed Dec 09, 2009 8:18 am     Reply with quote

Hi all

Why I cant use the registers directly ? example LATB=0xff
Do I need always to re define all the registers , ports and lats ?
#byte LATB = 0xf8a

Any other way please ?

Thank you
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

Re: first Time to C programing
PostPosted: Wed Dec 09, 2009 9:46 am     Reply with quote

assaad wrote:
Hi all

Why I cant use the registers directly ? example LATB=0xff
Do I need always to re define all the registers , ports and lats ?
#byte LATB = 0xf8a

Any other way please ?

Thank you

Why would you want to use the registers directly? That is so tedious. The name of the registers are all defined in the header file for your device.

Also, does 0xf8a look like a single byte to you?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 09, 2009 5:01 pm     Reply with quote

If you have the full IDE compiler (PCW, PCWH, or PCWHD), there is a
feature in the Device Editor that allows you to create a header file of
all the SFR register addresses (with #byte statements). You can
#include that file in your program and easily access the registers
directly. See the following link in which ckielstra explains how to do this:
http://www.ccsinfo.com/forum/viewtopic.php?t=40862&start=3
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