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 CCS Technical Support

Array problem

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







Array problem
PostPosted: Wed Mar 02, 2005 10:48 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Wed Mar 02, 2005 12:32 pm     Reply with quote

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








PostPosted: Thu Mar 03, 2005 3:58 am     Reply with quote

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
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