With EncodedData var word [4] you have 4 words total in the array.
EncodedData[0]
EncodedData[1]
EncodedData[2]
EncodedData[3]
Now with;
mydata [0]= "T"
mydata [1]= "E"
mydata [2]= "S"
mydata [3]= "T"
mydata [4]= "."
If each byte in mydata gets encoded as 2 bytes, you're going to need more
than 4 words or 8 bytes to store your encoded data in.
So, when mydatactr is 4, and you jump to your encode routine;
encodeddata.lowbyte[mydatactr]=manchesterword.lowbyte
encodeddata.highbyte[mydatactr]=manchesterword.highbyte
It's placing the encoded value outside your EncodedData word array. I.E. you
now have two bytes of data in RAM out-of-bounds of your array.
You can, but you need to make sure you don't exceed the array boundary.You mean you can't use a zero for an array pointer?
A 4 word array only goes from 0 to 3. Not 0 to 4.
Bookmarks