@@ -63,7 +63,7 @@ This project is separated into 4 main sections,
63
63
64
64
1 . The FPGA
65
65
1 . The BACKEND SERVER (Raspberry Pi) to control the I/O of the FPGA
66
- 1 . The WEB SERVER (bluehost) providing to control the Raspberry Pi
66
+ 1 . The WEB SERVER (bluehost) providing the interface between the frontend and backend
67
67
1 . The BROWSER to provide a GUI
68
68
69
69
This may help,
@@ -83,7 +83,7 @@ in the following four sections,
83
83
* [ go] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/software/development/languages/go-cheat-sheet )
84
84
* gotests
85
85
* OPERATIONS
86
- * [ concourse ci ] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/software/operations/continuous-integration-continuous-deployment/concourse-cheat-sheet )
86
+ * [ concourse] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/software/operations/continuous-integration-continuous-deployment/concourse-cheat-sheet )
87
87
(optional)
88
88
* [ docker] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/software/operations/orchestration/builds-deployment-containers/docker-cheat-sheet )
89
89
* SERVICES
@@ -103,109 +103,54 @@ Where,
103
103
104
104
## SECTION I - THE FPGA
105
105
106
- My
107
- [ programable-8-bit-microprocessor] ( https://github.com/JeffDeCola/my-systemverilog-examples/tree/master/systems/microprocessors/programable-8-bit-microprocessor )
108
- will be used as an example. Please refer to that repo on how to burn a
109
- FPGA from verilog.
110
-
111
- In that repo,
106
+ I burned my
107
+ [ programable-8-bit-microprocessor] ( https://github.com/JeffDeCola/my-systemverilog-examples/tree/master/systems/microprocessors/programable_8_bit_microprocessor ) to an FPGA.
108
+ Refer to that repo on how i did that.
112
109
113
110
* I designed the 8-bit microprocessor in
114
111
[ Verilog] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/hardware/development/languages/verilog-cheat-sheet )
115
112
(An HDL language)
116
113
* Used the
117
114
[ Xilinx Vivado] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/hardware/tools/synthesis/xilinx-vivado-cheat-sheet )
118
- IDE to synthesize and burn/flash on boot the FPGA
115
+ IDE to synthesize and burn/flash the FPGA
119
116
* Used a
120
117
[ Digilent ARTY-S7] ( https://github.com/JeffDeCola/my-cheat-sheets/tree/master/hardware/development/fpga-development-boards/digilent-arty-s7-cheat-sheet )
121
118
FPGA development board
122
119
123
- To operate this microprocessor, the Raspberry Pi will,
120
+ ### VERILOG
124
121
125
- * Set both inputs [ 7:0] DATA_IN_A and [ 7:0] DATA_IN_B
126
- * Select an [ 3:0] OPCODE instruction (such as ADD)
127
- * 0011: ADD
128
- * 0111: SUBTRACT
129
- * 1100: MULTIPLY
130
- * 1110: DIVIDE
131
- * Enable the GO_BAR via GO signal
132
- * Observe the resulting [ 7:0] DATA_OUT
133
-
134
- The number of I/O the Raspberry Pi can control is 26 I/O pins.
135
- But as shown in the following figure, the microprocessor has 31 pins.
136
- The next section will go over which 5 pins we hardcoded or will be
137
- controlled by the FPGA development board,
122
+ This is the structural level of the 8-bit microprocessor I designed in verilog,
138
123
139
124
![ IMAGE - Top-Level-Block-Diagram-of-the-8-bit-Microprocessor.jpg - IMAGE] ( https://github.com/JeffDeCola/my-verilog-examples/blob/master/docs/pics/systems/Top-Level-Block-Diagram-of-the-8-bit-Microprocessor.jpg?raw=true )
140
125
141
- ## SECTION II - THE RASPBERRY PI
142
-
143
- The Raspberry Pi shall do two things,
144
-
145
- * Control 26 pins of the I/O of the FPGA (GPIO to PMOD)
146
- * Provide an interface to the webserver (REST JSON API)
147
-
148
- ### RUN
149
-
150
- To
151
- [ run.sh] ( https://github.com/JeffDeCola/control-fpga-via-raspi-and-webserver/blob/master/control-fpga-via-raspi-and-webserver-code/run.sh ) ,
152
-
153
- ``` bash
154
- cd control-fpga-via-raspi-and-webserver-code
155
- go run main.go
156
- ```
157
-
158
- As a placeholder, every 2 seconds it will print,
126
+ ### ARTY S7-50 FPGA DEVELOPMENT BOARD
159
127
160
- ``` txt
161
- INFO[0000] Let's Start this!
162
- Hello everyone, count is: 1
163
- Hello everyone, count is: 2
164
- Hello everyone, count is: 3
165
- etc...
166
- ```
128
+ I used an arty S7-50 FPGA development board to burn a Spartan-7 50 FPGA,
167
129
168
- ### CREATE BINARY
130
+ ![ IMAGE - digilent-arty-s7-50.jpg - IMAGE ] ( https://github.com/JeffDeCola/my-cheat-sheets/blob/master/docs/pics/digilent-arty-s7-50.jpg?raw=true )
169
131
170
- To
171
- [ create-binary.sh] ( https://github.com/JeffDeCola/control-fpga-via-raspi-and-webserver/blob/master/control-fpga-via-raspi-and-webserver-code/bin/create-binary.sh ) ,
132
+ ## SECTION II - THE RASPBERRY PI
172
133
173
- ``` bash
174
- cd control-fpga-via-raspi-and-webserver-code/bin
175
- go build -o control-fpga-via-raspi-and-webserver ../main.go
176
- ./control-fpga-via-raspi-and-webserver
177
- ```
134
+ The Raspberry Pi shall do two things,
178
135
179
- This binary will not be used during a docker build
180
- since it creates it's own.
136
+ * Control 28 pins of the I/O of the FPGA (GPIO to PMOD) using GO
137
+ * Provide an interface to the webserver (REST JSON API)
181
138
182
139
### RASPBERRY PI TO FPGA DEV BOARD INTERFACE (GPIO to PMOD)
183
140
184
- The GPIO (Input/Output) of the Raspberry Pi is connected to the
185
- Input/Output of the FPGA development board via Pmod connectors.
186
- On a side note, it may be a good idea to place a 200 Ohm resister in-line.
187
-
188
- All of the GPIOs have weak internal pull-ups and downs which may be enabled
189
- or disabled by software. I control this in my go code.
190
-
191
- There are a total of 26 I/O pins that you may use in the Raspberry Pi.
192
- But I have a total of 31 I would like to use. So I had to compromise
193
- and hardcoded 5 of the Inputs (????).
194
-
195
- The Raspberry Pi will connect to the processor as follows,
141
+ That is a total of 31 pins, but I only have 28 GPIO pins.
142
+ Hence, I will tie 3 of the DATA_IN_A pins to gnd.
196
143
197
144
* ** OUTPUT (SET)**
198
145
* [ 3:0] OPCODE
199
146
* GO_BAR
200
- * RESET (N/C)
201
- * JAM (N/C)
202
- * [ 7:0] DATA_IN_A (Bits 4,5,6 hardcoded to low )
147
+ * RESET
148
+ * JAM
149
+ * [ 7:0] DATA_IN_A (Bits 4,5,6 hardwired to ground )
203
150
* [ 7:0] DATA_IN_B
204
151
* ** INPUT (GET)**
205
152
* [ 7:0] DATA_OUT
206
153
207
- A go program is used to control and capture the I/O.
208
-
209
154
The pin list between the Raspberry Pi and the FPGA development
210
155
board is as follows,
211
156
@@ -245,28 +190,59 @@ board is as follows,
245
190
| | | |
246
191
| ** [ 3:0] OPCODE** | JD PMOD | |
247
192
| | | |
248
- | [ 3] | 1 | 03 (GPIO2)* |
249
- | [ 2] | 2 | 05 (GPIO3)* |
193
+ | [ 3] | 1 | 03 (GPIO2)** |
194
+ | [ 2] | 2 | 05 (GPIO3)** |
250
195
| [ 1] | 3 | 07 (GPIO4) |
251
196
| [ 0] | 4 | 11 (GPIO17) |
252
197
| GO | 7 | 13 (GPIO27) |
253
- | ** (GND) ** RESET | 8 | N/C |
254
- | ** (GND) ** JAM | 9 | N/C |
198
+ | RESET | 8 | 27 (GPIO0) |
199
+ | JAM | 9 | 28 (GPIO1) |
255
200
| N/C | 10 | N/C |
256
201
257
- ** NOTE** : To use pin 3 (GPIO2), pin 5 (GPIO3),
258
- pin 8 (GPIO14) and pin 10 (GPIO15)
259
- you must disable
260
- the serial port using ` raspi-config ` .
202
+ ** NOTE1** : To use pin 8 (GPIO14) and pin 10 (GPIO15)
203
+ you must disable the serial port using ` raspi-config ` .
261
204
Select ` Interfacing Options ` and then
262
205
` Serial ` and select ` No ` .
263
206
207
+ ** NOTE2** Pin 3 (GPIO2) and pin 5 (GPIO3) have
208
+ fixed pull-up resistors to 3.3V.
209
+
264
210
![ IMAGE - arty-s7-50-pmod-to-raspi-gpio-breadboard-connections.jpg - IMAGE] ( docs/pics/arty-s7-50-pmod-to-raspi-gpio-breadboard-connections.jpg )
265
211
266
212
The result,
267
213
268
214
![ IMAGE - breadboard.jpg - IMAGE] ( docs/pics/breadboard.jpg )
269
215
216
+ ### CONTROL I/O VIA GOLANG
217
+
218
+ To
219
+ [ run.sh] ( https://github.com/JeffDeCola/section-2-backend-server/blob/master/section-2-backend-server/run.sh ) ,
220
+
221
+ ``` bash
222
+ cd section-2-backend-server
223
+ go run main.go
224
+ ```
225
+
226
+ As a placeholder, every 2 seconds it will print,
227
+
228
+ ``` txt
229
+ ???????
230
+ ```
231
+
232
+ ### CREATE BINARY
233
+
234
+ To
235
+ [ create-binary.sh] ( https://github.com/JeffDeCola/section-2-backend-server/blob/master/section-2-backend-server/bin/create-binary.sh ) ,
236
+
237
+ ``` bash
238
+ cd section-2-backend-server/bin
239
+ go build -o section-2-backend-server ../main.go
240
+ ./section-2-backend-server
241
+ ```
242
+
243
+ This binary will not be used during a docker build
244
+ since it creates it's own.
245
+
270
246
### RASPBERRY PI TO WEBSERVER INTERFACE (REST JSON API)
271
247
272
248
tbd.
0 commit comments