Word array behaving like byte array.... wierd
Hi there,
I have a piece of code which looks like thus:
<code>
Sample_Buffer[Sample_Index] = ADC_Buffer
</code>
All of these variables are declared as variables. When I check the data, Sample_Buffer[Sample_Index] is always less then 256, although I know that the data in ADC_Buffer is often higher then this.
I have tested it by changing the code to this:
<code>
if ADC_Buffer > 255 then
lcdout cmd, cls, "BIG NUM"
endif
sample_buffer[sample_index] = adc_buffer
</code>
And sure, enough, "BIG NUM" is spat out on the LCD. If I use the same check for the Array Variable after copying the data into the array, it always comes back as being < 256.
Where is the other half of my word going??? Has anyone else seen similar behaviour? Am I doing something really stupid?
EDIT: This is on an 18f452, using PBP 2.43
Nope, thats a constant....
Lol I don't think PBP would compile if it were a VAR... nope, it's a constant and it's equal to 300.