-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardware.simul
71 lines (61 loc) · 1.63 KB
/
hardware.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 vendingmachine.simul
usbport = UsbPort
# Generic modules to activate from Simulator
kbd = Keyboard("123456789*0#",4,3,0)
lcd = LCD
m = Switch ; "manut" ; setLabel("M")
# Costume modules from Vending Machine package
kb = KeyBuffer
coin = CoinAcceptor
sr = SerialReceiverParity(5,6)
dp = Dispatcher
dproduct = Dispenser
## --- Project Links ---
# --------------------------------------
# KeyBoard Reader
# --------------------------------------
# Key Decode
1 -> kbd.oe
kbd.K[0-3] -> kb.D[0-3]
kb.K[0-3] -> usbport.I[0-3]
kbd.val -> kb.DAV
# Key Buffer
kb.Dval -> usbport.I4
usbport.O7 -> kb.ACK
kb.DAC -> kbd.ack
# --------------------------------------
# IOS (Integrated Output System)
# --------------------------------------
# SERIAL
usbport.O0 -> sr.SDX
usbport.O1-> sr.SCLK
dp.done -> sr.accept
sr.busy -> usbport.I6
# Dispatcher
sr.DXval -> dp.Dval
sr.D[1-5] -> dp.I[0-4]
sr.D0 -> dp.LnD
# --------------------------------------
# LCD
# --------------------------------------
dp.D[1-4] -> lcd.D[4-7]
dp.D0 -> lcd.rs
dp.WrL -> lcd.e
# --------------------------------------
# Dispenser
# --------------------------------------
dp.WrD -> dproduct.Ej
dp.D[0-3] -> dproduct.PID[0-3]
dp.finish -> dproduct.Fn
# --------------------------------------
# Manut
# --------------------------------------
m.out -> usbport.I7
# --------------------------------------
# Coin Acceptor
# --------------------------------------
coin.coin -> usbport.I5
coin.accept -> usbport.O4
coin.collect -> usbport.O5
coin.eject -> usbport.O6