Dear all,
I read this tutorial and I was confused about the MSBFIRST/LSBFIRST. Can anyone provide me an example how to illustrate the difference between this two ? If my number is 00000001, then it will shift the 0 first if it is MSBFIRST ? If my LEDs are numbered 1 to 8 from left to right assuming the most right is the LSB. So, I am confuse here.
"If my number is 00000001, then it will shift the 0 first if it is MSBFIRST ?" Yes.
"If my LEDs are numbered 1 to 8 from left to right assuming the most right is the LSB." So number them 7 to 0 from left to right. Then they will match up with your data. The lowest place of anything should always be position 0.
Look at how the data goes thru the shift register as well - from Qa to Qh. So Qa is the LSB and Qh is the MSB.
So your example 00000001 will end with Qh-g-f-e-d-c-b-a as 0-0-0-0-0-0-0-1.
I get confused to.
what I usually do is just do it with either LSB or MSB first.
if that doesn't work right, just do the other one.
It's a 50 50 chance you'll end up with the right one
CrossRoads:
"If my number is 00000001, then it will shift the 0 first if it is MSBFIRST ?" Yes.
"If my LEDs are numbered 1 to 8 from left to right assuming the most right is the LSB." So number them 7 to 0 from left to right. Then they will match up with your data. The lowest place of anything should always be position 0.
Look at how the data goes thru the shift register as well - from Qa to Qh. So Qa is the LSB and Qh is the MSB.
So your example 00000001 will end with Qh-g-f-e-d-c-b-a as 0-0-0-0-0-0-0-1.
So if MSB first, suppose the sequence should be reverse ? Assuming the data shift from left to right. So MSB first means Qh first and Qh will get shifted to the LSB position isnt that ?