Array values changing


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Posts
    11

    Thumbs down Array values changing

    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.

    Code:
            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?

  2. #2
    Join Date
    Oct 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    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.
    Last edited by MyBuddy; - 29th October 2009 at 23:21.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Simple Array Demo
    By Archangel in forum Code Examples
    Replies: 5
    Last Post: - 15th February 2010, 04:46
  3. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  4. Reading Array values into variables
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 21st March 2005, 10:30
  5. Putting values into an array
    By Vince in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd December 2003, 07:22

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts