Debian Codegraph @

doc/special-pins.md

raw symbols SCIP
1 # Importance.
2
3 Gowi FPGAs are SRAM-based, so they require programming each time they are powered up. Accordingly, the chip has special pins for this programming.
4
5 Apicula provides the ability to use these pins as GPIO, but you need to be aware of the risks involved - the IO subsystem is complex and its implementation may contain errors, and even if you are absolutely sure of your design, you may still end up with a non-reprogrammable ‘brick’!
6
7 In short, using specially designated pins for special purposes as GPIOs is not a healthy practice.
8
9 *You have been warned.*
10
11 After this introduction, let's move on to describing dedicated pins.
12
13 Pin names are the very names written on the schematic diagram, for example, for 138k in a small fragment of the diagram:
14
15 ![138k dedicated pins](fig/dedicated-pins-sch.png)
16
17
18 ## DONE
19
20 Signal indicating whether FPGA programming was successful: VCC - programming successful, GND - error.
21
22 Gowin_pack command line argument: --done_as_gpio
23
24 Nextpnr command line argument: not needed
25
26 When using as GPIO, it is advisable to provide VCC at startup - as the default value for OUTPUT or (not tested) PULL_MODE=UP for INPUT.
27
28 Before programming, it is OPENDRAIN OUTPUT! So bear in mind that a resistor to VCC is usually already soldered on the boards.
29
30 ## READY
31
32 Signal indicating whether FPGA can be programmed: VCC - yes, GND - no.
33
34 Gowin_pack command line argument: --ready_as_gpio
35
36 Nextpnr command line argument: not needed
37
38 When using as GPIO, it is advisable to provide VCC at startup - as the default value for OUTPUT or (not tested) PULL_MODE=UP for INPUT.
39
40 Before programming, it is OPENDRAIN OUTPUT! So bear in mind that a resistor to VCC is usually already soldered on the boards.
41
42 ## RECONFIG_N
43
44 This is a signal for the FPGA to reload its configuration according to the state of the MODE inputs.
45
46 Gowin_pack command line argument: --done_as_gpio
47
48 Nextpnr command line argument: not needed
49
50 Normal state - VCC. Reprogramming initiation - GND pulse with a duration of at least 25ns.
51
52 When using as GPIO, it is advisable to provide VCC at startup - as the default value for OUTPUT. Can not be used as INPUT.
53
54 ## JTAG
55
56 A generalised name for pins responsible for one of the FPGA programming mechanisms.
57
58 Gowin_pack command line argument: --jtag_as_gpio
59
60 Nextpnr command line argument: not needed
61
62 This includes the following pins:
63 - TCK - JTAG clock.
64 - TMS - JTAG mode select.
65 - TDI - JTAG data input.
66 - TDO - JTAG data output.
67
68 No particular comments on their use as GPIOs, except that TCK most likely already has a resistor to VCC.
69
70
71 ## MSPI
72
73 Master SPI. A generalised name for pins responsible for one of the FPGA programming mechanisms. The FPGA acts as the master and downloads programming data from external Flash memory via the SPI protocol.
74
75 Gowin_pack command line argument: --mspi_as_gpio
76
77 Nextpnr command line argument: not needed
78
79 This includes the following pins:
80 - CCLK - configuragion clock.
81 - MCSN - case select select.
82 - MISO - master-in slave-out in X1 mode, IO1 in X2 or X4 mode.
83 - MOSI - master-out slave-in in X1 mode, IO0 in X2 or X4 mode.
84 - D02 - IO2 in X4 mode.
85 - D03 - IO3 in X4 mode.
86
87 In each specific case, you need to look at the schematic diagram - it is possible that the MCSN has a resistor to VCC.
88
89 ## SSPI
90
91 Slave SPI. A generalised name for pins responsible for one of the FPGA programming mechanisms. The FPGA acts as a slave for downloading programming data via the SPI protocol.
92
93 Gowin_pack command line argument: --sspi_as_gpio
94
95 Nextpnr command line argument: --vopt sspi_as_gpio
96
97 This includes the following pins:
98 - SSPI_HOLDN - VCC - sspi works normally, GND - sspi disabled.
99 - SSPI_CSN - case select.
100 - SSPI_CLK - clock.
101 - SSPI_SI - slave input.
102 - SSPI_SO - slave output.
103 - SSPI_WPN - write protect, VCC - write is enabled, GND - read only.
104
105 In the case of TangPrimer25k, you are forced to use SSPI as GPIO because the signal from the external quartz generator is soldered to the SSPI_WPN pin.
106
107 ## CPU
108
109 A generalised name for pins responsible for one of the FPGA programming mechanisms. The FPGA will receive data for programming via a 32-bit bus.
110
111 Gowin_pack command line argument: --cpu_as_gpio
112
113 Nextpnr command line argument: not needed
114
115 This includes the following pins:
116 - D00-D31 - 31 input/output pin. (D01 is DIN).
117 - DIN - D01 input/output pin.
118 - CSI_B - case selecet input.
119 - CSO_B - case select output.
120 - RDWR_B - read/write signal.
121 - CCLK - configuration clock.
122
123 Despite the absence of a CPU in TangPrimer25k and TangMega60k, some pins require switching to GPIO mode for use.
124
125 ## Serial
126
127 A generalised name for pins responsible for one of the FPGA programming mechanisms. The FPGA will receive data for programming via a serial line.
128
129 Gowin_pack command line argument: --cpu_as_gpio
130
131 Nextpnr command line argument: not needed
132
133 This includes the following pins:
134 - DIN - serial input.
135 - CCLK - configuration clock.
136
137 DIN usually coincides with D01 or D00 of the CPU bus, so the same key is specified for use as GPIO as for CPU pins.
138
139 ## MODE
140
141 MODE[2:0] pins select a mechanism for programmign FPGA. In general, MODE[2:0] pins are hard-configured using resistors or mechanical switches. Considering that they work at the very beginning of programming by selecting the programming method itself, they can be used as GPIO without command line keys, taking into account where the resistors are connected.
142
143 Gowin_pack command line argument: not needed
144
145 Nextpnr command line argument: not needed
146
147 TangPrimer25k does not have MODE switches, but TangMega60k and TangMega138k are inserted into a dock that has such switches, and here is the explanation:
148
149 - 000 - Serial. FPGA acts as master.
150 - 001 - MSPI. Read from Flash.
151 - 010 - SSPI. FPGA acts as slave.
152 - 100 - CPU. FPGA acts as master and reads from external bus.
153 - 101 - JTAG only. JTAG always works but in this mode it is the single source.
154 - 110 - CPU. FPGA acts as slave.
155 - 111 - Serail. FPGA acts as slave.
156
157 ## PUDC
158
159 PullUp During Configuration. VCC - all GPIOs have no pullup, GND - all GPIOs have pull-up, except PUDC pin.
160
161 Gowin_pack command line argument: not needed
162
163 Nextpnr command line argument: not needed
164
165 No action is required to use it as a GPIO, but you need to check the diagram to see where the resistor is soldered.
166
167 ## CFGBVS
168
169 Configuration Bank Voltage Select. Set voltaga of banks 3, 4, and 10 during configuration. VCC - 3.3V, GND - 2.5V.
170
171 Gowin_pack command line argument: not needed
172
173 Nextpnr command line argument: not needed
174
175 No action is required to use it as a GPIO, but you need to check the diagram to see where the resistor is soldered.
176
177 ##