Frequently Asked Questions

Why does the compiler show less RAM than there really is?

Some devices make part of the RAM much more ineffective to access than the standard RAM. In particular, the 509, 57, 66, 67,76 and 77 devices have this problem.

By default, the compiler will not automatically allocate variables to the problem RAM and, therefore, the RAM available will show a number smaller than expected.

There are three ways to use this RAM:

1. Use #BYTE or #BIT to allocate a variable in this RAM. Do NOT create a pointer to these variables. Example:

#BYTE counter=0x30

2. Use Read_Bank and Write_Bank to access the RAM like an array. This works well if you need to allocate an array in this RAM. Example:

for(i=0;i<15;i++)
   Write_Bank(1,i,getc());
for(i=0;i<=15;i++) 
   PUTC(Read_Bank(1,i));

3. For PCM users, you can switch to 16 bit pointers for full RAM access (This takes more ROM). Add *=16 to the #DEVICE. Example:

#DEVICE PIC16C77 *=16

C-Aware IDE Demo
Embedded C Learners Kit
C Workshop Compiler