Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20688

BASCOM-AVR : I2creceive word variable bytes reversed : NEWTOPIC

$
0
0
I am having a problem with I2creceive using a word variable the two bytes are reversed. [code:1:e8b556145f] Dim Max1239lh(2) As Byte At Max1239b Overlay Dim Max1239b As Word I2creceive Rdmax1238 , Max1239b Swap Max1239lh(1) , Max1239lh(2) Print ">>>" ; Bin(max1239b) [/code:1:e8b556145f] Now if I do not swap the two bytes of the word they are reversed example If you ground the input to the ADC you get a zero count but the first four bits of the first byte the ADC sends are always "1111" so the two bytes are 11110000 00000000 but the word contains 0000000011110000 so I have to swap the bytes this seems wrong to me or am I miss understanding something. Regards Paul [b:e8b556145f][color=red:e8b556145f](BASCOM-AVR version : 2.0.7.6 )[/b:e8b556145f][/color:e8b556145f]

Viewing all articles
Browse latest Browse all 20688

Trending Articles