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 support@ccsinfo.com

large memory model with PIC18F6722

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








large memory model with PIC18F6722
PostPosted: Mon Jul 21, 2008 12:17 pm     Reply with quote

Hello,

I have not been able to find any mention of how to specify either far pointers (24-bit) or how to enable the large memory model (where pointers are 24-bit by default) in the PCH compiler's manual or in this forum. Hopefully, I have just missed something obvious. Smile

I am using PCH Compiler v4.055 and my uC is the PIC18F6722. This PIC has 128 KiB of Program Flash (0x00000 - 0x1FFFF).

So far, I have not been able to determine how to place anything in the second 64 KiB of the Program Flash since it requires a 17th bit of addressing. And, from my testing, it appears that generated code also does not get placed in that address range.

My problem is that I have a large number of fonts and images that my application requires and I am currently right on the edge of 50% usage of the Program Flash. Minor changes like adding a simple printf() are now causing my application to fail to build with errors indicating lack of space. This is very annoying since I have a large amount of unused capacity just sitting there.

Any suggestions or guidance would be greatly appreciated.

Cheers,
James
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 21, 2008 1:15 pm     Reply with quote

Are you using #org statements for the fonts, etc. ?
If so, post some of them.
Guest








PostPosted: Mon Jul 21, 2008 1:26 pm     Reply with quote

Here are a few characters from the small font set. All of the fonts and images use the same technique to load them into memory from a header file.

/* A */
#ROM 0x0d1f0={0x0000, 0x0f00, 0x00ff, 0x00f0, 0xfff0, 0xf0ff, 0x00f0, 0xf0f0, 0xf000, 0x0000, 0x0000}
/* B */
#ROM 0x0d1d8={0x0000, 0xff00, 0x00ff, 0x00f0, 0xfff0, 0x00ff, 0x00f0, 0xfff0, 0x00ff, 0x0000, 0x0000}
/* C */
#ROM 0x0d1c0={0x0000, 0x0f00, 0xf0ff, 0x00f0, 0xf000, 0x0000, 0x00f0, 0x0f00, 0xf0ff, 0x0000, 0x0000}
/* D */
#ROM 0x0d1a8={0x0000, 0xff00, 0x00ff, 0x00f0, 0xf0f0, 0xf000, 0x00f0, 0xfff0, 0x00ff, 0x0000, 0x0000}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 21, 2008 2:29 pm     Reply with quote

I made a little test program and I blocked the compiler from using the
first 64K of the flash with an #org statement.
Code:
#include <18F6722.h>
#fuses XT, NOWDT, PUT, BROWNOUT, NOLVP 
#use delay(clock=4000000)

#org 0x0008, 0xFFFE {}

//=============================
void main(void)
{

while(1);
}


Here's the .LST file for it, and it's using the upper 64K with
no problem. This test was done with your version, 4.055.
I stepped through the .LST file code with the MPLAB simulator
and it steps OK. Your contention is that the compiler is not
using the upper 64K, but based on this test, it will use it.
Code:
00000:  GOTO   10000
.................... 
.................... #org 0x0008, 0xFFFE {}
.................... 
.................... void main(void) 
.................... { 
10000:  CLRF   FF8
10002:  BCF    FD0.7
10004:  CLRF   FEA
10006:  CLRF   FE9
10008:  MOVF   FC1,W
1000A:  ANDLW  C0
1000C:  IORLW  0F
1000E:  MOVWF  FC1
10010:  MOVLW  07
10012:  MOVWF  FB4
.................... 
.................... 
.................... while(1);
10014:  GOTO   10014
.................... } 
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