|
|
View previous topic :: View next topic |
Author |
Message |
guest Guest
|
Array problem |
Posted: Wed Mar 02, 2005 10:48 am |
|
|
Hi,
I have a working code for 16F873A with variable list at bottom. When I changed line with comment out to:
int16 meanval[12];
it can compile without error but it doesn't work even array doesn't use anywhere in code.
Do you have an idea about this problem's reason ?
Thank you
zek
#include "C:\Program Files\PICC\Projects\kd\kd.h"
byte const dissel[3] ={0xEF,0xFB,0xDF};
int32 adctop;
int16 adcval,adcftn,zcr1;
//int16 meanval[12];
int chno=0,flags1=0,flags2=0,gw=0;
int trout=0,trset=0,trval=0,trwait=0,newolc=0;
int disidx=0,keywait=0,flcnt=0,keys=0;
int adc_seq=0,new_seq=255,mper=7,topcnt;
int disbuf[3];
int flmask[3]; |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Wed Mar 02, 2005 12:32 pm |
|
|
12*16=192
The compiler trys to put it in 1 contigious area.
http://ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf
page 18,19,20
I think your limit will be 16+80+16=112 bytes of bank 2 or 3.
Perhaps you can have more than one aray??
It then would not have to be in one area.
Last edited by treitmey on Thu Mar 03, 2005 8:36 am; edited 1 time in total |
|
|
Guest
|
|
Posted: Thu Mar 03, 2005 3:58 am |
|
|
Thank you for your support
I looked up to 39582b and I decided to add a #locate command to end of variable list and problem disappeared. (code start to work again with array)
Array located to start of second page.
Thank you again
Zek
----------------------------------------------------------
#include "C:\Program Files\PICC\Projects\kd\kd.h"
byte const dissel[3] ={0xEF,0xFB,0xDF};
int32 adctop;
int16 adcval,adcftn,zcr1;
int16 meanval[12];
int chno=0,flags1=0,flags2=0,gw=0;
int trout=0,trset=0,trval=0,trwait=0,newolc=0;
int disidx=0,keywait=0,flcnt=0,keys=0;
int adc_seq=0,new_seq=255,mper=7,topcnt;
int disbuf[3];
int flmask[3];
#locate meanval = 0xA0 |
|
|
|
|
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
|