|
|
View previous topic :: View next topic |
Author |
Message |
ibg
Joined: 19 Nov 2003 Posts: 22
|
more about the #DEVICE directive |
Posted: Fri Jan 09, 2004 11:52 am |
|
|
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 |
Posted: Fri Jan 09, 2004 4:19 pm |
|
|
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 |
|
|
|
|
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
|