|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimObject
hades.models.special.TextLCD
TextLCD is the model of a generic character-based liquid-crystal dot-matrix display with 2x40 characters. The specification was taken from the RS data library, "alphanumeric dot matrix liquid crystal displays", F19357, 1995, but should be valid for most off-the-shelf LCD controllers.
The model implements all commands from display initialization to scrolling, four-bit data interface, to character-generator writes and reads.
Note that the read-command timing is implemented exactly as specified, that is, the data hold time after enable goes high is about 30 nsec. This may lead to problems with 'sloppy' controllers which sample the data outputs after enable went high (e.g. Arizona Microchip AN587).
Field Summary | |
protected int |
active_memory
|
protected int |
BIT_D0
|
protected int |
BIT_D1
|
protected int |
BIT_D2
|
protected int |
BIT_D3
|
protected int |
BIT_D4
|
protected int |
BIT_D5
|
protected int |
BIT_D6
|
protected int |
BIT_D7
|
protected int |
BIT_RS
|
protected int |
BIT_RW
|
protected boolean |
busy
|
protected int |
cg_address
|
protected int |
CG_MEMORY
|
protected int |
CMD_CG_ADDR
|
protected int |
CMD_CLEAR
|
protected int |
CMD_CURSOR_HOME
|
protected int |
CMD_DATA_ADDR
|
protected int |
CMD_DISPLAY_ON
|
protected int |
CMD_ENTRY_MODE
|
protected int |
CMD_FUNCTION
|
protected int |
CMD_IDLE
|
protected int |
CMD_READ_BUSY
|
protected int |
CMD_READ_RAM
|
protected int |
CMD_SHIFT_MOVE
|
protected int |
CMD_WRITE_RAM
|
protected int |
command_old
|
protected int |
command_word
|
(package private) javax.swing.JPanel |
controlPanel
|
protected int |
data_address
|
protected int |
DATA_MEMORY
|
(package private) boolean |
debug
|
(package private) javax.swing.JCheckBox |
debugCheckbox
|
protected boolean |
decrement_mode
|
protected boolean |
four_bit_first
|
protected boolean |
four_bit_mode
|
protected boolean |
incr_not_decr
|
(package private) TextLCDCanvas |
lcdCanvas
|
protected int |
n_cols
|
protected int |
n_rows
|
protected PortStdLogic1164 |
port_D0
|
protected PortStdLogic1164 |
port_D1
|
protected PortStdLogic1164 |
port_D2
|
protected PortStdLogic1164 |
port_D3
|
protected PortStdLogic1164 |
port_D4
|
protected PortStdLogic1164 |
port_D5
|
protected PortStdLogic1164 |
port_D6
|
protected PortStdLogic1164 |
port_D7
|
protected PortStdLogic1164 |
port_E
|
protected PortStdLogic1164 |
port_RS
|
protected PortStdLogic1164 |
port_RW
|
protected PortStdLogic1164 |
port_VO
|
protected boolean |
shift_not_move
|
protected Label |
symbolTypeLabel
|
protected double |
T_CG_ADDR
|
protected double |
T_CLEAR
|
protected double |
T_CURSOR_HOME
|
protected double |
T_DATA_ADDR
|
protected double |
T_DISPLAY_ON
|
protected double |
T_ENTRY_MODE
|
protected double |
T_FUNCTION
|
protected double |
T_INITIALIZE
|
protected double |
T_READ_RAM
|
protected double |
T_SHIFT_MOVE
|
protected double |
T_WRITE_RAM
|
(package private) java.awt.Image |
theIcon
|
(package private) javax.swing.JFrame |
topFrame
|
protected StdLogic1164 |
value_0
|
protected StdLogic1164 |
value_1
|
protected StdLogic1164 |
value_H
|
protected StdLogic1164 |
value_X
|
Fields inherited from class hades.simulator.SimObject |
classloader, console, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
TextLCD()
the TextLCD default constructor. |
Method Summary | |
(package private) void |
buildControlPanel()
|
(package private) void |
buildGUI()
|
(package private) void |
buildGUICallbacks()
|
void |
changeName()
|
void |
configure()
create and display a 'ConfigDialog' to set the parameters for a SimObject. |
SimObject |
copy()
copy(): create an (empty) clone of the current TextLCD |
void |
decode(int command)
|
void |
decrementDataAddress()
|
void |
doClearDisplay()
00 0000 0001 |
void |
doCursorHome()
00 0000 001X |
void |
doInitialize()
|
void |
doReadBusy()
01 BF AAA AAAA |
void |
doReadData()
11 DDDD DDDD |
void |
doSetCGAddress()
00 01AA AAAA |
void |
doSetDataAddress()
00 1AAA AAAA |
void |
doSetDisplayOn()
00 0000 1DCB |
void |
doSetEntryMode()
00 0000 01IS |
void |
doSetFunction()
00 001D NFXX |
void |
doShiftMove()
00 0001 SRXX |
void |
doWriteData()
10 DDDD DDDD |
void |
elaborate(java.lang.Object arg)
elaborate(): We assign a '0' to all our outputs. |
void |
evaluate(java.lang.Object arg)
evaluate(): This LCD controller is sensitive to the falling edge on the enable signal (port_E) only, when the R/S, R/W, and data signals are sampled. |
boolean |
getLocalDebug()
|
java.awt.Component |
getPropertySheet()
return a reference to the 'property sheet' or configuration window for this SimObject. |
java.lang.String |
getToolTip(java.awt.Point position,
long millis)
construct a (short) tool tip message for a SimObject. |
java.lang.String |
hex(int i)
|
void |
incrementDataAddress()
|
boolean |
initialize(java.lang.String s)
initialize a SimObject from a String. |
static void |
main(java.lang.String[] argv)
main(): simple selftest of the TextLCD's GUI |
void |
mousePressed(java.awt.event.MouseEvent me)
react to a MouseEvent. |
void |
msg(java.lang.String s)
msg() |
int |
readAddress()
|
int |
readData()
retrieve the data at the current address from the data RAM of CG RAM, whichever is selected. |
void |
setBusyFor(double delta_t)
|
void |
setCGAddress(int address)
|
void |
setDataAddress(int address)
|
void |
setLocalDebug(boolean b)
|
void |
setName(java.lang.String name)
set the name of this SimObject. |
void |
setSymbol(Symbol s)
|
static void |
sleep(int millis)
|
java.lang.String |
toString()
toString() - the usual info method |
void |
updateCGAddress()
|
void |
updateDataAddress()
|
void |
wakeup(java.lang.Object arg)
called in reaction to our setBusyFor() calls. |
void |
write(java.io.PrintWriter ps)
|
void |
writeData(int value)
write 'value' into the current address of the data RAM or CG RAM, whichever is selected. |
Methods inherited from class hades.simulator.SimObject |
constructDynamicSymbol, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setParent, setPorts, setSimulator, setVersionId, setVisible, tearDown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface hades.simulator.Simulatable |
message |
Field Detail |
boolean debug
protected PortStdLogic1164 port_RS
protected PortStdLogic1164 port_RW
protected PortStdLogic1164 port_E
protected PortStdLogic1164 port_D7
protected PortStdLogic1164 port_D6
protected PortStdLogic1164 port_D5
protected PortStdLogic1164 port_D4
protected PortStdLogic1164 port_D3
protected PortStdLogic1164 port_D2
protected PortStdLogic1164 port_D1
protected PortStdLogic1164 port_D0
protected PortStdLogic1164 port_VO
protected StdLogic1164 value_0
protected StdLogic1164 value_1
protected StdLogic1164 value_X
protected StdLogic1164 value_H
protected Label symbolTypeLabel
protected int n_rows
protected int n_cols
protected final int DATA_MEMORY
protected final int CG_MEMORY
protected final int BIT_RS
protected final int BIT_RW
protected final int BIT_D7
protected final int BIT_D6
protected final int BIT_D5
protected final int BIT_D4
protected final int BIT_D3
protected final int BIT_D2
protected final int BIT_D1
protected final int BIT_D0
protected final int CMD_IDLE
protected final int CMD_CLEAR
protected final int CMD_CURSOR_HOME
protected final int CMD_ENTRY_MODE
protected final int CMD_DISPLAY_ON
protected final int CMD_SHIFT_MOVE
protected final int CMD_FUNCTION
protected final int CMD_CG_ADDR
protected final int CMD_DATA_ADDR
protected final int CMD_READ_BUSY
protected final int CMD_WRITE_RAM
protected final int CMD_READ_RAM
protected final double T_INITIALIZE
protected final double T_CLEAR
protected final double T_CURSOR_HOME
protected final double T_ENTRY_MODE
protected final double T_DISPLAY_ON
protected final double T_SHIFT_MOVE
protected final double T_FUNCTION
protected final double T_CG_ADDR
protected final double T_DATA_ADDR
protected final double T_WRITE_RAM
protected final double T_READ_RAM
protected int command_word
protected int command_old
protected int cg_address
protected int data_address
protected int active_memory
protected boolean busy
protected boolean incr_not_decr
protected boolean decrement_mode
protected boolean shift_not_move
protected boolean four_bit_mode
protected boolean four_bit_first
TextLCDCanvas lcdCanvas
javax.swing.JFrame topFrame
javax.swing.JPanel controlPanel
javax.swing.JCheckBox debugCheckbox
java.awt.Image theIcon
Constructor Detail |
public TextLCD()
Method Detail |
public void setSymbol(Symbol s)
setSymbol
in class SimObject
public void setName(java.lang.String name)
SimObject
To avoid consistency problems, when the user changes a SimObject's name interactively, we also try to enforce a unique name.
setName
in class SimObject
public void setLocalDebug(boolean b)
public boolean getLocalDebug()
public void doInitialize()
public void doClearDisplay()
public void doCursorHome()
public void doSetEntryMode()
public void doSetDisplayOn()
public void doShiftMove()
public void doSetFunction()
Do some ugly things to our internal state: select 4/8 bit input mode, ignore font selection, check for user reset via multiple setFunction commands.
public void doSetCGAddress()
public void doSetDataAddress()
public void doReadBusy()
public void doWriteData()
public void doReadData()
public void setCGAddress(int address)
public void setDataAddress(int address)
public void writeData(int value)
Note that writes to the CG RAM are currently not implemented.
public void updateDataAddress()
public void incrementDataAddress()
public void decrementDataAddress()
public void updateCGAddress()
public int readData()
Note that reads from the CG RAM are currently not implemented.
public int readAddress()
void buildGUI()
void buildControlPanel()
void buildGUICallbacks()
public void changeName()
public void write(java.io.PrintWriter ps)
write
in class SimObject
public boolean initialize(java.lang.String s)
SimObject
initialize
in class SimObject
public java.awt.Component getPropertySheet()
SimObject
getPropertySheet
in class SimObject
public void configure()
SimObject
configure
in class SimObject
public void mousePressed(java.awt.event.MouseEvent me)
SimObject
Note that the HADES schematic editor will also deliver jfig.canvas.FigCanvasEvent object, which also include the world-coordinates of the Event.
mousePressed
in class SimObject
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
elaborate
in class SimObject
arg
- This parameter is ignored by TextLCDpublic void evaluate(java.lang.Object arg)
Also, note that the enable pulse duration must be at least 450 nsec, and that all commands except 'read busy flag' are ignored while the controller is busy servicing an older command.
See the data-sheet for details of controller commands and operation.
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- An arbitrary and unused objectpublic void decode(int command)
public SimObject copy()
copy
in class SimObject
public void setBusyFor(double delta_t)
public void wakeup(java.lang.Object arg)
wakeup
in interface Wakeable
public java.lang.String getToolTip(java.awt.Point position, long millis)
SimObject
getToolTip
in interface ContextToolTip
getToolTip
in class SimObject
public java.lang.String hex(int i)
public java.lang.String toString()
toString
in class SimObject
public void msg(java.lang.String s)
public static void sleep(int millis)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |