-
Notifications
You must be signed in to change notification settings - Fork 2
/
video.pio
40 lines (34 loc) · 1.07 KB
/
video.pio
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
/* The FFC from the CPU to the control board has this pinout: */
/* | Pin | Purpose | */
/* |-----|---------| */
/* | 1 | Piezo buzzer | */
/* | 2 | 1.8V supply | */
/* | 3 | GND | */
/* | 4 | 3.3V supply | */
/* | 5 | Shift register clock / Data 2 | */
/* | 6 | CPU to shift register / Data 0 | */
/* | 7 | Video clock (~6MHz) | */
/* | 8 | Command (active low) | */
/* | 9 | Data 1 | */
/* | 10 | ON button | */
/* | 11 | Shift/load | */
/* | 12 | SR Output enable | */
/* | 13 | Shift register to CPU | */
/* | 14 | GND | */
// D0, D1, D2 should be contiguous OUT on PIO
// Command, Video clock should be contiguous SET on PIO
.define VP_CMD 0
.define VP_CLK 1
.define VP_DAT0 2
.define VP_DAT1 3
.define VP_DAT2 4
// OUT pins: start 2, size 3 (data)
// side-set pins: start 1, size 1 (clock)
// We're aiming for 6MHz clock, so a 24MHz PIO speed. Divider target is about 5.2.
// I'll start out closer to 10, to make sure we can operate at a slower speed first.
.program data_send
.side_set 1
.wrap_target
OUT PINS, 3 side 0
NOP side 1
.wrap