byte1 byte2 XXX00000 xxx11111 start state X = can not be changed. x = not used What I'm trying to do is scroll one alphanumeric character across a 5x7 LED matrix. The bytes returned from the lookup table are structured as follows. The bottom 5 bits of portB (16F84) are connected to columns 1 to 5 of the display. The upper 3 bits drive a 74138, 3 to 8 line decode which drives rows 1 to 7 of the display. To display a character all I do is just keep on looping and sending out the 7 bytes needed. As you can see, the top 3 bits can not be touched as they control which row to light. Now to make a character scroll across the display I need to shift the 5 bit value in starting at bit0 through to bit5 and out.
That being the case, I don't understand why the top three bits of byte 2 need to be excluded. Seems like it would be simpler to just preshift the data in your table by three bits left and then just load carry on each loop by shifting it once more to the left to be setup for (Oliver or Demitry's) rlf byte1,W ;get new bit from carry xorwf byte1,W ;get difference andlw B'00011111' ;0's will mask unchanged bits xorwf byte1,F ;update only required bits or was that what you ment when you said, "byte 2 is just for my example"? --- James Newton mailto:jamesnewton@geocities.com 1-619-652-0593 http://techref.massmind.org All the engineering secrets worth knowing -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu