In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: To get the low nib from a byte you need to mask the byte with $0F to strip off the upper bits. To get the high nib (into the low nib position), use SWAP, then mask the value. If all of your LCD connctions are on the same port, RB for example, then you need to put the current state of the control lines (E, RS, RW) into the byte that you'll write to the port -- all of this stuff takes place "behind" the scenes in the BASIC Stamp when writing to NIB ports (e.g., OUTA, OUTB, etc.) because the hardware underneath only supports 8-bit ports. This is off the top of my head, but may be helpful. It shows, though, that copying the four bits -- one at a time -- may actually be the most efficient. [code]LCD_OUT: lcdCtrl = char & $F0 lcdCtrl.1 = E lcdCtrl.2 = RW lcdCtrl.3 = RS RB = lcdCtrl BLIP_E lcdCtrl = char & $0F SWAP lcdCtrl lcdCtrl.1 = E lcdCtrl.2 = RW lcdCtrl.3 = RS RB = lcdCtrl BLIP_E RETURN [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=161442#m161528 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)