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

How to define a data type of 10 bits or 24 bits?

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



Joined: 15 Sep 2005
Posts: 15

View user's profile Send private message

How to define a data type of 10 bits or 24 bits?
PostPosted: Tue Feb 21, 2006 3:31 am     Reply with quote

Hi all,

I was wondering if there is any way to define a data type of 10 bits or one of 24 bits. I am getting problems with RAM space and the possibility to define this "exotic" data types could solve some of my problems.
Thanks in advance.
Best Regards,
Eduardo
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

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

PostPosted: Tue Feb 21, 2006 8:56 am     Reply with quote

Short answer is no. There are no native 10-bit or 24-bit data types.

You can create structures and use the UNION command to encapsulate data. But you will need to keep things on 8-bit boundaries or end up with wasted space.

Furthermore the data operators (+, -, etc) and functions are designed to use the native data types. If you created your own 24-bit integer you will also need to create your own 24-bit operators and functions.

The CCS compilers sometimes have problems with overly complex data structures so be prepaired to read LST and MAP files.

What part are you currently using?
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Ed_Banses



Joined: 15 Sep 2005
Posts: 15

View user's profile Send private message

PostPosted: Fri Feb 24, 2006 6:44 am     Reply with quote

Thanks for your answer.
I am using the PIC16F688 because the Ultra Low Power Wake Up feature.
I am going to take a look that you say, but I think that I am going to change the idea using the exotic data types.
Thanks a lot.
Eduardo
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