1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-24 01:28:25 +02:00

ubb-vga: avoid diodes; redesign for luminance bit (Y) and MMC controller

- ubb-vga.sch: use resistive divider instead of diodes
- ubb-vga.sch, ubb-vga.c (VSYNC): moved VSYNC from DAT3 to CLK to make
  all MMC data lines available for pixel data
- ubb-vga.sch, ubb-vga.c (R): moved red from DAT2 to DAT3 for convenient
  access to the 4th channel
- ubb-vga.sch: added luminance (Y) channel
- ubb-vga.sch: added pull-down to HSYNC/CMD, for later use with the MMC
  controller
- ubb-vga.c (pdfuns, pdfunc, ben_setup, setup): make UBB signals GPIOs,
  in case someone left them in a different configuration
This commit is contained in:
Werner Almesberger 2011-04-27 16:48:07 -03:00
parent ce1c6af24f
commit a794c4b1b2
2 changed files with 298 additions and 169 deletions

View File

@ -48,11 +48,11 @@ static uint8_t thres = 63;
#define CMD (1 << 8)
#define CLK (1 << 9)
#define R DAT2
#define R DAT3
#define G DAT0
#define B DAT1
#define HSYNC CMD
#define VSYNC DAT3
#define VSYNC CLK
/* ----- Ben hardware ------------------------------------------------------ */
@ -73,6 +73,7 @@ static uint32_t old_clkgr;
static volatile uint32_t *pdpin, *pddats, *pddatc;
static volatile uint32_t *pddirs, *pddirc;
static volatile uint32_t *pdfuns, *pdfunc;
static volatile uint32_t *tssr, *tscr;
static volatile uint32_t *tesr, *tecr;
@ -169,6 +170,9 @@ static void ben_setup(void)
pddats = base+0x10314;
pddatc = base+0x10318;
pdfuns = base+0x10344;
pdfunc = base+0x10348;
pddirs = base+0x10364;
pddirc = base+0x10368;
@ -237,6 +241,7 @@ void setup(void)
{
mlockall(MCL_CURRENT | MCL_FUTURE);
ben_setup();
*pdfunc = R | G | B | HSYNC | VSYNC;
*pddirs = R | G | B | HSYNC | VSYNC;
}

View File

@ -1,4 +1,4 @@
EESchema Schematic File Version 2 date Sun Apr 24 02:16:48 2011
EESchema Schematic File Version 2 date Wed Apr 27 16:44:31 2011
LIBS:power
LIBS:device
LIBS:8_10-card
@ -9,237 +9,361 @@ EELAYER END
$Descr A4 11700 8267
Sheet 1 1
Title "UBB VGA Adapter"
Date "24 apr 2011"
Rev "20110424"
Date "27 apr 2011"
Rev "20110427"
Comp "Werner Almesberger"
Comment1 ""
Comment2 ""
Comment3 ""
Comment4 ""
$EndDescr
Text Label 8200 3300 0 60 ~ 0
VSYNC
Text Label 8200 3400 0 60 ~ 0
HSYNC
Text Label 2100 3800 0 60 ~ 0
VSYNC
Text Label 2100 3600 0 60 ~ 0
HSYNC
Text Label 8200 3900 0 60 ~ 0
B
Text Label 8200 3800 0 60 ~ 0
G
Text Label 8200 3200 0 60 ~ 0
R
Wire Wire Line
2550 3800 1800 3800
Wire Wire Line
1800 3800 1800 2550
Wire Wire Line
1800 2550 5150 2550
Wire Wire Line
5150 3300 5150 2550
Wire Wire Line
8850 3300 5150 3300
8150 4100 8150 3400
Connection ~ 4750 3600
Wire Wire Line
3750 3600 4750 3600
Connection ~ 4750 4000
Wire Wire Line
4750 3600 4750 4000
4750 4300 4750 4100
Wire Wire Line
4750 4000 7000 4000
4750 4100 4750 4000
Wire Wire Line
7000 4000 7200 4000
4750 4000 4750 3600
Wire Wire Line
7200 3800 6650 3800
4750 3600 4750 3400
Wire Wire Line
6650 3800 4850 3800
Connection ~ 3950 4000
4750 3400 4750 3200
Wire Wire Line
3750 4000 3950 4000
Connection ~ 7000 4000
Connection ~ 6300 3200
4750 3200 3750 3200
Wire Wire Line
6650 3800 6650 4200
1900 3900 1900 4800
Wire Wire Line
7000 4600 7000 4800
7550 3400 7550 2100
Wire Wire Line
6300 4800 6300 4600
7550 3400 8150 3400
Wire Wire Line
8850 3800 7700 3800
8150 3400 9500 3400
Wire Notes Line
5250 5100 6100 5100
Wire Wire Line
8850 3700 8650 3700
6800 3500 7100 3500
Wire Wire Line
8650 3700 8650 4300
7100 3500 7100 3800
Wire Wire Line
7700 4000 7900 4000
7100 3800 9500 3800
Wire Wire Line
7900 4000 7900 3900
3750 3300 5400 3300
Wire Wire Line
7900 3900 8850 3900
5400 3300 5500 3300
Wire Wire Line
8850 3200 7700 3200
5500 3300 6300 3300
Wire Wire Line
6650 4600 6650 4800
6300 3500 5800 3500
Wire Wire Line
7000 4000 7000 4200
5800 3500 5700 3500
Wire Wire Line
6300 3200 6300 4200
Connection ~ 6650 3800
5700 3500 3750 3500
Connection ~ 5400 3300
Wire Wire Line
3750 3900 3950 3900
5400 3900 5400 3300
Connection ~ 5700 3500
Wire Wire Line
3950 3900 3950 4000
5700 3500 5700 3900
Connection ~ 6000 3700
Wire Wire Line
3950 4000 3950 4200
6000 3700 6000 3900
Connection ~ 5800 2400
Wire Wire Line
3750 3200 6300 3200
5800 2400 5800 2600
Wire Wire Line
6300 3200 7200 3200
1900 3900 2550 3900
Connection ~ 4750 4100
Wire Wire Line
3750 3400 4850 3400
4750 4100 3750 4100
Wire Wire Line
4850 3400 4850 3800
6000 4400 6000 4600
Wire Wire Line
8850 3400 5050 3400
5400 4600 5400 4400
Wire Wire Line
5050 3400 5050 2650
9500 3700 9300 3700
Wire Wire Line
5050 2650 1900 2650
9300 3700 9300 4300
Wire Wire Line
1900 2650 1900 3600
5700 4400 5700 4600
Wire Wire Line
1900 3600 2550 3600
NoConn ~ 2550 3200
NoConn ~ 2550 3400
NoConn ~ 2550 4000
4750 4000 3750 4000
Wire Wire Line
2550 3700 1900 3700
Wire Wire Line
9500 3200 8550 3200
Wire Wire Line
8550 3200 8550 2400
Wire Wire Line
8550 2400 6100 2400
Wire Wire Line
6100 2400 5800 2400
Wire Wire Line
5800 2400 5500 2400
Wire Wire Line
5500 2400 5500 2600
Wire Wire Line
6100 2400 6100 2600
Connection ~ 6100 2400
Wire Wire Line
6100 3100 6100 3700
Connection ~ 6100 3700
Wire Wire Line
5800 3100 5800 3500
Connection ~ 5800 3500
Wire Wire Line
5500 3300 5500 3100
Connection ~ 5500 3300
Wire Wire Line
3750 3700 6000 3700
Wire Wire Line
6000 3700 6100 3700
Wire Wire Line
6100 3700 6300 3700
Wire Wire Line
7550 2100 1900 2100
Wire Wire Line
1900 2100 1900 3700
Wire Wire Line
6800 3300 9500 3300
Wire Wire Line
9500 3900 7000 3900
Wire Wire Line
7000 3900 7000 3700
Wire Wire Line
7000 3700 6800 3700
Wire Notes Line
5700 4950 5700 5700
Wire Wire Line
7550 4800 7550 3600
Wire Wire Line
7550 4800 1900 4800
Wire Wire Line
7550 3600 9500 3600
Connection ~ 8150 3400
Wire Wire Line
3750 3400 4750 3400
Connection ~ 4750 3400
Wire Wire Line
8150 4600 8150 4800
$Comp
L GND #PWR?
U 1 1 4DB870FB
P 8150 4800
F 0 "#PWR?" H 8150 4800 30 0001 C CNN
F 1 "GND" H 8150 4730 30 0001 C CNN
1 8150 4800
1 0 0 -1
$EndComp
Text Label 3950 4000 0 60 ~ 0
VSYNC_GND
Text Label 3950 4100 0 60 ~ 0
HSYNC_GND
Text Label 3950 3600 0 60 ~ 0
BLUE
BLUE_RTN
Text Label 3950 3400 0 60 ~ 0
GREEN
GREEN_RTN
Text Label 3950 3200 0 60 ~ 0
RED
NoConn ~ 3750 3800
NoConn ~ 3750 3700
NoConn ~ 3750 3500
NoConn ~ 3750 3300
NoConn ~ 3750 3100
RED_RTN
$Comp
L GND #PWR1
U 1 1 4DB3B0C4
P 3950 4200
F 0 "#PWR1" H 3950 4200 30 0001 C CNN
F 1 "GND" H 3950 4130 30 0001 C CNN
1 3950 4200
1 0 0 -1
L VGA J1
U 1 1 4DB3AF2A
P 3150 3650
F 0 "J1" H 3350 2950 60 0000 C CNN
F 1 "VGA" H 3150 4400 60 0000 C CNN
1 3150 3650
-1 0 0 1
$EndComp
Text Notes 5250 5700 0 60 ~ 0
1 1 674 mV
Text Notes 5250 5550 0 60 ~ 0
1 0 250 mV
Text Notes 5250 5400 0 60 ~ 0
0 1 490 mV
Text Notes 5250 5250 0 60 ~ 0
0 0 0 mV
Text Notes 5250 5050 0 60 ~ 0
Y R/G/B Vout
Text Label 6650 4800 0 60 ~ 0
VSYNC
Text Label 6650 2100 0 60 ~ 0
HSYNC
Text Notes 7850 5050 0 60 ~ 0
Pull-down for R1 reponse start bit\n
Text Label 8850 3200 0 60 ~ 0
Y
$Comp
L R R4
U 1 1 4DB5D1BA
P 8150 4350
F 0 "R4" V 8230 4350 50 0000 C CNN
F 1 "330" V 8150 4350 50 0000 C CNN
1 8150 4350
-1 0 0 1
$EndComp
$Comp
L GND #PWR4
U 1 1 4DB3B04B
P 7000 4800
F 0 "#PWR4" H 7000 4800 30 0001 C CNN
F 1 "GND" H 7000 4730 30 0001 C CNN
1 7000 4800
1 0 0 -1
L R R10
U 1 1 4DB5D12B
P 6000 4150
F 0 "R10" V 6080 4150 50 0000 C CNN
F 1 "82" V 6000 4150 50 0000 C CNN
1 6000 4150
-1 0 0 1
$EndComp
$Comp
L GND #PWR3
U 1 1 4DB3B04A
P 6650 4800
F 0 "#PWR3" H 6650 4800 30 0001 C CNN
F 1 "GND" H 6650 4730 30 0001 C CNN
1 6650 4800
1 0 0 -1
L R R9
U 1 1 4DB5D129
P 5700 4150
F 0 "R9" V 5780 4150 50 0000 C CNN
F 1 "82" V 5700 4150 50 0000 C CNN
1 5700 4150
-1 0 0 1
$EndComp
$Comp
L GND #PWR2
U 1 1 4DB3B048
P 6300 4800
F 0 "#PWR2" H 6300 4800 30 0001 C CNN
F 1 "GND" H 6300 4730 30 0001 C CNN
1 6300 4800
1 0 0 -1
$EndComp
$Comp
L GND #PWR5
U 1 1 4DB3AFED
P 8650 4300
F 0 "#PWR5" H 8650 4300 30 0001 C CNN
F 1 "GND" H 8650 4230 30 0001 C CNN
1 8650 4300
1 0 0 -1
$EndComp
NoConn ~ 8850 3600
NoConn ~ 8850 3500
$Comp
L DIODE D1
U 1 1 4DB3AF61
P 6300 4400
F 0 "D1" H 6300 4500 40 0000 C CNN
F 1 "1N4148" H 6300 4300 40 0000 C CNN
1 6300 4400
0 -1 1 0
$EndComp
$Comp
L DIODE D2
U 1 1 4DB3AF5F
P 6650 4400
F 0 "D2" H 6650 4500 40 0000 C CNN
F 1 "1N4148" H 6650 4300 40 0000 C CNN
1 6650 4400
0 -1 1 0
$EndComp
$Comp
L DIODE D3
U 1 1 4DB3AF5B
P 7000 4400
F 0 "D3" H 7000 4500 40 0000 C CNN
F 1 "1N4148" H 7000 4300 40 0000 C CNN
1 7000 4400
0 -1 1 0
L R R8
U 1 1 4DB5D125
P 5400 4150
F 0 "R8" V 5480 4150 50 0000 C CNN
F 1 "82" V 5400 4150 50 0000 C CNN
1 5400 4150
-1 0 0 1
$EndComp
NoConn ~ 9500 3500
$Comp
L R R3
U 1 1 4DB3AF4D
P 7450 4000
F 0 "R3" V 7530 4000 50 0000 C CNN
F 1 "1k" V 7450 4000 50 0000 C CNN
1 7450 4000
0 -1 -1 0
U 1 1 4DB5D0E0
P 6100 2850
F 0 "R3" V 6180 2850 50 0000 C CNN
F 1 "1k" V 6100 2850 50 0000 C CNN
1 6100 2850
-1 0 0 1
$EndComp
$Comp
L R R2
U 1 1 4DB3AF4B
P 7450 3800
F 0 "R2" V 7530 3800 50 0000 C CNN
F 1 "1k" V 7450 3800 50 0000 C CNN
1 7450 3800
0 -1 -1 0
U 1 1 4DB5D0DE
P 5800 2850
F 0 "R2" V 5880 2850 50 0000 C CNN
F 1 "1k" V 5800 2850 50 0000 C CNN
1 5800 2850
-1 0 0 1
$EndComp
$Comp
L R R1
U 1 1 4DB5D0DD
P 5500 2850
F 0 "R1" V 5580 2850 50 0000 C CNN
F 1 "1k" V 5500 2850 50 0000 C CNN
1 5500 2850
-1 0 0 1
$EndComp
Text Label 8850 3600 0 60 ~ 0
VSYNC
Text Label 8850 3400 0 60 ~ 0
HSYNC
Text Label 2100 3900 0 60 ~ 0
VSYNC
Text Label 2100 3700 0 60 ~ 0
HSYNC
Text Label 8850 3900 0 60 ~ 0
B
Text Label 8850 3800 0 60 ~ 0
G
Text Label 8850 3300 0 60 ~ 0
R
NoConn ~ 2550 3300
NoConn ~ 2550 3500
NoConn ~ 2550 4100
Text Label 3950 3700 0 60 ~ 0
BLUE
Text Label 3950 3500 0 60 ~ 0
GREEN
Text Label 3950 3300 0 60 ~ 0
RED
NoConn ~ 3750 3900
NoConn ~ 3750 3800
$Comp
L GND #PWR01
U 1 1 4DB3B0C4
P 4750 4300
F 0 "#PWR01" H 4750 4300 30 0001 C CNN
F 1 "GND" H 4750 4230 30 0001 C CNN
1 4750 4300
1 0 0 -1
$EndComp
$Comp
L GND #PWR02
U 1 1 4DB3B04B
P 6000 4600
F 0 "#PWR02" H 6000 4600 30 0001 C CNN
F 1 "GND" H 6000 4530 30 0001 C CNN
1 6000 4600
1 0 0 -1
$EndComp
$Comp
L GND #PWR03
U 1 1 4DB3B04A
P 5700 4600
F 0 "#PWR03" H 5700 4600 30 0001 C CNN
F 1 "GND" H 5700 4530 30 0001 C CNN
1 5700 4600
1 0 0 -1
$EndComp
$Comp
L GND #PWR04
U 1 1 4DB3B048
P 5400 4600
F 0 "#PWR04" H 5400 4600 30 0001 C CNN
F 1 "GND" H 5400 4530 30 0001 C CNN
1 5400 4600
1 0 0 -1
$EndComp
$Comp
L GND #PWR05
U 1 1 4DB3AFED
P 9300 4300
F 0 "#PWR05" H 9300 4300 30 0001 C CNN
F 1 "GND" H 9300 4230 30 0001 C CNN
1 9300 4300
1 0 0 -1
$EndComp
$Comp
L R R7
U 1 1 4DB3AF4D
P 6550 3700
F 0 "R7" V 6630 3700 50 0000 C CNN
F 1 "470" V 6550 3700 50 0000 C CNN
1 6550 3700
0 -1 -1 0
$EndComp
$Comp
L R R6
U 1 1 4DB3AF4B
P 6550 3500
F 0 "R6" V 6630 3500 50 0000 C CNN
F 1 "470" V 6550 3500 50 0000 C CNN
1 6550 3500
0 -1 -1 0
$EndComp
$Comp
L R R5
U 1 1 4DB3AF49
P 7450 3200
F 0 "R1" V 7530 3200 50 0000 C CNN
F 1 "1k" V 7450 3200 50 0000 C CNN
1 7450 3200
P 6550 3300
F 0 "R5" V 6630 3300 50 0000 C CNN
F 1 "470" V 6550 3300 50 0000 C CNN
1 6550 3300
0 -1 -1 0
$EndComp
$Comp
L 8:10-CARD P1
U 1 1 4DB3AF38
P 9150 3500
F 0 "P1" H 8950 4050 60 0000 C CNN
F 1 "UBB" H 9200 2900 60 0000 C CNN
1 9150 3500
P 9800 3500
F 0 "P1" H 9600 4050 60 0000 C CNN
F 1 "UBB" H 9850 2900 60 0000 C CNN
1 9800 3500
1 0 0 -1
$EndComp
$Comp
L VGA J1
U 1 1 4DB3AF2A
P 3150 3550
F 0 "J1" H 3350 2850 60 0000 C CNN
F 1 "VGA" H 3150 4300 60 0000 C CNN
1 3150 3550
-1 0 0 1
$EndComp
$EndSCHEMATC