ByVac IASI-2 Commands for HD47780 LCD Displays

 

Many of my projects use 20x4 or 20x2 LCD displays with a ByVac IASI-2 serial interface. Although this particular serial interface is no longer available, this page is a useful reference for converting my program code to use a more conventional serial LCD display or even a parallel display. Knowing what the code in my programs does should make it easier to convert it.

Depending on whether you're converting code for the Arduino or the Picaxe determines the actual code. Typically Picaxe code will be something like serout B.7,N2400,(...) and Arduino code will be something like lcd.print(...);

All we're interested in here is what's inside the parenthesis.

The ByVac IASI-2 interface accepts three kinds of strings as ASCII characters - backlight control commands, cursor control commands and text/numerical values.

All strings begin with the serial interface address which, in my programs, is always represented by the ASCII letter "a". The second character in the string depends on what kind of data is being sent to the display:

Backlight control commands use the ASCII character "b". So, to turn the backlight off, you would send the string "ab0" and to turn it on, "ab1".

Cursor control commands use the ACSII character "c". So, for example, the string "ac1" clears the display and sets the cursor at the top left. Most commands are associated with positioning the cursor in readiness for printing text or numerical values on the LCD. The tables below show all the most-used commands. So, for example, the string "acd4" would position the cursor at the beginning of the bottom row on the LCD.

Text and numerical values begin with "ad" so the string "adHello World" would send 'Hello World' to the LCD.

It's important to note that the string must be followed by the 'Return' character. For the Arduino, this will be "\r" and, for the Picaxe, the numerical value 13.

The Arduino doesn't seem to allow text and numerical values to be mixed in the same statement so it's common to see 'compound' lines broken down. For example:

Arduino:                                     
  lcd.print("adVoltage: ");                       
  lcd.print(measured_volts);                   
  lcd.print(" volts\r");


Hopefully, the above information and the following tables will be enough to allow you to convert the LCD code I've used in my programs to code you need to use for your LCD display.

CommandBacklight
ab0Backlight OFF
ab1Backlight ON

CommandCursor/Text Reset
ac1Clear display, Cursor Home
ac2Cursor Home. Resets display to match DDRAM

CommandCursor Type & Display Control
acaDisplay OFF (Any other command = display ON)
accCursor OFF
acdCursor OFF, Block Blink
aceCursor ON
acfCursor ON, Block Blink

CommandCursor/Text Shift (Rotate) - next 'Write' shows effect
(DDRAM is changed)
ac4Cursor moves left. Text reversed
ac5Cursor moves left. Text shifts left
ac6Cursor moves right. Text normal
ac6Cursor moves right. Text shifts left

CommandCursor/Text Shift (Rotate) -Immediate effect on display only
(DDRAM is unchanged)
ac10Cursor moves left
ac14Cursor moves right
ac18Cursor movesleft. Text shifts left
ac1cCursor moves right. Text shifts right

Cursor positioning commands - "ac--" (Hex).

80818283848586878889 8a8b8c8d8e8f90919293
c0c1c2c3c4c5c6c7c8c9 cacbcccdcecfd0d1d2d3
9495969798999a9b9c9d 9e9fa0a1a2a3a4a5a6a7
d4d5d6d7d8d9dadbdcdd dedfe0e1e2e3e4e5e6e7

CGRAM Character Locations

Character:00 (08)01 (09)02 (0a)03 (0b)04 (0c)05 (0d)06 (0e)07 (0f)
Location ("ac--"):4048505860687078

Printable pdf version


The following Picaxe subroutine (SendCmdByte) sends the hex commands to the Picaxe hardware serial out in the format required by the ByVac IASI2 Serial Controller. It's useful when a cursor-positioning command is calculated on the fly and saved as a byte so a "hard-coded" command
- for example  hserout 0, ("acc0", 13) - isn't possible .


    SYMBOL abyte = b0
    SYMBOL nibble = b1

    hsersetup B9600_4, %10000 		;Minimum rate is 9600
    hserout 0, (13) : pause 100		;so use hserout not serout.
    hserout 0, (13) : pause 100		;Get auto-baud rate (2 x cr)
    hserout 0, ("ac1", 13) : pause 500	;and initialize LCD


    
 SendCmdByte:
     	  ;The following is adapted from 'hippy' at http://www.picaxeforum.co.uk/
   	  ;It converts the single character address byte into two ASCII hex text characters
   	  ;as required by the ByVac Controller.

    nibble = abyte / $10 + "0"
    if nibble > "9" then : nibble = nibble + 7 : endif
   
    hserout 0, ("ac", nibble)			;Send high nibble. No 'cr' yet as we still need to
						;convert and send the low nibble.
    nibble = abyte & $0F + "0"
    if nibble > "9" then : nibble = nibble + 7 : endif
    hserout 0, (nibble, 13)
    return   

 

Back to Index

 


This site and its contents are © Copyright 2005 - All Rights Reserved.