Help Joining Nibbles
GrimChild
Posts: 3
lcdbits VAR Byte n1 VAR Nib tempbyte VAR Byte Main: lcdbits=%01000111 n1= %1000 tempbyte=[noparse][[/noparse]n1+lcdbits.LOWNIB] DEBUG ? tempbyte END
I'm trying to concatenate 2 nibbles without much luck.
..instead of joining the low and high nibs it appears to be adding them.
taking n1 as 1000
and the low nib of lcdbits 0111
the output should be %10000111
thanks for the help .
Comments
It sounds like you want to do "tempbyte.lownib = lcdbits.lownib", then "tempbyte.highnib = n1.lownib".
i'm aware that you can change the upper/lower nibbles
.but im wondering if you can concatenate them as you would with String manipulation.
..I have alternatives, but doing it this way would lessen the code
..as lcdbits.HIGHNIB constantly changes and lcdbits.LOWNIB changes on occasion
..yet the output needs to be 8 bits
can SHIFTOUT send only 4 bits ? or does it have to be 8 ?
i'm using the 74hc595 and sending 2 sets of nibbles then latching fails.
either solution would work i suppose.
SHIFTOUT can send any number of bits up to 16. Look at the chapter in the Manual on SHIFTOUT. You'll see a "\" suffix that lets you specify the number of bits.
i'll be needing your help in the future im sure [noparse]:)[/noparse]