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

#device PIC12F1840

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



Joined: 30 Aug 2016
Posts: 5

View user's profile Send private message

#device PIC12F1840
PostPosted: Tue Aug 30, 2016 5:09 am     Reply with quote

Hi there,

I'm using a PIC12F1840 and hava a question concerning the #device directive. In the CCS manual the *=x option is described as follows:
*=5: Use 5 bit pointers (for all parts)
*=8: Use 8 bit pointers (14 and 16 bit parts)
*=16 Use 16 bit pointers (for 14 bit parts)

Can you please tell me which option is the right one for my PIC12F1840 and how you found it out? Little explanation would be great.

Thanks a lot,
Jan
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Tue Aug 30, 2016 5:42 am     Reply with quote

Using larger pointers, makes the code bigger, but gives access to more RAM.

If you look at the data sheet, you will find the program memory for your chip is 4K*14. So this is a 14bit part. So you can use any of the options.

It's down to how much RAM your code needs to access. When you compile, it'll tell you how much ROM & RAM are being used. If you need more RAM, you have to increase the pointer size. If you are not using much RAM, you can reduce the code size, by selecting the smaller option.

Just updated this. Worth adding, that the compiler (on modern versions) automatically defaults to the pointer that is needed to access all the RAM on your chip. You only need to change this if you need to reduce the RAM to save ROM.
Jan



Joined: 30 Aug 2016
Posts: 5

View user's profile Send private message

PostPosted: Wed Aug 31, 2016 12:49 am     Reply with quote

Hi Ttelmah,

thanks a lot! That was exactly what I wanted to know.

Jan
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