Variable's Nibbles Copied Onto Pins
![John Kauffman](https://forums.parallax.com/uploads/userpics/555/nZBNEPT0B6FMD.jpg)
Variable's Nibbles Copied Onto Pins
·
I am trying to get the Parallax LCD AppMod to work with an SX (Tech Tool). The SX/B help example uses 8 wire bus, but the AppMod is supposed to work on 4 wire bus as well. An earlier post helped with the masking technique.
·
I built a cable/adaptor that connects equivalent number pins from AppMod header to the SX RB pins.
·
In the SX/B program the character to display is held in a byte variable named Char as an ASCII value. The LCD AppMod expects to get that a byte across a 4-wire bus (RB.4-RB.7) in two reads: one read for the high nib and then a second read to get the low nib.
·
I see the masking ·/ swap trick to get the nibbles, but I don't see how to copy that value from the variable onto the four bus pins. It seems there should be a way to set the top four pins of RB to be equal to the masked value in Char. Is the syntax something like the lines that start with ???
·
Char················ var······ byte
??? LcdBusOut··········· var······ RB.high
·
Char = %10000001···· ' = 65 = "A"
·
??? LcdBusOut = Char & $F0 ' put value of Char high nibble into bus pins
PULSOUT LcdEnable, 3 ······· ··········· ' Tell the AppMod to read the data bus
SWAP Char···························· ··········· ' swap low & high nib
??? LcdBusOut = Char & $F0 ' put value of Char low nibble into bus pins
PULSOUT LcdEnable, 3 ······· ··········· ' Tell the AppMod to read the data bus
·
THanks.
·
I am trying to get the Parallax LCD AppMod to work with an SX (Tech Tool). The SX/B help example uses 8 wire bus, but the AppMod is supposed to work on 4 wire bus as well. An earlier post helped with the masking technique.
·
I built a cable/adaptor that connects equivalent number pins from AppMod header to the SX RB pins.
·
In the SX/B program the character to display is held in a byte variable named Char as an ASCII value. The LCD AppMod expects to get that a byte across a 4-wire bus (RB.4-RB.7) in two reads: one read for the high nib and then a second read to get the low nib.
·
I see the masking ·/ swap trick to get the nibbles, but I don't see how to copy that value from the variable onto the four bus pins. It seems there should be a way to set the top four pins of RB to be equal to the masked value in Char. Is the syntax something like the lines that start with ???
·
Char················ var······ byte
??? LcdBusOut··········· var······ RB.high
·
Char = %10000001···· ' = 65 = "A"
·
??? LcdBusOut = Char & $F0 ' put value of Char high nibble into bus pins
PULSOUT LcdEnable, 3 ······· ··········· ' Tell the AppMod to read the data bus
SWAP Char···························· ··········· ' swap low & high nib
??? LcdBusOut = Char & $F0 ' put value of Char low nibble into bus pins
PULSOUT LcdEnable, 3 ······· ··········· ' Tell the AppMod to read the data bus
·
THanks.
Comments
· SX/B does not have a "Nibble" variable·type.
· You'll need to do it in several steps.
·
·Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
Post Edited (Bean (Hitt Consulting)) : 3/26/2008 11:13:54 AM GMT