-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicketMachine.simul
71 lines (62 loc) · 1.56 KB
/
TicketMachine.simul
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
## --- Additional packages with Hardware to Simulator
package ticketmachine.simul
# Generic modules to activate from Simulator
UsbPort = UsbPort
kbd = Keyboard("123456789*0#",4,3,0)
lcd = LCD
m=Switch ; "manut" ; setLabel("M")
# Costume modules from Ticket Machine package
kt = KeyTransmitter
sr = SerialReceiverParity(10)
dp = Dispatcher(9)
ca = CoinAcceptor
tp = TicketPrinter
## --- Project Links ---
# --------------------------------------
# Manut
# --------------------------------------
m.out -> UsbPort.I7
# --------------------------------------
# KeyBoard Reader
# --------------------------------------
1 -> kbd.oe
kbd.K[0-3] -> kt.D[0-3]
kbd.val -> kt.DAV
kt.TXd-> UsbPort.I1
UsbPort.O3-> kt.TXclk
kt.DAC -> kbd.ack
# --------------------------------------
# Coin Acceptor
# --------------------------------------
UsbPort.O6 -> ca.accept
UsbPort.O5 -> ca.collect
UsbPort.O4 -> ca.eject
ca.coin -> UsbPort.I5
ca.cid[0-2] -> UsbPort.I[2-4]
# --------------------------------------
# IOS (Integrated Output System)
# --------------------------------------
# Serial
UsbPort.O0 -> sr.SDX
UsbPort.O1-> sr.SCLK
UsbPort.O2-> sr.nSS
dp.done -> sr.accept
sr.busy -> UsbPort.I0
# Dispatcher
sr.DXval -> dp.Dval
sr.D[1-9] -> dp.I[0-8]
sr.D0 -> dp.TnL
# --------------------------------------
# LCD
# --------------------------------------
dp.D[1-8] -> lcd.D[0-7]
dp.D0 -> lcd.rs
dp.WrL -> lcd.e
# --------------------------------------
# Dispenser
# --------------------------------------
dp.D[1-4] -> tp.DId[0-3]
dp.D[5-8] -> tp.OId[0-3]
dp.D0 -> tp.rt
dp.WrT -> tp.prt
tp.fn -> dp.finish