PDA

View Full Version : Array values changing



MyBuddy
- 29th October 2009, 22:34
PBP 2.46
18F4550

I have this large array in which I load values from EEPROM. Everything loads in fine, and I have verified that the contents are correct. The array is defined as:

Temp_Calib var byte[44]

When I run the code below, the first two entries of the array change even though there is no read or write call to the Temp_Calib array. I know the value is changing here because of the debugs before and after the loop.


debug " 0: Temp_Calib[0]: ",#Temp_Calib[0],10,13
for j = 0 to 11
ADCIN ad597, advalue[j]
next j
debug " 1: Temp_Calib[0]: ",#Temp_Calib[0],10,13

Here is the output I see:

0: Temp_Calib[0]: 10
1: Temp_Calib[0]: 128

What the f-? Am I out of ram?

MyBuddy
- 29th October 2009, 23:13
the other array is initialized here:

AdValue var WORD[12]

Edit: never mind ... I figured it out simply by typing it correctly in the forum. The loop in my program was going from 1 to 12 instead of 0 to 11.