How do I access variables in PIC18 devices external program space?
The far type qualifier is used to place variables into external program space of PIC18 devices. Only some devices support the external memory interface. Accesses to far variables are less efficient than accesses to internal variables and extensive accesses to these variables will result in larger code sizes. Here is an example of an unsigned int object placed into the device???s external code space: far unsigned int farvar; Note that a –RAM option is mandatory to specify the external address range where far variables will reside. In MPLAB IDE, add the additional memory into the RAM Ranges field in the Global tab of the Build Options dialog. For example, specify –RAM=+30000-3FFFF to the driver, or enter: +30000-3FFFF into the RAM Ranges field in MPLAB IDE. You may also want to set the –EMI option to select which mode your device will use to access the external memory. In MPLAB IDE, adjust the External Memory field in the Global tab of the Build Options dialog. Refer to the your manua