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

more about the #DEVICE directive

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



Joined: 19 Nov 2003
Posts: 22

View user's profile Send private message

more about the #DEVICE directive
PostPosted: Fri Jan 09, 2004 11:52 am     Reply with quote

Hi again,

Iīve already received a reply for my question about the meaning of
#device *=16 ADC=10

(thanks tTelmah)

In such reply is said "Use 16bit RAM pointers (means the chip can access RAM outside the first bank, but increases the size of code)".

My questions now are:

- I have read the memory organization info. for the PIC18F452 and itīs said that there are 16 banks of 256 bytes each (4096 bytes of memory). Why do I need 16bit RAM pointers?

- What happen if we wouldnīt have specified *=16? How many bits are used to access the RAM by default?

Thanks once again,

ibg
Ttelmah
Guest







Re: more about the #DEVICE directive
PostPosted: Fri Jan 09, 2004 4:19 pm     Reply with quote

ibg wrote:
Hi again,

Iīve already received a reply for my question about the meaning of
#device *=16 ADC=10

(thanks tTelmah)

In such reply is said "Use 16bit RAM pointers (means the chip can access RAM outside the first bank, but increases the size of code)".

My questions now are:

- I have read the memory organization info. for the PIC18F452 and itīs said that there are 16 banks of 256 bytes each (4096 bytes of memory). Why do I need 16bit RAM pointers?

- What happen if we wouldnīt have specified *=16? How many bits are used to access the RAM by default?

Thanks once again,

ibg

*=16, does nothing on the 18 series chips. They can access all the memory anyway. The command is really 'aimed' at the older smaller chips, with only a very small number of banks. On these chips, the default 'RAM address' pointer, is only 8bits, allowing access to just 256bytes of RAM. The downside of using these larger pointers, is that every RAM access, then involves two operations (one to set the bank, and the second to set the address), whereas if you work only in the low bank, only one operation is needed. This can result in perhaps a 50% expansion in the amount of ROM used.
On these chips, you can use 8bit pointer, and still access the higher banks on an 'odd' occasion, by using the 'write_bank', and 'read_bank' functions.

Best Wishes
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