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

CONST limitations (page 216)

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



Joined: 04 Apr 2007
Posts: 3

View user's profile Send private message

CONST limitations (page 216)
PostPosted: Wed Apr 04, 2007 4:42 pm     Reply with quote

Issue with CONST

I notice the following:

You can't use data types above 16 bits.

This is in contradiction to page 216 of Reference manual:

... may be used with any data type ...

I also get garbage during debug for table values. This applies to global and local.

Comments?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 04, 2007 4:45 pm     Reply with quote

Debug with what IDE, CCS or MPLAB ?
What version ?
What version of the compiler ?

Post a small (very small) program that shows the problem.
Describe the steps taken to see the problem.
RCO



Joined: 04 Apr 2007
Posts: 3

View user's profile Send private message

code and new observations
PostPosted: Thu Apr 05, 2007 11:16 am     Reply with quote

Debug with what IDE, CCS or MPLAB ? : CCS
What version ? :

IDE: 3.40
PCB: 3.180
PCM: 3.180

What version of the compiler ?

PCW Compiler: C Language

Post a small (very small) program that shows the problem.
Describe the steps taken to see the problem.:

Edits:
1: Part of the issue was the size of the Table (apparently there is a 256 byte limit). If the ceiling is observed, 32 bit types are OK

2. I do still get garbage on mouse overs and watches for table elements.

3. for timmy and TIMES1 I get nothing on mouse over. This is before and after running to a breakpoint.

The CONST size is apparently 8 bits.

Code

#include <demobrd.h>
#include <stdlib.h>

int16 overflow_cnt;
int16 intermed,intermed1;
int lastrnd,p;

int32 CONST TIMES[64]={
3906,3946,3986,4027,4069,4112,4156,4200,
4246,4293,4340,4389,4439,4490,4542,4596,
4650,4706,4764,4823,4883,4945,5008,5073,
5140,5208,5279,5351,5425,5502,5580,5661,
5744,5830,5919,6010,6104,6200,6300,6404,
6510,6621,6735,6853,6975,7102,7234,7370,
7512,7659,7813,7972,8138,8311,8492,390625};

int reading1,i;

main ()
{
While (TRUE)
{
long k,l;


int16 CONST TIMES1[127]={
3906,3946,3986,4027,4069,4112,4156,4200,
4246,4293,4340,4389,4439,4490,4542,4596,
4650,4706,4764,4823,4883,4945,5008,5073,
5140,5208,5279,5351,5425,5502,5580,5661,
5744,5830,5919,6010,6104,6200,6300,6404,
6510,6621,6735,6853,6975,7102,7234,7370,
7512,7659,7813,7972,8138,8311,8492,8681,
8878,9084,9301,9527,9766,10016,10280,10557,
10851,11161,11489,11837,12207,12601,13021,13470,
13951,14468,15024,15625,16276,16984,17756,18601,
19531,20559,21701,22978,24414,26042,27902,30048,
32552,35511,39063,43403,48828,55804,65104,78125,
97656,130208,195313,390625};



int32 CONST timmy[8]={101,2,301,4,5,6,7,8};

for (i=0;i<7;i++) printf("timmy (%u): %lu \n",i,timmy[i]);

for (i=0;i<63;i++) printf("TIMES (%u): %lu \n",i,TIMES[i]);

for (i=0;i<63;i++) printf("TIMES1 (%u): %lu \n",i,TIMES1[i]);
}
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 05, 2007 11:23 am     Reply with quote

Your "int16 CONST TIMES1" array initialization code has five values at
the end that are larger than an int16 variable can hold.


It's possible that vs. 3.180 of the IDE had a bug in it. The comment
that CCS has in their old versions page, that's near to your version, is
this one:
Quote:
3.186 Various debugger issues have been resolved in PCW/PCWH
RCO



Joined: 04 Apr 2007
Posts: 3

View user's profile Send private message

Bit-Mitt
PostPosted: Thu Apr 05, 2007 12:35 pm     Reply with quote

Yes, I am aware.

I will test the catch-all. How do I upgrade?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 05, 2007 12:42 pm     Reply with quote

Here is their pricing page:
http://www.ccsinfo.com/index.php?cPath=Store&view=tree
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