Hi all,
I've got a 20x4 LCD running parallel with a 20M2. I've done a few 40X2's & 18X's parallel before, without too many issues, using B.4=DB4, B.5=DB5, B.6=DB6, & B.7=DB7 of the 40X2 so works basically as per the Picaxe Manual-3 as is, but this time I needed to configure the LCD to the LHS of the 20M2 pic, whereby C.4=DB4, C.3=DB5, C.2=DB6, & C.1=DB7.
So, I figured that to match the nibble pulseouts to the correct LCD pins, I had to reverse the binary number and then shift it one up on the pic...
eg: the letter "T" is %01010100, so this becomes %00101010 but pulsing it as is, it wont align to C1-C4, so shifting it up (*2) will align it (now high nibble is 01010 & low nibble is 01000) and then I use a mask %00011110.
It might make more sense if you look at the code?
... but, I just get the infamous 1st & 3rd lines showing blocks! I've tried hard coding a few binary numbers for the characters instead of calculating, and sometimes I get lines 2 & 4 as 1/2 blocks (as well as lines 1 & 3 full blocks!) So I'm sure it's something in the code & not the wiring, but probably not seeing the forest for the trees!
It's annoying me, so am determined to not re-wire it to the RHS of the PIC or to use serial, as no doubt it's something simple!
Does anybody spot anything obvious?
I've got a 20x4 LCD running parallel with a 20M2. I've done a few 40X2's & 18X's parallel before, without too many issues, using B.4=DB4, B.5=DB5, B.6=DB6, & B.7=DB7 of the 40X2 so works basically as per the Picaxe Manual-3 as is, but this time I needed to configure the LCD to the LHS of the 20M2 pic, whereby C.4=DB4, C.3=DB5, C.2=DB6, & C.1=DB7.
So, I figured that to match the nibble pulseouts to the correct LCD pins, I had to reverse the binary number and then shift it one up on the pic...
eg: the letter "T" is %01010100, so this becomes %00101010 but pulsing it as is, it wont align to C1-C4, so shifting it up (*2) will align it (now high nibble is 01010 & low nibble is 01000) and then I use a mask %00011110.
It might make more sense if you look at the code?
... but, I just get the infamous 1st & 3rd lines showing blocks! I've tried hard coding a few binary numbers for the characters instead of calculating, and sometimes I get lines 2 & 4 as 1/2 blocks (as well as lines 1 & 3 full blocks!) So I'm sure it's something in the code & not the wiring, but probably not seeing the forest for the trees!
It's annoying me, so am determined to not re-wire it to the RHS of the PIC or to use serial, as no doubt it's something simple!
Does anybody spot anything obvious?
Attachments
-
6.3 KB Views: 13