
PSD GPLD Primer - PSD6XX/7XX/8XX é Application Note
055
WSi Inc. Fremont CA 800-832-6974 www.wsipsd.com
19
2.4.3.1.2 Pin
OMC is tied to a port pin.
Do this in the PSDabel file:
Declare the signal name 'Intr' as shown line 55 of the sample design.
Define 'Intr'. The sample design defines this signal within a state machine construct (lines 235, 239, 244,
249).
If you want to control the output enable of 'Intr', include an equation like this:
Intr.oe = some_signal;
If no output enable equation is given, PSDsoft will enable the output continuously (*.oe = 1).
Do this at run time:
Normally, no action is needed at run time.
If it is desired to control the output enable of the signal with the MCU, the appropriate bit in the port
DIRECTION
register should be used. Be aware that the MCU output enable control and the NVM output
enable logic is ORed together at the I/O port as shown in Figure 3. In the case above, the signal
'some_signal' would be ORed with the MCU
DIRECTION
register bit.
The state of the OMC can be read at any time by the MCU reading the appropriate
OMC
register. The state
of the driven pin can be read at any time by the MCU reading the appropriate
DATA IN
register.
2.4.3.2 OMC as Registered Logic
OMCs can generate a registered function based on the statements in the PSDabel file. An OMC input may
be loaded from a PT input, or from the MCU. The OMC output may drive an I/O port, fed back to the
AND array, or read by the MCU.
2.4.3.2.1 Node
The OMC can be used as an internal node. OMC nodes may be used individually or chained together.
In the sample design of Appendix A, OMCs are used as registers in three different ways:
←
Three OMCs are used together to form a register to be loaded by the MCU for an
initial count (FirstCnt).
←
Three OMCs are used together to form a three bit down counter (Counter) that gets
loaded under state machine control with the value of 'FirstCnt'.
←
Two OMCs are used to create a four-state state machine (PressState).
All of these OMCs are used as buried nodes. The associated port pins are being used for other functions.
(Used to read keypad inputs with IMCs).
Do this in the PSDabel file:
Declare the node names of the state machine bits (q1,q0), Counter, and FirstCnt as type 'reg'. See sample
design, lines 91, 101, and 108.
Define labels as shown in lines 151, 152, 153, 162.