RCO
Joined: 04 Apr 2007 Posts: 3
|
code and new observations |
Posted: Thu Apr 05, 2007 11:16 am |
|
|
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]);
}
} |
|