Skip to content

Commit 2b515cb

Browse files
committed
updaing readme
1 parent e6726ca commit 2b515cb

File tree

4 files changed

+295
-83
lines changed

4 files changed

+295
-83
lines changed

README.md

+59-83
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This project is separated into 4 main sections,
6363

6464
1. The FPGA
6565
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
6767
1. The BROWSER to provide a GUI
6868

6969
This may help,
@@ -83,7 +83,7 @@ in the following four sections,
8383
* [go](https://github.com/JeffDeCola/my-cheat-sheets/tree/master/software/development/languages/go-cheat-sheet)
8484
* gotests
8585
* 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)
8787
(optional)
8888
* [docker](https://github.com/JeffDeCola/my-cheat-sheets/tree/master/software/operations/orchestration/builds-deployment-containers/docker-cheat-sheet)
8989
* SERVICES
@@ -103,109 +103,54 @@ Where,
103103

104104
## SECTION I - THE FPGA
105105

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.
112109

113110
* I designed the 8-bit microprocessor in
114111
[Verilog](https://github.com/JeffDeCola/my-cheat-sheets/tree/master/hardware/development/languages/verilog-cheat-sheet)
115112
(An HDL language)
116113
* Used the
117114
[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
119116
* Used a
120117
[Digilent ARTY-S7](https://github.com/JeffDeCola/my-cheat-sheets/tree/master/hardware/development/fpga-development-boards/digilent-arty-s7-cheat-sheet)
121118
FPGA development board
122119

123-
To operate this microprocessor, the Raspberry Pi will,
120+
### VERILOG
124121

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,
138123

139124
![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)
140125

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
159127

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,
167129

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)
169131

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
172133

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,
178135

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)
181138

182139
### RASPBERRY PI TO FPGA DEV BOARD INTERFACE (GPIO to PMOD)
183140

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.
196143

197144
* **OUTPUT (SET)**
198145
* [3:0] OPCODE
199146
* 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)
203150
* [7:0] DATA_IN_B
204151
* **INPUT (GET)**
205152
* [7:0] DATA_OUT
206153

207-
A go program is used to control and capture the I/O.
208-
209154
The pin list between the Raspberry Pi and the FPGA development
210155
board is as follows,
211156

@@ -245,28 +190,59 @@ board is as follows,
245190
| | | |
246191
| **[3:0] OPCODE** | JD PMOD | |
247192
| | | |
248-
| [3] | 1 | 03 (GPIO2)* |
249-
| [2] | 2 | 05 (GPIO3)* |
193+
| [3] | 1 | 03 (GPIO2)** |
194+
| [2] | 2 | 05 (GPIO3)** |
250195
| [1] | 3 | 07 (GPIO4) |
251196
| [0] | 4 | 11 (GPIO17) |
252197
| 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) |
255200
| N/C | 10 | N/C |
256201

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`.
261204
Select `Interfacing Options` and then
262205
`Serial` and select `No`.
263206

207+
**NOTE2** Pin 3 (GPIO2) and pin 5 (GPIO3) have
208+
fixed pull-up resistors to 3.3V.
209+
264210
![IMAGE - arty-s7-50-pmod-to-raspi-gpio-breadboard-connections.jpg - IMAGE](docs/pics/arty-s7-50-pmod-to-raspi-gpio-breadboard-connections.jpg)
265211

266212
The result,
267213

268214
![IMAGE - breadboard.jpg - IMAGE](docs/pics/breadboard.jpg)
269215

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+
270246
### RASPBERRY PI TO WEBSERVER INTERFACE (REST JSON API)
271247

272248
tbd.
Loading

0 commit comments

Comments
 (0)