Skip to content

Commit 5e2bb6b

Browse files
authored
minor cleanup and pinout diagram in README
1 parent 7896a15 commit 5e2bb6b

File tree

3 files changed

+52
-16
lines changed

3 files changed

+52
-16
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
UPduino Example Makefile Project
1+
UPduino Video Example Makefile Project
22

33
SPDX short identifier: MIT-0
44

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,40 @@ the "retro" Ohio Scientific font with graphic characters (as shown).
1818
"Picture of VGA monitor showing character set")
1919
<br>UPduino generating 640x480 8 color display
2020

21+
To generate the needed video frequency either UPduino OSC jumper can be shorted
22+
with a blob of solder (for a more solid, permanent clock connection) or you can
23+
use a wire connecting 12M pin to gpio_20 (make sure you have the real 12M pin and
24+
not mislabelled GND, as the silkscreen is incorrect on some boards - check for
25+
continuity with GND).
26+
27+
```plain-text
28+
PCF Pin# _____ Pin# PCF
29+
/-----| USB |-----\
30+
<GND> | 1 \___/ 48 | spi_ssn (16)
31+
<VIO> | 2 47 | spi_sck (15)
32+
<RST> | 3 46 | spi_mosi (17)
33+
<DONE> | 4 45 | spi_miso (14)
34+
<RGB2> led_red | 5 44 | gpio_20 <----+ short OSC jumper
35+
<RGB0> led_green | 6 U 43 | gpio_10 | or use a
36+
<RGB1> led_blue | 7 P 42 | <GND> | wire for
37+
<+5V/VUSB> | 8 d 41 | <12M> >----+ 12 MHz clock
38+
<+3.3V> | 9 u 40 | gpio_12
39+
<GND> | 10 i 39 | gpio_21
40+
gpio_23 | 11 n 38 | gpio_13
41+
gpio_25 | 12 o 37 | gpio_19
42+
gpio_26 | 13 36 | gpio_18
43+
gpio_27 | 14 V 35 | gpio_11
44+
gpio_32 | 15 3 34 | gpio_9
45+
<G0> gpio_35 | 16 . 33 | gpio_6
46+
gpio_31 | 17 x 32 | gpio_44 <G6>
47+
<G1> gpio_37 | 18 31 | gpio_4
48+
gpio_34 | 19 30 | gpio_3
49+
gpio_43 | 20 29 | gpio_48 >----> VGA blue
50+
gpio_36 | 21 28 | gpio_45 >----> VGA green
51+
gpio_42 | 22 27 | gpio_47 >----> VGA red
52+
gpio_38 | 23 26 | gpio_46 >----> VGA V sync
53+
gpio_28 | 24 25 | gpio_2 >----> VGA H sync
54+
\-----------------/
55+
```
56+
2157
-Xark <https://hackaday.io/Xark>

video_gen.sv

+15-15
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
module video_gen
1414
(
1515
// video control signals
16-
input wire hres_t h_count_i, // horizontal pixel counter
16+
input wire hres_t h_count_i, // horizontal pixel counter
1717
input wire logic v_visible_i, // true if scanline is in visible range
1818
input wire logic end_of_line_i, // true on last cycle of line
1919
input wire logic end_of_frame_i, // true on last cycle end of frame
2020
// video memories
2121
output logic dispmem_sel_o, // display mem read select
22-
output disp_addr_t dispmem_addr_o, // display mem word address out (16x64K)
23-
input wire disp_data_t dispmem_data_i, // display mem word data in
22+
output disp_addr_t dispmem_addr_o, // display mem word address out (16x64K)
23+
input wire disp_data_t dispmem_data_i, // display mem word data in
2424
output logic fontmem_sel_o, // font mem read select
25-
output font_addr_t fontmem_addr_o, // font mem word address out (16x5K)
26-
input wire font_data_t fontmem_data_i, // font mem word data in
25+
output font_addr_t fontmem_addr_o, // font mem word address out (16x5K)
26+
input wire font_data_t fontmem_data_i, // font mem word data in
2727
// video generation control signals
2828
input wire logic [2:0] pf_h_repeat_i, // horizontal pixel repeat (1x to 8x)
2929
input wire logic [2:0] pf_v_repeat_i, // vertical pixel repeat (1x to 8x)
30-
input wire disp_addr_t pf_line_len_i, // display mem word address out (16x64K)
31-
output color_t pf_color_index_o, // output pixel color value
30+
input wire disp_addr_t pf_line_len_i, // display mem word address out (16x64K)
31+
output color_t pf_color_index_o, // output pixel color value
3232
// standard signals
3333
input wire logic clk // pixel clock
3434
);
@@ -62,20 +62,20 @@ logic [2:0] pf_state, pf_state_next; // playfield FSM fetch state
6262

6363
logic dispmem_sel, dispmem_sel_next; // display mem select output
6464
always_comb dispmem_sel_o = dispmem_sel; // output to display mem select
65-
disp_addr_t pf_disp_addr, pf_disp_addr_next; // address to fetch display data
65+
disp_addr_t pf_disp_addr, pf_disp_addr_next; // address to fetch display data
6666
always_comb dispmem_addr_o = pf_disp_addr; // output display mem addr
6767

6868
logic fontmem_sel, fontmem_sel_next; // font mem select output
6969
always_comb fontmem_sel_o = fontmem_sel; // output to font mem select
70-
font_addr_t pf_font_addr, pf_font_addr_next; // font mem fetch display address
70+
font_addr_t pf_font_addr, pf_font_addr_next; // font mem fetch display address
7171
always_comb fontmem_addr_o = pf_font_addr; // output font mem addr
7272

73-
disp_addr_t pf_line_start; // display mem address of current line
73+
disp_addr_t pf_line_start; // display mem address of current line
7474

7575
logic pf_initial_buf, pf_initial_buf_next;// true on first buffer per scanline
7676
logic pf_words_ready, pf_words_ready_next;// true if data_words full (8-pixels)
77-
disp_data_t pf_disp_word, pf_disp_word_next; // tile attributes and tile index
78-
font_data_t pf_font_byte, pf_font_byte_next; // 1st fetched display data word buffer
77+
disp_data_t pf_disp_word, pf_disp_word_next; // tile attributes and tile index
78+
font_data_t pf_font_byte, pf_font_byte_next; // 1st fetched display data word buffer
7979

8080
logic pf_pixels_buf_full; // true when pf_pixels needs filling
8181
logic [8*v::COLOR_W-1:0] pf_pixels_buf; // 8 pixel buffer waiting for scan out
@@ -133,7 +133,7 @@ always_comb begin
133133
end
134134
FETCH_READ_DISP: begin
135135
pf_disp_word_next = dispmem_data_i; // save attribute+tile
136-
pf_disp_addr_next = pf_disp_addr + 1'b1; // increment display address
136+
pf_disp_addr_next = pf_disp_addr + 1'b1; // increment display address
137137
pf_state_next = FETCH_ADDR_TILE; // read tile bitmap words
138138
end
139139
FETCH_ADDR_TILE: begin
@@ -258,11 +258,11 @@ always_ff @(posedge clk) begin
258258
if (end_of_line_i) begin
259259
scanout <= 1'b0; // force scanout off
260260
pf_disp_addr <= pf_line_start; // addr back to line start (for tile lines, or v repeat)
261-
if (pf_v_count != '0) begin // is line repeating?
261+
if (pf_v_count != '0) begin // is line repeating?
262262
pf_v_count <= pf_v_count - 1'b1; // keep decrementing
263263
end else begin
264264
pf_v_count <= pf_v_repeat_i; // reset v repeat
265-
if (pf_tile_y == $bits(pf_tile_y)'(v::TILE_HEIGHT-1)) begin // is bitmap mode or last line of tile cell?
265+
if (pf_tile_y == $bits(pf_tile_y)'(v::TILE_HEIGHT-1)) begin // is bitmap mode or last line of tile cell?
266266
pf_tile_y <= 3'h0; // reset tile cell line
267267
pf_line_start <= pf_line_start + pf_line_len_i; // calculate next line start address
268268
end else begin

0 commit comments

Comments
 (0)