In SX Microcontrollers, SX/B Compiler and SX-Key Tool, John Kauffman wrote:
[3]Variable's Nibbles Copied Onto Pins[/3]
[3] [/3]
[3]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.[/3]
[3] [/3]
[3]I built a cable/adaptor that connects equivalent number pins from AppMod header to the SX RB pins. [/3]
[3] [/3]
[3]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.[/3]
[3] [/3]
[3]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 ???[/3]
[3] [/3]
[3]Char var byte[/3]
[3]??? LcdBusOut var RB.high[/3]
[3] [/3]
[3]Char = %10000001 ' = 65 = "A"[/3]
[3] [/3]
[3]??? LcdBusOut = Char & $F0 ' put value of Char high nibble into bus pins[/3]
[3]PULSOUT LcdEnable, 3 ' Tell the AppMod to read the data bus[/3]
[3]SWAP Char ' swap low & high nib [/3]
[3]??? LcdBusOut = Char & $F0 ' put value of Char low nibble into bus pins[/3]
[3]PULSOUT LcdEnable, 3 ' Tell the AppMod to read the data bus[/3]
[3] [/3]
THanks.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=259841
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)