打印

3K左右的程序,编辑时超过16K?

[复制链接]
3155|8
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
action99|  楼主 | 2008-11-3 14:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我加了LCD显示后发现整个程序大于16K了,编辑出错,但我的程序最多只有3K,为什么会超过16K的,我用的是18F4423,请大哥指教一下, 部分程序如下:
#pragma code

unsigned char StepCount;     


unsigned char receive_buff;    

unsigned char ad_chanel;    
    

unsigned short long  a164;          //0x98 0x99 0x9a

unsigned int AD_total;
unsigned char rx_232_cnt;        //@0xa0
char rx_232_buf;        //0x102
unsigned short long a164_buf;
signed   long kb;
int MixPrecent;
int MaxPrecent;
int Res;
char Sign;
unsigned char Time0_cnt;

char ResResult[6];

unsigned char Disp_Data_Buff[16];
unsigned char ResultSign[13];
unsigned char ReadBCD[18];
unsigned int AD_Up_DATA[4];
unsigned int AD_DOWN_DATA[4];
unsigned int AD_LEFT_DATA[4];
unsigned int AD_RIGHT_DATA[4];

unsigned  char sin[6]=
{97,98,99,100,101,35};
#pragma code
/*--  文字:  上  --*/
/*--  宋体11;  此字体下对应的点阵为:宽x高=14x14   --*/
/*--  高度不是8的倍数,现调整为:宽度x高度=14x16  --*/

unsigned rom far char up_array[28]={
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x10,0x10,0x10,0x10,0x00,0x00,0x00,
0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0x10,0x10,0x10,0x10,0x10,0x10,0x00
};
unsigned rom far char seun_array[28]={
0xFf,0x01,0x11,0x2d,0xc3,0x00,0xff,0x49,0x49,0x49,0xc9,0x7f,0x00,0x00,
0x1f,0x02,0x04,0x02,0x01,0x00,0x1f,0x09,0x02,0x05,0x08,0x18,0x08,0x00
};
unsigned rom far char down_array[28]={
0x01,0x01,0x01,0x01,0x01,0xff,0x01,0x11,0x21,0x41,0xc1,0x01,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

unsigned rom far  char dot_array[12]={
0x00,0x00,0x18,0x18,0x00,0x00,
0x00,0x00,0x03,0x03,0x00,0x00
};

unsigned rom far char Big_0_array[14]={
0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
0x03,0x04,0x08,0x08,0x04,0x03,0x00

};

unsigned rom far char Big_1_array[14]={
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,
0x00,0x08,0x08,0x0F,0x08,0x08,0x00
};
unsigned rom far char Big_2_array[14]={
0x00,0x30,0x08,0x08,0x88,0x70,0x00,
0x00,0x0C,0x0A,0x09,0x08,0x0C,0x00
};
unsigned rom far char Big_3_array[14]={
0x00,0x30,0x08,0x48,0x48,0xB0,0x00,
0x00,0x06,0x08,0x08,0x08,0x07,0x00
};
unsigned rom far char Big_4_array[14]={
0x00,0xC0,0x20,0x10,0xFC,0x00,0x00,
0x01,0x02,0x02,0x0A,0x0F,0x0A,0x00
};
unsigned rom far char Big_5_array[14]={
0x00,0xF8,0x48,0x48,0x48,0x88,0x00,
0x00,0x06,0x08,0x08,0x08,0x07,0x00
};
unsigned rom far char Big_6_array[14]={
0xE0,0x90,0x48,0x48,0x48,0x98,0x00,
0x07,0x08,0x08,0x08,0x08,0x07,0x00
};
unsigned rom far char Big_7_array[14]={
0x00,0x38,0x08,0x88,0x68,0x18,0x00,
0x00,0x00,0x00,0x0F,0x00,0x00,0x00
};
unsigned rom far char Big_8_array[14]={
0x30,0xC8,0x88,0x88,0xC8,0x30,0x00,
0x07,0x08,0x08,0x08,0x08,0x07,0x00
};
unsigned rom far char Big_9_array[14]={
0xF0,0x08,0x08,0x08,0x88,0xF0,0x00,
0x0C,0x09,0x09,0x09,0x04,0x03,0x00
};
unsigned rom far char Big_dot_array[6]={
0x00,0x00,0x00,
0x00,0x0C,0x0C
};
unsigned rom far char Big_small_array[4]={
0x00,0x60,0x60,0x00
};
unsigned rom far char Small_N1_array[8]={
0x00,0x84,0xfe,0x80,0x00,0x00,0x00,0x7F};
unsigned rom far char Small_N2_array[8]={
0x00,0xC4,0xA2,0x92,0x8C,0x00,0x00,0x7F};
unsigned rom far char Small_N3_array[8]={
0x00,0x44,0x92,0x92,0x6c,0x00,0x00,0x7f};
unsigned rom far char Small_N4_array[8]={
0x30,0x28,0x24,0xfe,0x20,0x00,0x00,0x7f};
unsigned rom far char Small_0_array[6]={
0x00,0x7c,0x82,0x82,0x7c,0x00};
unsigned rom far char Small_1_array[6]={
0x00,0x84,0xfe,0x80,0x0,0x00};
unsigned rom far char Small_2_array[6]={
0x00,0xc4,0xa2,0x92,0x8c,0x00};
unsigned rom far char Small_3_array[6]={
0x00,0x44,0x92,0x92,0x6c,0x00};
unsigned rom far char Small_4_array[6]={
0x30,0x28,0x24,0xfe,0x20,0x00};
unsigned rom far char Small_5_array[6]={
0x00,0x4e,0x8a,0x8a,0x72,0x00};
unsigned rom far char Small_6_array[6]={
0x7c,0x92,0x92,0x92,0x60,0x00};
unsigned rom far char Small_7_array[6]={
0x00,0x02,0xf2,0x0a,0x06,0x00};
unsigned rom far char Small_8_array[6]={
0x00,0x6c,0x92,0x92,0x6c,0x00};
unsigned rom far char Small_9_array[6]={
0x00,0x0c,0x92,0x92,0x7c,0x00};



#pragma code 

void main(void){
    Delay1KTCYx(200);    //40ms
    Init();    
    GetBCD();
    GetBCD();
    GetBCD();    
    LCD_Init();
  while(1){       
    StartSing();

    if(F0.Bit.START)ad_action();

    if(F0.Bit.Send_PC)SendRS232();
    
    if(F1.Bit.Send_PLC)SendPLC();

   // Disp_Result();
    }
}

。。。。。。。
。。。。。。。
下面一共有2000行的程序。。程序应该不可能会超过16K的,请高手指点。。。

 
沙发
action99|  楼主 | 2008-11-4 08:15 | 只看该作者

是不是我的编译器的问题?

我用的是PIC18F4423,MCC18的编译器,他过期了吗,还是最多只能编译2K的程序?

使用特权

评论回复
板凳
兰天白云| | 2008-11-4 09:50 | 只看该作者

试用版吧

使用特权

评论回复
地板
action99|  楼主 | 2008-11-4 11:02 | 只看该作者

大哥,请问那有免费版的。。小弟急需

大哥,请问那有免费版的。。小弟急需

使用特权

评论回复
5
action99|  楼主 | 2008-11-4 14:05 | 只看该作者

大家帮帮我呀,有什么办法

大家帮帮我呀,有什么办法?我用了“正版MCC18_V3.00安装”可以编辑其他型号的芯片,但如果我使用18F4423这个芯片的时候一定要用“MPLAB-C18-Upgrade-v3_16”编译器才可以使用的。但是这个编译器是有限制的,怎么样才可以**?急。。。。。

使用特权

评论回复
6
action99|  楼主 | 2008-11-4 14:55 | 只看该作者

用这个软件mplab_c18_v3_patch确解也不行

用这个软件mplab_c18_v3_patch确解也不行,在编译时也会出错的,
出错如下:
E:lcdmain.c:1406:Error [1033] preprocessor can only input one file at a time
Halting build on first failure as requested.
BUILD FAILED: Tue Nov 04 14:50:10 2008
为什么会这样的?高手指教。。。

使用特权

评论回复
7
iceweb| | 2008-11-4 18:39 | 只看该作者

PIC 单片机

有什么办法?我用了“正版MCC18_V3.00安装”可以编辑其他型号的芯片,但如果我使用18F4423这个芯片的时候一定要用“MPLAB-C18-Upgrade-v3_16”编译器才可以使用的。但是这个编译器是有限制的,怎么样才可以**?急。。。。。

使用特权

评论回复
8
action99|  楼主 | 2008-11-5 09:43 | 只看该作者

自顶一个。。。希望有高手能帮助

自顶一个。。。希望有高手能帮助

使用特权

评论回复
9
action99|  楼主 | 2008-11-6 14:53 | 只看该作者

这样的程序编译后达到6.3K.请大家来看看,

这个程序是我驱动一个128*64的LCD的,编译通过了但程序量大了,达到6.3K,大家帮我看看那里能完善的地方?谢谢,,上面的问题已经找到就是我的ROM超出了,我的MCU最大是8K,
相关链接:https://bbs.21ic.com/upfiles/img/200712/2007122215624482.rar

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

87

主题

189

帖子

2

粉丝