Ok....I'm sort of confused....about getting bit value.
James Long
Posts: 1,181
Ok....so I'm working with a chip that places a 1 into bit #2 of a word.
I have included the code I'm trying to look at this bit with....but I'm concerned it not actually working the way I need it to.
It is in spin.....so you asm guys cut me some slack.
James L
I have included the code I'm trying to look at this bit with....but I'm concerned it not actually working the way I need it to.
It is in spin.....so you asm guys cut me some slack.
I'm wondering if I'm even close.....maybe I should have stuck with stamps.· outa[noparse][[/noparse]CH1]~
· goodch1 := (bs2.shiftin(SDI, SCL, bs2#MSBPRE, 16))
· outa[noparse][[/noparse]CH1]~~
· if goodch1.byte[noparse][[/noparse]0] & |<2
··· serial.tx(set_colorh)
··· serial.tx(greenh)
··· serial.tx(greenl)
· else
··· serial.tx(set_colorh)
··· serial.tx(redh)
··· serial.tx(redl)
James L
Comments
Mike
Wouldn't bit #2 be on the lower end of the word?
Also....since this data is coming in MSB.....would that make it backwards.....
I'm tried the suggested way first.....but didn't seem to work....but this is not the only part that is confusing.
Just to make sure....the bits are numbered· 0 - 15 ....right?
I want to ensure I'm getting all the terminology right.
James L
Post Edited (James Long) : 2/17/2007 6:58:13 PM GMT
I checked the datasheet....and the word is numbered from MSB to LSB (D15 to D0)
So I figure the least significate would be on the bottom end....or the last recieved by the Propeller. Which I would calculate would be the lower end of byte[noparse][[/noparse]0].
But I seem to not be recieving any 1's from the chip. Seems to only give zero's by the few tests I have run, which all may be wrong.
The shiftin method should put the bits in order with the MSB being to the left. That is why I calculate the LSB being to the farthest to the right. (Which I assume is the byte[noparse][[/noparse]0]).
I have to get an oscope to insure the chip is outputing data.
James L