27220 Parallax Inc, 27220 Datasheet - Page 101

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
' -----[ Subroutines ]-----------------------------------------------------
LCD_Cmd:
LCD_Out:
LCD_In:
Put_Val:
Behind the Scenes
This program demonstrates the versatility of the BASIC Stamp’s I/O lines and their
ability to be reconfigured mid-program. Writing to the LCD was covered in the last
two experiments. To read data back, the BASIC Stamp’s I/O lines that serve as the
LCD bus must be reconfigured as inputs. This is no problem for the BASIC Stamp.
GOTO Main
LOW RS
LcdBusOut = char.HIGHNIB
PULSOUT E, 3
LcdBusOut = char.LOWNIB
PULSOUT E, 3
HIGH RS
RETURN
HIGH RS
HIGH RW
LcdDirs = %0000
HIGH E
char.HIGHNIB = LcdBusIn
LOW E
HIGH E
char.LOWNIB = LcdBusIn
LOW E
LcdDirs = %1111
LOW RW
RETURN
FOR idx = (width - 1) TO 0
NEXT
RETURN
char = (temp DIG idx) + "0"
GOSUB LCD_Out
' do it again
' enter command mode
' output high nibble
' strobe the Enable line
' output low nibble
' return to character mode
' data command
' read
' make data lines inputs
' get high nibble
' get low nibble
' make buss lines outputs
' return to write mode
' display digits l-to-r
' convert digit to ASCII
' write to LCD

Related parts for 27220